Ejemplo n.º 1
0
        public void TestTestModelToOnce()
        {
            // Arrange
            var testModel = CreateLoadedTestModel();
            var onceModel = new OnceModel {
                String = "Came From Behind"
            };

            // Act
            ModelMerge.MergeProperties(testModel, onceModel, MergeMode.All);

            // Assert
            Assert.IsTrue(testModel.String.Equals(onceModel.String));
        }
Ejemplo n.º 2
0
        public void TestModelMergeOnce()
        {
            // Arrange
            var firstValue  = "Hello";
            var secondValue = "World";

            var model = new OnceModel {
                String = null
            };
            var newValues1 = new OnceModel {
                String = firstValue
            };
            var newValues2 = new OnceModel {
                String = secondValue
            };

            // Act
            ModelMerge.MergeProperties(model, newValues1, MergeMode.Update);
            ModelMerge.MergeProperties(model, newValues2, MergeMode.Update);

            // Assert
            Assert.IsTrue(model.String.Equals(newValues1.String));
        }