public void UnspecifiedOptionalArgumentTest()
        {
            this.cakeArgs.Setup(
                m => m.HasArgument(optionalArgName)
                ).Returns(false);

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

            Assert.AreEqual(defaultValue, uut.StringProperty);
        }
示例#2
0
        public void UnspecifiedOptionalArgumentTest()
        {
            this.cakeArgs.Setup(
                m => m.HasArgument(optionalArgName)
                ).Returns(false);

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

            Assert.IsTrue(uut.BoolProperty);
        }
示例#3
0
        public void UnspecifiedOptionalArgumentTest()
        {
            // Setup
            this.cakeArgs.Setup(
                m => m.HasArgument(optionalArgName)
                ).Returns(false);

            // Act
            OptionalArgument uut = ArgumentBinderAliases.CreateFromArguments <OptionalArgument>(this.cakeContext.Object);

            // Check
            Assert.AreEqual(testDirectoryName, uut.DirectoryPathProperty.ToString());
        }
        public void EmptyStringTest()
        {
            this.cakeArgs.Setup(
                m => m.HasArgument(optionalArgName)
                ).Returns(true);

            this.cakeArgs.Setup(
                m => m.GetArgument(optionalArgName)
                ).Returns(string.Empty);

            OptionalArgument uut = ArgumentBinder.FromArguments <OptionalArgument>(this.cakeContext.Object);

            Assert.AreEqual(string.Empty, uut.StringProperty);
        }
示例#5
0
        public void SpecifiedOptionalArgumentTest()
        {
            this.cakeArgs.Setup(
                m => m.HasArgument(optionalArgName)
                ).Returns(true);

            this.cakeArgs.Setup(
                m => m.GetArgument(optionalArgName)
                ).Returns(maxValue.ToString());

            OptionalArgument uut = ArgumentBinder.FromArguments <OptionalArgument>(this.cakeContext.Object);

            Assert.AreEqual(maxValue, uut.IntProperty);
        }
示例#6
0
        public void SpecifiedOptionalArgumentTest()
        {
            this.cakeArgs.Setup(
                m => m.HasArgument(optionalArgName)
                ).Returns(true);

            this.cakeArgs.Setup(
                m => m.GetArgument(optionalArgName)
                ).Returns("false");

            OptionalArgument uut = ArgumentBinder.FromArguments <OptionalArgument>(this.cakeContext.Object);

            Assert.IsFalse(uut.BoolProperty);
        }
        public void SpecifiedOptionalArgumentTest()
        {
            const string value = "My Value";

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

            this.cakeArgs.Setup(
                m => m.GetArgument(optionalArgName)
                ).Returns(value);

            OptionalArgument uut = ArgumentBinder.FromArguments <OptionalArgument>(this.cakeContext.Object);

            Assert.AreEqual(value, uut.StringProperty);
        }
示例#8
0
        public void EmptyStringTest()
        {
            // Setup
            this.cakeArgs.Setup(
                m => m.HasArgument(optionalArgName)
                ).Returns(true);

            this.cakeArgs.SetupGetArgumentSingle(
                optionalArgName,
                string.Empty
                );

            // Act
            OptionalArgument uut = ArgumentBinderAliases.CreateFromArguments <OptionalArgument>(this.cakeContext.Object);

            // Check
            Assert.AreEqual(string.Empty, uut.DirectoryPathProperty.ToString());
        }
示例#9
0
        public void SpecifiedOptionalArgumentTest()
        {
            // Setup
            const string value = "somedir";

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

            this.cakeArgs.SetupGetArgumentSingle(
                optionalArgName,
                value
                );

            // Act
            OptionalArgument uut = ArgumentBinderAliases.CreateFromArguments <OptionalArgument>(this.cakeContext.Object);

            // Check
            Assert.AreEqual(value, uut.DirectoryPathProperty.ToString());
        }