Пример #1
0
        public void UnspecifiedOptionalArgumentTest()
        {
            this.cakeArgs.Setup(
                m => m.HasArgument(optionalArgName)
                ).Returns(false);

            OptionalArgument2 uut = ArgumentBinderAliases.CreateFromArguments <OptionalArgument2>(this.cakeContext.Object);

            // Should be the enum set to 0
            Assert.AreEqual(Enum2.Value4, uut.Enum2Property);
        }
Пример #2
0
        public void SpecifiedOptionalArgumentTest()
        {
            const Enum2 expectedValue = Enum2.Value5;

            this.cakeArgs.Setup(
                m => m.HasArgument(optionalArgName)
                ).Returns(true);

            this.cakeArgs.SetupGetArgumentSingle(
                optionalArgName,
                expectedValue.ToString()
                );

            OptionalArgument2 uut = ArgumentBinderAliases.CreateFromArguments <OptionalArgument2>(this.cakeContext.Object);

            Assert.AreEqual(expectedValue, uut.Enum2Property);
        }