public void ModelListTest() { var mutableModelList = new MutableModelList <TestModel1, MutableTestModel1> { new MutableTestModel1() { TestInt = 666 } }; Assert.AreEqual(666, mutableModelList[0].TestInt); var immutableModelList = mutableModelList.ToImmutable(); Assert.AreEqual(666, immutableModelList[0].TestInt); }
public void ModelListTest() { var mutableModelList = new MutableModelList <TestModel1, MutableTestModel1> { new MutableTestModel1() { TestInt = 666 } }; Assert.AreEqual(666, mutableModelList[0].TestInt); var serializedData = JsonSerializer.SerializeDataContract(mutableModelList, false); Assert.NotNull(serializedData); var immutableModelList = JsonSerializer.DeserializeDataContract <MutableModelList <TestModel1, MutableTestModel1> >(serializedData, false); Assert.AreEqual(666, immutableModelList[0].TestInt); }
public void ModelListTest() { var mutableModelList = new MutableModelList<TestModel1, MutableTestModel1> { new MutableTestModel1() { TestInt = 666 } }; Assert.AreEqual(666, mutableModelList[0].TestInt); var serializedData = JsonSerializer.SerializeDataContract(mutableModelList, false); Assert.NotNull(serializedData); var immutableModelList = JsonSerializer.DeserializeDataContract<MutableModelList<TestModel1, MutableTestModel1>>(serializedData, false); Assert.AreEqual(666, immutableModelList[0].TestInt); }