public void IsIcaoCodeStringValid_WithInvalidCodes_ShouldWork(string icaoCode) { //Act bool result = IcaoCodeChecking.IsIcaoCodeStringValid(icaoCode); //Assert result.Should().BeFalse(); }
ThrowExceptionIfContainsInvalidIcaoCode_WithInvalidCodes_ShouldThrow_InvalidIcaoCodeException( string[] icaoCodes) { //Act Action act = () => IcaoCodeChecking.ThrowExceptionIfContainsInvalidIcaoCode(icaoCodes); //Assert act.Should().ThrowExactly <InvalidIcaoCodeException>(); }
public void ThrowExceptionIfContainsInvalidIcaoCode_WithValidCodes_ShouldNotThrow_InvalidIcaoCodeException( string[] icaoCodes) { //Act Action act = () => IcaoCodeChecking.ThrowExceptionIfContainsInvalidIcaoCode(icaoCodes); //Assert act.Should().NotThrow(); }
public void ThrowExceptionIfIcaoCodeIsInvalid_WithValidCodes_ShouldNotThrow_InvalidIcaoCodeException( string icaoCode) { //Act Action act = () => IcaoCodeChecking.ThrowExceptionIfIcaoCodeIsInvalid(icaoCode); //Assert act.Should().NotThrow(); }
ThrowExceptionIfContainsInvalidIcaoCode_WithNullCollection_ShouldThrow_ArgumentNullException() { //Act // ReSharper disable once AssignNullToNotNullAttribute, because it is a test case Action act = () => IcaoCodeChecking.ThrowExceptionIfContainsInvalidIcaoCode(null); //Assert act.Should().ThrowExactly <ArgumentNullException>(); }
/// <summary> /// Constructor from <c>string</c>. /// </summary> /// <param name="icaoCode">String airport ICAO code.</param> /// <exception cref="InvalidIcaoCodeException"> /// If <paramref name="icaoCode" /> is invalid string ICAO code. /// </exception> public IcaoCode([NotNull] string icaoCode) { IcaoCodeChecking.ThrowExceptionIfIcaoCodeIsInvalid(icaoCode); Code = icaoCode; }