public async Task TestSendDocumentForApprovalReadEventsErrorBadRequestResult() { //Arrange const string error = "testError"; _documentsController = new DocumentsController(TestHelper.ReadEventsFuncWithError(error), TestHelper.SaveAndPublish, DocumentExistsByNumber, TestHelper.GetDocumentById(), TestHelper.GetCurrentUserId()); //Act var result = await _documentsController.SendDocumentForApproval(Guid.Empty); //Assert var badRequestResult = result as BadRequestObjectResult; Assert.NotNull(badRequestResult); Assert.NotNull(badRequestResult.Value); }
public async Task TestSendDocumentForApprovalInvalidIdBadRequestResult() { //Arrange var documentCreatedDto = new DocumentCreatedEventDto(Guid.Empty, DateTime.UtcNow, Guid.Empty, "1234", string.Empty); var readEventsFunc = TestHelper.ValidReadEventsFunc(documentCreatedDto.ToEvent()); _documentsController = new DocumentsController(readEventsFunc, TestHelper.SaveAndPublish, DocumentExistsByNumber, TestHelper.GetDocumentById(), TestHelper.GetCurrentUserId()); //Act var result = await _documentsController.SendDocumentForApproval(Guid.Empty); //Assert var badRequestResult = result as BadRequestObjectResult; Assert.NotNull(badRequestResult); Assert.NotNull(badRequestResult.Value); }