示例#1
0
        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));
        }
示例#2
0
        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"));
        }
示例#3
0
        public void AccountAsync_WhenAccountWasNotReturnedFromQueryBus_ThrowsIntranetValidationException()
        {
            Controller sut = CreateSut(false);

            Assert.ThrowsAsync <IntranetValidationException>(async() => await sut.AccountAsync(_fixture.Create <int>(), _fixture.Create <string>()));
        }
示例#4
0
        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"));
        }
示例#5
0
        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));
        }
示例#6
0
        public void AccountAsync_WhenAccountNumberIsWhiteSpace_ThrowsIntranetValidationException()
        {
            Controller sut = CreateSut();

            Assert.ThrowsAsync <IntranetValidationException>(async() => await sut.AccountAsync(_fixture.Create <int>(), " "));
        }
示例#7
0
        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)));
        }