Exemplo n.º 1
0
        public void DeleteRecords_Returns_OkResult()
        {
            // Arrange
            var recordServiceMock = new Mock <IRecordService>();

            recordServiceMock.Setup(service => service
                                    .DeleteAllRecordsAsync());

            var loggerMock = new Mock <ILogger <RecordsController> >();

            var controller = new RecordsController(recordServiceMock.Object, loggerMock.Object);

            // Act
            var result = controller.DeleteRecords().GetAwaiter().GetResult();

            // Assert
            var okObjectResult = Assert.IsType <OkResult>(result);
        }