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); }
public void UnspecifiedOptionalArgumentTest() { this.cakeArgs.Setup( m => m.HasArgument(optionalArgName) ).Returns(false); OptionalArgument uut = ArgumentBinderAliases.CreateFromArguments <OptionalArgument>(this.cakeContext.Object); Assert.IsTrue(uut.BoolProperty); }
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); }
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); }
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); }
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()); }
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()); }