public void WhenContainsInvalidChars_ThenThrowException(string longName) { Assert.Throws <ArgumentException>(() => _ = new CmdAllowedArg('a', false) { LongName = longName }); }
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)); }
public void WhenContainsValidChars_ThenSet(string longName) { var sut = new CmdAllowedArg('a', false) { LongName = longName }; Assert.That(sut.LongName, Is.EqualTo(longName)); }
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." }; }
public void WhenShortNameIsNotValid_ThenThrowException(char shortName) { Assert.Throws <ArgumentException>(() => _ = new CmdAllowedArg(shortName, false)); }