public async Task FilterProducts_SendViableValues_ReturnView() { // Arrange SellListingsController controller = new SellListingsController(context); // Act var actionResult = await controller.FilterProducts("Hello", 3, 200); // Assert Assert.IsType <ViewResult>(actionResult); }
public async Task FilterMerchandise_SendNullData_ReturnView() { // Arrange SellListingsController controller = new SellListingsController(context); // Act var actionResult = await controller.FilterMerchandise(null, 0, 0); // Assert Assert.IsType <ViewResult>(actionResult); }
public void Details_PassInNull_ReturnNotFound() { // Arrange SellListingsController controller = new SellListingsController(context); // Act var actionResult = controller.Details(null); // Assert Assert.IsType <NotFoundResult>(actionResult.Result); }
public void ChooseIndex_PassIn2_ReturnRedirection() { // Arrange SellListingsController controller = new SellListingsController(context); // Act var actionResult = controller.ChooseIndex(2); // Assert Assert.IsType <RedirectToActionResult>(actionResult.Result); }
public async void MerchandiseIndex_CallFunction_ReturnView() { // Arrange SellListingsController controller = new SellListingsController(context); // Act var actionResult = await controller.MerchandiseIndex(); // Assert Assert.IsType <ViewResult>(actionResult); }
public void PopulateDropdown_SendYes_ReturnListOfSelectListItems() { // Arrange SellListingsController controller = new SellListingsController(context); // Act var list = controller.PopulateDropdown("Yes"); // Assert Assert.True(list.Count > 0); }
public void SetViewBag_PassInHelloAndNothing_ReturnCollapseAndHelloInViewBags() { // Arrange SellListingsController controller = new SellListingsController(context); // Act controller.SetViewBag("Hello", 0, 0, ""); // Assert Assert.Equal("collapse", controller.ViewBag.Collapse); Assert.Equal("Hello", controller.ViewBag.Search); }