public void GetSchoolById() { // Arrange var school = DataSeeder.SchoolSeeder.Objects.FirstOrDefault(); Assert.IsNotNull(school, string.Format("No schools were setup in the DataSeeder")); Mock.Get(_repositoryWrapper.School).Setup(x => x.GetSchoolById(school.Id)).ReturnsAsync(school); var controller = new SchoolController(_loggerManager, _mapper, _repositoryWrapper); // Act var actionResult = controller.GetSchoolById(school.Id).Result; // Assert var okObjectResult = actionResult as OkObjectResult; Assert.IsNotNull(okObjectResult); var resultList = okObjectResult.Value as School; Assert.IsTrue(resultList.Id == school.Id); }