public void SerializeAnalyzeV1Response() { var response = new AnalyzeResponse { MissingDependencies = new List <MemberInfo> { new MemberInfo { MemberDocId = "doc1" }, new MemberInfo { MemberDocId = "doc2" } }, SubmissionId = Guid.NewGuid().ToString(), Targets = new List <FrameworkName> { new FrameworkName("target1", Version.Parse("1.0.0.0")) }, UnresolvedUserAssemblies = new List <string> { "assembly1", "assembly2", "assembly3" }, }; var v1 = new AnalyzeResponseV1(response); var newtonsoft = v1.Serialize().Deserialize <AnalyzeResponseV1>(); var dcjs = DeserializeObjectDcjs <AnalyzeResponseV1>(SerializeDcjs(v1)); CompareAnalyzeResponseV1(v1, newtonsoft); CompareAnalyzeResponseV1(v1, dcjs); }
private static void CompareAnalyzeResponseV1(AnalyzeResponseV1 response, AnalyzeResponseV1 deserialized) { CollectionAssertAreEquivalent(response.MissingDependencies, deserialized.MissingDependencies); Assert.Equal(response.SubmissionId, deserialized.SubmissionId); CollectionAssertAreEquivalent(response.Targets, deserialized.Targets); CollectionAssertAreEquivalent(response.UnresolvedUserAssemblies, deserialized.UnresolvedUserAssemblies); }