public void TestWithCNull()
        {
            DerivedDerived c          = null;
            TestClass      testObject = TypesafeActivator.CreateInstance <TestClass> ().With(c);

            Assert.That(testObject.InvocationType, Is.EqualTo(typeof(Derived)));
        }
Ejemplo n.º 2
0
        public void Put_DoesNotClear_PropertiesNotOnEntityType()
        {
            // Arrange
            dynamic delta = new Delta <Base>(typeof(Derived));

            delta.DerivedInt = 24;
            DerivedDerived derived = new DerivedDerived {
                BaseInt = 42, DerivedInt = 0, BaseString = "42", DerivedString = "42", DerivedDerivedInt = 42, DerivedDerivedString = "42"
            };

            // Act
            delta.Put(derived);

            // Assert
            Assert.Equal("42", derived.DerivedDerivedString);
            Assert.Equal(42, derived.DerivedDerivedInt);
        }
Ejemplo n.º 3
0
        public void Put_DoesNotClear_PropertiesNotOnEntityType()
        {
            // Arrange
            dynamic delta = new Delta<Base>(typeof(Derived));
            delta.DerivedInt = 24;
            DerivedDerived derived = new DerivedDerived { BaseInt = 42, DerivedInt = 0, BaseString = "42", DerivedString = "42", DerivedDerivedInt = 42, DerivedDerivedString = "42" };

            // Act
            delta.Put(derived);

            // Assert
            Assert.Equal("42", derived.DerivedDerivedString);
            Assert.Equal(42, derived.DerivedDerivedInt);
        }