Exemple #1
0
        public async Task ReturnNull_When_WebSiteServiceReturnsNull()
        {
            webSiteServiceMock.Setup(service => service.All()).ReturnsAsync(() => null);

            var controller = new WebSiteController(webSiteServiceMock.Object);

            var sut = await controller.Get();

            Assert.NotNull(sut.Result as NoContentResult);
        }
Exemple #2
0
 public WebSiteControllerTests()
 {
     this.webSiteService    = new Mock <IWebSiteService>();
     this.webSiteController = new WebSiteController(this.webSiteService.Object);
 }