public void Accept_ShouldReturnAccepted() { // 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 = controller.Accept(_serviceAudit); // Assert result.Should().BeOfType <StatusCodeResult>().Which.StatusCode.Should().Be((int)HttpStatusCode.Accepted); _mockAuditServiceFireForget.Verify(e => e.Accept(_serviceAudit), Times.Once); }