コード例 #1
0
        public void BugService_get_all_bugs()
        {
            var bugs = new List <Data.Entity.Bug> {
                new Data.Entity.Bug {
                    IdBug = Guid.NewGuid(), Name = "Bug One"
                },
                new Data.Entity.Bug {
                    IdBug = Guid.NewGuid(), Name = "Bug Two"
                },
            };

            _bugRepository.Setup(x => x.GetAll()).Returns(bugs);

            var resut = _bugService.GetAll();

            Assert.IsTrue(resut.Any());
            _bugRepository.Verify(x => x.GetAll(), Times.Once());
        }