public void InterfaceSerialize_ResourceWithIListOfInterfaces() { var mock = CollectionMocks.GetResourceWithIListOfInterfacesMock(); var result = SerializeJson(mock.TestObject, mock.typeToConvert); Assert.IsNotNull(result); Assert.AreEqual(GetNormalizedJson(mock.JsonData), result); }
public void InterfaceDeserialize_ResourceWithIListOfInterfaces() { var mock = CollectionMocks.GetResourceWithIListOfInterfacesMock(); var result = DeserializeJson <ResourceWithIListOfInterfaces>(mock.JsonData, mock.typeToConvert); Assert.IsNotNull(result); Assert.IsInstanceOf <ResourceWithIListOfInterfaces>(result, "Wrong instance"); Assert.IsNotNull(result.Collection); Assert.IsTrue(result.Collection.Count == 2); Assert.AreEqual("Test", result.Collection[0].Param1); Assert.AreEqual("Test2", result.Collection[1].Param1); }