Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Porting Serialization Tests in NetNative Repo - #20308

Merged
shmao merged 4 commits into
dotnet:masterfrom
stone-li:netnative
Jun 1, 2017
Merged

Porting Serialization Tests in NetNative Repo#20308
shmao merged 4 commits into
dotnet:masterfrom
stone-li:netnative

Conversation

@stone-li

Copy link
Copy Markdown
Contributor

@huanwu @shmao
Please help review the code

}

[Fact]
public static void DCS_ReadOnlyDictionaryCausingDuplicateInvalidDataContract()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This test failed on netfx as test DCS_ReadOnlyDictionary did because of #18312.

@stone-li can you please move the test next to DCS_ReadOnlyDictionary and put the following attribute on it?

[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "dotnet/corefx #18312")]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I move the DCJS part found that the rest of the code same with DCS_ReadOnlyDictionary, so I remove this test in DCS, just keep DCJS part test

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sounds good. Thanks!

Assert.StrictEqual(value["Foo"], deserializedValue["Foo"]);
Assert.StrictEqual(value["Bar"], deserializedValue["Bar"]);

DataContractJsonSerializer dcjs = new DataContractJsonSerializer(typeof(ReadOnlyDictionary<string, int>));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The test code is incomplete. The original test probably was also incomplete.

Can you please complete this test and move this part to the DCJS test project?

{
throw new NotImplementedException();
}
public string Name { get; set; }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: NewLine after the bracket.

}



Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you please leave one NewLine and remove the extra ones? Thanks!

dict["Foo"] = 1;
dict["Bar"] = 2;
var value = new ReadOnlyDictionary<string, int>(dict);
var deserializedValue = SerializeAndDeserialize(value, "{\"_dictionary\":[{\"Key\":\"Foo\",\"Value\":1},{\"Key\":\"Bar\",\"Value\":2}]}", null, () => new DataContractJsonSerializer(typeof(ReadOnlyDictionary<string, int>)));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This test is failing. After #20247 merged, we need to change the field name to m_dictionary. Besides, we now should be able to remove [SkipOnTargetFramework].

@shmao

shmao commented Jun 1, 2017

Copy link
Copy Markdown
Contributor

LGTM. Thanks for the pull request, @stone-li .

@shmao
shmao merged commit f912f36 into dotnet:master Jun 1, 2017
@joperezr

joperezr commented Jun 1, 2017

Copy link
Copy Markdown
Member

Looks like this PR has regressed our uapaot ILC tests since it added the dependency to NativeDll.dll which is not present. It broke around 5 test projects for that reason, so we will have to find a way of separating that NativeDll.dll dependency.

@shmao

shmao commented Jun 1, 2017

Copy link
Copy Markdown
Contributor

@joperezr I sent out a PR for disabling the test on uapaot. #20594

@joperezr

joperezr commented Jun 2, 2017

Copy link
Copy Markdown
Member

Oh great, I had not seen that earlier, thanks for fixing it!

@stone-li
stone-li deleted the netnative branch June 5, 2017 07:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants