public async Task BudgetAccountAsync_WhenBudgetAccountWasReturnedFromQueryBus_ReturnsActionResultWhereResultIsOkObjectResult() { Controller sut = CreateSut(); ActionResult <BudgetAccountModel> result = await sut.BudgetAccountAsync(_fixture.Create <int>(), _fixture.Create <string>()); Assert.That(result.Result, Is.TypeOf <OkObjectResult>()); }
public async Task BudgetAccountAsync_WhenBudgetAccountWasReturnedFromQueryBus_ReturnsNotNull() { Controller sut = CreateSut(); ActionResult <BudgetAccountModel> result = await sut.BudgetAccountAsync(_fixture.Create <int>(), _fixture.Create <string>()); Assert.That(result, Is.Not.Null); }
public async Task AccountAsync_WhenAccountWasReturnedFromQueryBus_ReturnsOkObjectResultWhereValueIsNotNull() { Controller sut = CreateSut(); OkObjectResult result = (OkObjectResult)(await sut.AccountAsync(_fixture.Create <int>(), _fixture.Create <string>())).Result; Assert.That(result.Value, Is.Not.Null); }
public async Task ApplyPostingJournalAsync_WhenPublishAsyncForApplyPostingJournalCommandReturnsPostingJournalResult_ReturnsOkObjectResultWhereValueIsNotNull() { Controller sut = CreateSut(); OkObjectResult result = (OkObjectResult)(await sut.ApplyPostingJournalAsync(_fixture.Create <int>(), CreateApplyPostingLineCollectionModel())).Result; Assert.That(result.Value, Is.Not.Null); }
public async Task BudgetAccountAsync_WhenBudgetAccountWasReturnedFromQueryBus_ReturnsOkObjectResultWhereValueIsBudgetAccountModel() { Controller sut = CreateSut(); OkObjectResult result = (OkObjectResult)(await sut.BudgetAccountAsync(_fixture.Create <int>(), _fixture.Create <string>())).Result; Assert.That(result.Value, Is.TypeOf <BudgetAccountModel>()); }
public async Task ApplyPostingJournalAsync_WhenPublishAsyncForApplyPostingJournalCommandReturnsPostingJournalResult_ReturnsOkObjectResultWhereValueIsApplyPostingJournalResultModel() { Controller sut = CreateSut(); OkObjectResult result = (OkObjectResult)(await sut.ApplyPostingJournalAsync(CreateApplyPostingJournalModel())).Result; Assert.That(result.Value, Is.TypeOf <ApplyPostingJournalResultModel>()); }
public async Task AccountingsAsync_WhenCalled_ReturnsOkObjectResult() { Controller sut = CreateSut(); ActionResult <IEnumerable <AccountingModel> > result = await sut.AccountingsAsync(); Assert.That(result.Result, Is.TypeOf <OkObjectResult>()); }
public async Task CreditorsAsync_WhenCalled_ReturnsActionResultWhereResultIsNotNull() { Controller sut = CreateSut(); ActionResult <ContactAccountCollectionModel> result = await sut.CreditorsAsync(_fixture.Create <int>()); Assert.That(result.Result, Is.Not.Null); }
public async Task ApplyPostingJournalAsync_WhenApplyPostingLineCollectionModelIsValid_AssertPublishAsyncWasCalledOnCommandBusWithApplyPostingJournalCommand() { Controller sut = CreateSut(); await sut.ApplyPostingJournalAsync(_fixture.Create <int>(), CreateApplyPostingLineCollectionModel()); _commandBusMock.Verify(m => m.PublishAsync <IApplyPostingJournalCommand, IPostingJournalResult>(It.IsNotNull <IApplyPostingJournalCommand>()), Times.Once); }
public async Task ApplyPostingJournalAsync_WhenPublishAsyncForApplyPostingJournalCommandReturnsPostingJournalResult_ReturnsActionResultWhereResultIsOkObjectResult() { Controller sut = CreateSut(); ActionResult <ApplyPostingJournalResultModel> result = await sut.ApplyPostingJournalAsync(CreateApplyPostingJournalModel()); Assert.That(result.Result, Is.TypeOf <OkObjectResult>()); }
public async Task ApplyPostingJournalAsync_WhenPublishAsyncForApplyPostingJournalCommandReturnsPostingJournalResult_ReturnsNotNull() { Controller sut = CreateSut(); ActionResult <ApplyPostingJournalResultModel> result = await sut.ApplyPostingJournalAsync(CreateApplyPostingJournalModel()); Assert.That(result, Is.Not.Null); }
public async Task ApplyPostingJournalAsync_WhenPublishAsyncForApplyPostingJournalCommandReturnsNull_ReturnsOkObjectResultWhereValueIsNotNull() { Controller sut = CreateSut(false); OkObjectResult result = (OkObjectResult)(await sut.ApplyPostingJournalAsync(CreateApplyPostingJournalModel())).Result; Assert.That(result.Value, Is.Not.Null); }
public async Task ApplyPostingJournalAsync_WhenApplyPostingJournalModelIsValid_AssertPublishAsyncWasCalledOnCommandBusWithApplyPostingJournalCommandWherePostingLineCollectionIsNotNull() { Controller sut = CreateSut(); await sut.ApplyPostingJournalAsync(CreateApplyPostingJournalModel()); _commandBusMock.Verify(m => m.PublishAsync <IApplyPostingJournalCommand, IPostingJournalResult>(It.Is <IApplyPostingJournalCommand>(command => command.PostingLineCollection != null)), Times.Once); }
public async Task ApplyPostingJournalAsync_WhenPublishAsyncForApplyPostingJournalCommandReturnsPostingJournalResult_ReturnsActionResultWhereResultIsNotNull() { Controller sut = CreateSut(); ActionResult <ApplyPostingJournalResultModel> result = await sut.ApplyPostingJournalAsync(_fixture.Create <int>(), CreateApplyPostingLineCollectionModel()); Assert.That(result.Result, Is.Not.Null); }
public async Task BudgetAccountsAsync_WhenCalled_ReturnsActionResultWhereResultIsOkObjectResult() { Controller sut = CreateSut(); ActionResult <BudgetAccountCollectionModel> result = await sut.BudgetAccountsAsync(_fixture.Create <int>()); Assert.That(result.Result, Is.TypeOf <OkObjectResult>()); }
public async Task PostingLinesAsync_WhenCalled_ReturnsOkObjectResultWhereValueIsNotNull() { Controller sut = CreateSut(); OkObjectResult result = (OkObjectResult)(await sut.PostingLinesAsync(_fixture.Create <int>())).Result; Assert.That(result.Value, Is.Not.Null); }
public async Task AccountingAsync_WhenCalled_ReturnsOkObjectResult() { Controller sut = CreateSut(); ActionResult <AccountingModel> result = await sut.AccountingAsync(_fixture.Create <int>()); Assert.That(result.Result, Is.TypeOf <OkObjectResult>()); }
public async Task BudgetAccountsAsync_WhenCalled_ReturnsNotNull() { Controller sut = CreateSut(); ActionResult <BudgetAccountCollectionModel> result = await sut.BudgetAccountsAsync(_fixture.Create <int>()); Assert.That(result, Is.Not.Null); }
public async Task BudgetAccountsAsync_WhenCalled_ReturnsOkObjectResultWhereValueIsBudgetAccountCollectionModel() { Controller sut = CreateSut(); OkObjectResult result = (OkObjectResult)(await sut.BudgetAccountsAsync(_fixture.Create <int>())).Result; Assert.That(result.Value, Is.TypeOf <BudgetAccountCollectionModel>()); }
public async Task PostingLinesAsync_WhenCalled_ReturnsOkObjectResultWhereValueIsPostingLineCollectionModel() { Controller sut = CreateSut(); OkObjectResult result = (OkObjectResult)(await sut.PostingLinesAsync(_fixture.Create <int>())).Result; Assert.That(result.Value, Is.TypeOf <PostingLineCollectionModel>()); }
public async Task PostingLinesAsync_WhenCalled_ReturnsNotNull() { Controller sut = CreateSut(); ActionResult <PostingLineCollectionModel> result = await sut.PostingLinesAsync(_fixture.Create <int>()); Assert.That(result, Is.Not.Null); }
public async Task AccountingsAsync_WhenCalled_AssertQueryAsyncWasCalledOnQueryBus() { Controller sut = CreateSut(); await sut.AccountingsAsync(); _queryBusMock.Verify(m => m.QueryAsync <EmptyQuery, IEnumerable <IAccounting> >(It.IsNotNull <EmptyQuery>()), Times.Once); }
public void ApplyPostingJournalAsync_WhenApplyPostingJournalModelIsInvalid_ThrowsIntranetValidationExceptionWhereErrorCodeIsEqualToValueCannotBeNull() { Controller sut = CreateSut(modelIsValid: false); IntranetValidationException result = Assert.ThrowsAsync <IntranetValidationException>(async() => await sut.ApplyPostingJournalAsync(CreateApplyPostingJournalModel())); Assert.That(result, Is.Not.Null); Assert.That(result.ErrorCode, Is.EqualTo(ErrorCode.SubmittedMessageInvalid)); }
public async Task BudgetAccountsAsync_WhenCalledWithoutStatusDate_AssertQueryAsyncWasCalledOnQueryBus() { Controller sut = CreateSut(); int accountingNumber = _fixture.Create <int>(); await sut.BudgetAccountsAsync(accountingNumber); _queryBusMock.Verify(m => m.QueryAsync <IGetBudgetAccountCollectionQuery, IBudgetAccountCollection>(It.Is <IGetBudgetAccountCollectionQuery>(value => value.AccountingNumber == accountingNumber && value.StatusDate == DateTime.Today)), Times.Once); }
public async Task PostingLinesAsync_WhenCalledWithoutNumberOfPostingLines_AssertQueryAsyncWasCalledOnQueryBus() { Controller sut = CreateSut(); int accountingNumber = _fixture.Create <int>(); await sut.PostingLinesAsync(accountingNumber); _queryBusMock.Verify(m => m.QueryAsync <IGetPostingLineCollectionQuery, IPostingLineCollection>(It.Is <IGetPostingLineCollectionQuery>(value => value.AccountingNumber == accountingNumber && value.StatusDate == DateTime.Today && value.NumberOfPostingLines == 25)), Times.Once); }
public async Task ApplyPostingJournalAsync_WhenApplyPostingJournalModelIsValid_AssertPublishAsyncWasCalledOnCommandBusWithApplyPostingJournalCommandWhereAccountingNumberIsEqualToAccountNumberFromApplyPostingJournalModel() { Controller sut = CreateSut(); int accountingNumber = _fixture.Create <int>(); await sut.ApplyPostingJournalAsync(CreateApplyPostingJournalModel(accountingNumber)); _commandBusMock.Verify(m => m.PublishAsync <IApplyPostingJournalCommand, IPostingJournalResult>(It.Is <IApplyPostingJournalCommand>(command => command.AccountingNumber == accountingNumber)), Times.Once); }
public void ApplyPostingJournalAsync_WhenApplyPostingJournalModelIsNull_ThrowsIntranetValidationExceptionWhereValidatingFieldIsEqualToApplyPostingJournal() { Controller sut = CreateSut(); IntranetValidationException result = Assert.ThrowsAsync <IntranetValidationException>(async() => await sut.ApplyPostingJournalAsync(null)); Assert.That(result, Is.Not.Null); Assert.That(result.ValidatingField, Is.EqualTo("applyPostingJournal")); }
public void ApplyPostingJournalAsync_WhenApplyPostingJournalModelIsNull_ThrowsIntranetValidationExceptionWhereErrorCodeIsEqualToValueCannotBeNull() { Controller sut = CreateSut(); IntranetValidationException result = Assert.ThrowsAsync <IntranetValidationException>(async() => await sut.ApplyPostingJournalAsync(null)); Assert.That(result, Is.Not.Null); Assert.That(result.ErrorCode, Is.EqualTo(ErrorCode.ValueCannotBeNull)); }
public void BudgetAccountAsync_WhenAccountNumberIsEmpty_ThrowsIntranetValidationExceptionWhereErrorCodeIsEqualToValueCannotBeNullOrWhiteSpace() { Controller sut = CreateSut(); IntranetValidationException result = Assert.ThrowsAsync <IntranetValidationException>(async() => await sut.BudgetAccountAsync(_fixture.Create <int>(), string.Empty)); Assert.That(result, Is.Not.Null); Assert.That(result.ErrorCode, Is.EqualTo(ErrorCode.ValueCannotBeNullOrWhiteSpace)); }
public void ApplyPostingJournalAsync_WhenApplyPostingJournalModelIsInvalid_ThrowsIntranetValidationExceptionWhereValidatingFieldIsNull() { Controller sut = CreateSut(modelIsValid: false); IntranetValidationException result = Assert.ThrowsAsync <IntranetValidationException>(async() => await sut.ApplyPostingJournalAsync(CreateApplyPostingJournalModel())); Assert.That(result, Is.Not.Null); Assert.That(result.ValidatingField, Is.Null); }