예제 #1
0
        public void ShouldSetFlagWithForwardSlash()
        {
            var argument = new Argument("f", null);

            var builtArgument = argumentBuilder.Build(argument);

            Assert.That(builtArgument, Is.EqualTo("/f"));
        }
        public void ShouldSetSwitchFlag()
        {
            var argument = new Argument("Force", null);

            var builtArgument = argumentBuilder.Build(argument);

            Assert.That(builtArgument, Is.EqualTo("-Force"));
        }
예제 #3
0
        public void ShouldSetFlagWithSingleHyphenIfOneCharacterFlag()
        {
            var argument = new Argument("f", null);

            var builtArgument = argumentBuilder.Build(argument);

            Assert.That(builtArgument, Is.EqualTo("-f"));
        }
예제 #4
0
        public void ShouldSetFlagWithDoubleHyphenIfMultisCharacterFlag()
        {
            var argument = new Argument("f1", null);

            var builtArgument = argumentBuilder.Build(argument);

            Assert.That(builtArgument, Is.EqualTo("--f1"));
        }
예제 #5
0
        public void ShouldOnlyUseValueIfNoFlagSpecifiedForArgument()
        {
            var argument = new Argument(null, "val");

            var builtArgument = argumentBuilder.Build(argument);

            Assert.That(builtArgument, Is.EqualTo("val"));
        }
예제 #6
0
        public void ShouldOnlyUseTheFlagIfValueIsNotAString()
        {
            var argument = new Argument("flag", true);

            var builtArgument = argumentBuilder.Build(argument);

            Assert.That(builtArgument, Is.EqualTo("--flag"));
        }
예제 #7
0
        public void ShouldBeNullIfFlagIsNullAndValueIsNotString()
        {
            var argument = new Argument(null, new object());

            var builtArgument = argumentBuilder.Build(argument);

            Assert.That(builtArgument, Is.Null);
        }
예제 #8
0
        public void ShouldBeNullIfFlagAndValueAreNull()
        {
            var argument = new Argument(null, null);

            var builtArgument = argumentBuilder.Build(argument);

            Assert.That(builtArgument, Is.Null);
        }
예제 #9
0
 public string BuildArgument(Argument argument)
 {
     return ArgumentBuilder.Build(argument);
 }
예제 #10
0
파일: Posh.cs 프로젝트: srasch/cmd
 public string BuildArgument(Argument argument)
 {
     throw new System.NotImplementedException();
 }
예제 #11
0
        public void ShouldUseBothFlagAndValueIfValueIsString()
        {
            var argument = new Argument("flag", "val");

            var builtArgument = argumentBuilder.Build(argument);

            Assert.That(builtArgument, Is.EqualTo("--flag val"));
        }