コード例 #1
0
        public void WHEN_InheritedMembersAreNotIncluded_THEN_MethodIsNotExecuted()
        {
            var args     = new string[] { "method", "/Property=7" };
            var instance = new DerivedClass();

            instance.Property = 0;
            CmdLine <DerivedClass> .Execute(args, instance).Should().Be(-1);

            instance.Property.Should().Be(0);
            WasNonStaticMethodCalled.Should().BeFalse();
            WasStaticMethodCalled.Should().BeFalse();
        }
コード例 #2
0
        public void WHEN_ArgIsForField_THEN_FieldIsSet_AND_MethodIsExecuted()
        {
            var args     = new string[] { "method", "/Field=7" };
            var instance = new DerivedAllIncludedClass();

            instance.Field = 0;
            CmdLine <DerivedAllIncludedClass> .Execute(args, instance).Should().Be(0);

            instance.Field.Should().Be(7);
            WasNonStaticMethodCalled.Should().BeTrue();
            WasStaticMethodCalled.Should().BeFalse();
        }