Skip to content

Conversation

@adamralph
Copy link
Contributor

fixes #700

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to change this test and ShouldSerializeDelegates to verify the result similar to what you did in ShouldSerialize. All it does now is verify that there is no exception, not that the result is correct ;-)

@glennblock
Copy link
Contributor

Overall LGTM, but I think we should improve the two tests I mentioned if we are in this code.

@adamralph
Copy link
Contributor Author

Very good point. I'll add that shortly.
On 6 Feb 2015 07:42, "Glenn Block" notifications@github.com wrote:

Overall LGTM, but I think we should improve the two tests I mentioned if
we are in this code.


Reply to this email directly or view it on GitHub
#920 (comment).

@adamralph
Copy link
Contributor Author

@glennblock the serialization of Type methods is enormous. Are we sure we want to do this? IIRC this test was added after I witnessed typeof(Type).GetMethods(); blow up on stage for Jon Skeet at NDC London and ensuring an exception wasn't thrown was it's specific purpose.

The serialization of the Action and Func is of a manageable size.

@adamralph
Copy link
Contributor Author

Ugh... there's also a problem with asserting the Action and Func. The names of the hoisted methods are not deterministic. E.g. if I run just the single test method, the hoisted method is named <ShouldSerializeDelegates>b__3. If I run the entire test class, the hoisted method is named <ShouldSerializeDelegates>b__6.

I think we'll have to leave these tests as they are, but I've refactored them to 3A's, instead of using the Assert.Throws().

@adamralph
Copy link
Contributor Author

Ultimately, we're not trying to assert the serialization of all object types in this test class, but there are specific cases for which we originally had errors, i.e. the methods of Type and any Action or Func, so at least those tests are locking in the serialization of those types without errors.

@glennblock
Copy link
Contributor

OK, sounds good.

glennblock added a commit that referenced this pull request Feb 7, 2015
fix for 700: changed ObjectSerializer to remove $id and $ref unless there is a circular ref
@glennblock glennblock merged commit a319850 into scriptcs:dev Feb 7, 2015
@adamralph adamralph deleted the 700 branch February 7, 2015 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove redundant $id from JSON strings in REPL

2 participants