public void GetAllSchools() { // Arrange Mock.Get(_repositoryWrapper.School).Setup(x => x.GetAllSchools()).ReturnsAsync(DataSeeder.SchoolSeeder.Objects); var controller = new SchoolController(_loggerManager, _mapper, _repositoryWrapper); // Act var actionResult = controller.GetAllSchools().Result; // Assert var okObjectResult = actionResult as OkObjectResult; Assert.IsNotNull(okObjectResult); var reviews = okObjectResult.Value as IEnumerable <School>; Assert.IsTrue(reviews.Count() == DataSeeder.SchoolSeeder.Objects.Count()); }