Exemple #1
0
        public async Task DeletePaymentTerm_WhenCalledWithNumber_ReturnsRedirectToActionResult()
        {
            Controller sut = CreateSut();

            IActionResult result = await sut.DeletePaymentTerm(_fixture.Create <int>());

            Assert.That(result, Is.TypeOf <RedirectToActionResult>());
        }
Exemple #2
0
        public async Task DeletePaymentTerm_WhenCalledWithNumber_ReturnsRedirectToActionResultWhereActionNameIsEqualToPaymentTerms()
        {
            Controller sut = CreateSut();

            RedirectToActionResult result = (RedirectToActionResult)await sut.DeletePaymentTerm(_fixture.Create <int>());

            Assert.That(result.ActionName, Is.EqualTo("PaymentTerms"));
        }
Exemple #3
0
        public async Task DeletePaymentTerm_WhenCalledWithNumber_AssertPublishAsyncWasCalledOnCommandBus()
        {
            Controller sut = CreateSut();

            int number = _fixture.Create <int>();
            await sut.DeletePaymentTerm(number);

            _commandBusMock.Verify(m => m.PublishAsync(It.Is <IDeletePaymentTermCommand>(value => value.Number == number)), Times.Once);
        }