public void WhenApplyTriggerOnBaseClassProperty_ShouldNotThrow()
        {
            var    derived = new DerivedTest();
            Action action  = () => new PropertyNotChangedTrigger(derived, "TestProperty", TimeSpan.Zero);

            action.ShouldNotThrow();
        }
    static void Main(string[] args)
    {
        var    test = new DerivedTest();
        object o    = test.Func();

        Console.WriteLine(o == null);
        Console.ReadLine();
    }
示例#3
0
        public static BaseTest Gen()
        {
            DerivedTest dt = new DerivedTest();

            //dt.x = 1;
            dt.Y = 2;

            return(dt);
        }
        public void WhenApplyConditionToDerivedClass_ShouldNotThrow()
        {
            var derived = new DerivedTest();

            derived.PropertyIntTest = 1;
            var testee = new PropertyEqualityCondition(derived, "PropertyIntTest", 1);

            Action action = () => testee.IsTrue();

            action.ShouldNotThrow();
        }
    public void TestMethod()
    {
        // arrange
        var instance = new DerivedTest();

        // act
        var result = instance.SomeMethod("test");

        // assert
        Assert.IsTrue(instance.WasCalled);
    }
        public void WhenApplyConditionToDerivedClassWithProtectedVirtualReadonlyProperty_ShouldNotThrow()
        {
            var derived = new DerivedTest();
            var testee  = new PropertyEqualityCondition(derived, "AbstractProtectedPropertyTest", 99);

            derived.SetTestValue(99);

            Action action = () => testee.IsTrue();

            action.ShouldNotThrow();
            testee.IsTrue().Should().BeTrue();

            derived.SetTestValue(10);
            testee.IsTrue().Should().BeFalse();
        }