public void GetAllBugsShouldNotReturnNull()
        {
            //Arrange
            _bugsGatewayMock.Setup(gateway => gateway.GetAllBugs())
            .ReturnsAsync(new List <BugsModel>(1)
            {
                new BugsModel()
                {
                    BugTitle = "test",
                    IsOpen   = true
                }
            });

            //Act
            var result = _bugsService.GetAllBugs();

            //Assert
            Assert.NotNull(result);
        }
コード例 #2
0
 public ActionResult <IEnumerable <Bug> > GetAllBugs()
 {
     try
     {
         return(Ok(_bs.GetAllBugs()));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }