public void HeroExistsTestTrue() { //Arrange var heroId = -1; var hero = new Hero(); heroRepositoryMock.Setup(x => x.GetById(heroId)) .Returns(hero).Verifiable("should call getById of GenericRepository"); //Act var isExists = heroService.HeroExists(heroId); //Assert Assert.IsTrue(isExists); unitOfWorkMock.Verify(); heroRepositoryMock.Verify(); }