Exemple #1
0
 public void WhenContainsInvalidChars_ThenThrowException(string longName)
 {
     Assert.Throws <ArgumentException>(() => _ = new CmdAllowedArg('a', false)
     {
         LongName = longName
     });
 }
Exemple #2
0
            public void WhenShortNameValid_ThenSetProperties(char shortName)
            {
                var sut = new CmdAllowedArg(shortName, true);

                Assert.That(sut.ShortName, Is.EqualTo(shortName));
                Assert.That(sut.HasValue, Is.True);
            }
 private static void AssertAreEqual(CmdArg cmdArg, CmdAllowedArg cmdAllowedArg)
 {
     Assert.That(cmdArg.ShortName, Is.EqualTo(cmdAllowedArg.ShortName));
     Assert.That(cmdArg.LongName, Is.EqualTo(cmdAllowedArg.LongName));
     Assert.That(cmdArg.Description, Is.EqualTo(cmdAllowedArg.Description));
     Assert.That(cmdArg.HasValue, Is.EqualTo(cmdAllowedArg.HasValue));
 }
Exemple #4
0
            public void WhenContainsValidChars_ThenSet(string longName)
            {
                var sut = new CmdAllowedArg('a', false)
                {
                    LongName = longName
                };

                Assert.That(sut.LongName, Is.EqualTo(longName));
            }
Exemple #5
0
            public void SetUp()
            {
                _allowedPathArg = new CmdAllowedArg('p', true)
                {
                    LongName    = "path",
                    Description = "Path to the file."
                };

                _allowedAllFilesArg = new CmdAllowedArg('a', false)
                {
                    LongName    = "allfiles",
                    Description = "Should use all files."
                };
            }
Exemple #6
0
 public void WhenShortNameIsNotValid_ThenThrowException(char shortName)
 {
     Assert.Throws <ArgumentException>(() => _ = new CmdAllowedArg(shortName, false));
 }