public void TestsTheMockBreadRepository() { //Arrange IBreadRepository breadRepository = new MockBreadRepository(); //Act int breadCount = (breadRepository.AllBread as List <Bread>).Count; //Assert Assert.NotEqual(0, breadCount); }
public void TestRatingsOnBreadInDetailsView() { //Arrange IBreadRepository breadRepository = new MockBreadRepository(); IProductRepository productRepository = new MockProductRepository(); IRatingRepository ratingRepository = new MockRatingRepository(); var controller = new BreadController(breadRepository, productRepository, ratingRepository); // Act var result = controller.BreadView(1); // Assert Assert.IsType <ViewResult>(result); }
public void TestRateBread() { //Arrange IBreadRepository breadRepository = new MockBreadRepository(); IRatingRepository ratingRepository = new MockRatingRepository(); var controller = new RatingController(ratingRepository, breadRepository); Rating testRating = new Rating(); // Act var result = controller.RateBread(testRating, 1); // Assert Assert.IsType <RedirectToActionResult>(result); }
public void TestsTheBreadView() { //Arrange IBreadRepository breadRepository = new MockBreadRepository(); IProductRepository productRepository = new MockProductRepository(); IRatingRepository ratingRepository = new MockRatingRepository(); var controller = new BreadController(breadRepository, productRepository, ratingRepository); // Act var result = controller.BreadList(); // Assert Assert.NotNull(result); Assert.IsType <ViewResult>(result); }