public void InterfaceSerialize_ObjectWithNestedObject() { var mock = ObjectMocks.GetObjectWithNestedObjectMock(); var result = SerializeJson(mock.TestObject, mock.typeToConvert); Assert.IsNotNull(result); Assert.AreEqual(GetNormalizedJson(mock.JsonData), result); }
public void InterfaceDeserialize_ObjectWithNestedObject() { var mock = ObjectMocks.GetObjectWithNestedObjectMock(); var result = DeserializeJson <INested>(mock.JsonData, mock.typeToConvert); Assert.IsNotNull(result); Assert.IsInstanceOf <Nested>(result, "Wrong instance"); Assert.AreEqual("Test", result.Param2); Assert.IsInstanceOf <Nested>(result.NestedObject, "Wrong instance"); Assert.AreEqual("Test2", result.NestedObject.Param2); }