public void AccountAsync_WhenAccountWasNotReturnedFromQueryBus_ThrowsIntranetValidationExceptionWhereErrorCodeIsEqualToValueShouldBeKnown() { Controller sut = CreateSut(false); IntranetValidationException result = Assert.ThrowsAsync <IntranetValidationException>(async() => await sut.AccountAsync(_fixture.Create <int>(), _fixture.Create <string>())); Assert.That(result, Is.Not.Null); Assert.That(result.ErrorCode, Is.EqualTo(ErrorCode.ValueShouldBeKnown)); }
public void AccountAsync_WhenAccountWasNotReturnedFromQueryBus_ThrowsIntranetValidationExceptionWhereValidatingFieldIsEqualToAccountNumber() { Controller sut = CreateSut(false); IntranetValidationException result = Assert.ThrowsAsync <IntranetValidationException>(async() => await sut.AccountAsync(_fixture.Create <int>(), _fixture.Create <string>())); Assert.That(result, Is.Not.Null); Assert.That(result.ValidatingField, Is.EqualTo("accountNumber")); }
public void AccountAsync_WhenAccountWasNotReturnedFromQueryBus_ThrowsIntranetValidationException() { Controller sut = CreateSut(false); Assert.ThrowsAsync <IntranetValidationException>(async() => await sut.AccountAsync(_fixture.Create <int>(), _fixture.Create <string>())); }
public void AccountAsync_WhenAccountNumberIsWhiteSpace_ThrowsIntranetValidationExceptionWhereValidatingFieldIsEqualToAccountNumber() { Controller sut = CreateSut(); IntranetValidationException result = Assert.ThrowsAsync <IntranetValidationException>(async() => await sut.AccountAsync(_fixture.Create <int>(), " ")); Assert.That(result, Is.Not.Null); Assert.That(result.ValidatingField, Is.EqualTo("accountNumber")); }
public void AccountAsync_WhenAccountNumberIsWhiteSpace_ThrowsIntranetValidationExceptionWhereErrorCodeIsEqualToValueCannotBeNullOrWhiteSpace() { Controller sut = CreateSut(); IntranetValidationException result = Assert.ThrowsAsync <IntranetValidationException>(async() => await sut.AccountAsync(_fixture.Create <int>(), " ")); Assert.That(result, Is.Not.Null); Assert.That(result.ErrorCode, Is.EqualTo(ErrorCode.ValueCannotBeNullOrWhiteSpace)); }
public void AccountAsync_WhenAccountNumberIsWhiteSpace_ThrowsIntranetValidationException() { Controller sut = CreateSut(); Assert.ThrowsAsync <IntranetValidationException>(async() => await sut.AccountAsync(_fixture.Create <int>(), " ")); }
public void AccountAsync_WhenAccountNumberIsEmpty_ThrowsIntranetValidationExceptionWhereValidatingTypeIsTypeOfString() { Controller sut = CreateSut(); IntranetValidationException result = Assert.ThrowsAsync <IntranetValidationException>(async() => await sut.AccountAsync(_fixture.Create <int>(), string.Empty)); Assert.That(result, Is.Not.Null); Assert.That(result.ValidatingType, Is.EqualTo(typeof(string))); }