public async void DeleteWidgetWithCorrectIdWillReturnOk()
        {
            _mockedRepository.Setup(x => x.DeleteByIdAsync(It.IsAny <int>())).ReturnsAsync(1);
            var myController = new WidgetsController(_mockedRepository.Object);
            var actionResult = await myController.DeleteWidget(It.IsAny <int>());

            Assert.NotNull(actionResult);
            Assert.IsType <OkObjectResult>(actionResult.Result);
        }
Example #2
0
        public void DeleteWidget_CorrectResponse()
        {
            var result = controller.DeleteWidget(1) as EmptyResult;

            Assert.NotNull(result);
        }