public async Task CreateAsync_ShouldReturnCreated() { // Arrange _mockLogger .Setup(logger => logger.LogInformation(It.IsAny <string>())) .Verifiable(); _mockAuditService .Setup(e => e.CreateAsync(_serviceAudit)) .Returns(Task.CompletedTask) .Verifiable(); _mockAuditServiceFireForget .Setup(e => e.Accept(_serviceAudit)) .Verifiable(); AuditController controller = new AuditController(_mockLogger.Object, _mockAuditService.Object, _mockAuditServiceFireForget.Object); // Act var result = await controller.CreateAsync(_serviceAudit); // Assert result.Should().BeOfType <StatusCodeResult>().Which.StatusCode.Should().Be((int)HttpStatusCode.Created); _mockAuditService.Verify(x => x.CreateAsync(_serviceAudit), Times.Once); }