public void DetailsWithoutIdReturnsNotFound() { //arrange controller = new BillsController(null, null, null); //act var result = controller.Details(null); //assert Assert.IsInstanceOfType(result, typeof(HttpStatusCodeResult)); }
public void DetailsActionReturnsViewWithBillVM() { //arrange controller = new BillsController(mockBillService.Object, null, null); //act var result = controller.Details(1) as ViewResult; //assert Assert.IsInstanceOfType(result.Model, typeof(CreateBillVM)); }
public async Task Edit_should_return_edit_view() { var controller = new BillsController(_applicationDbContext); var viewResult = await controller.Details(1); var viewName = ((ViewResult)viewResult).ViewName; var model = ((ViewResult)viewResult).Model; BillViewModel billViewModel = ((BillViewModel)model); Assert.True(string.IsNullOrEmpty(viewName) || viewName == "Edit"); Assert.IsType <BillViewModel>(model); Assert.NotEqual <string>(billViewModel.bill.Times, ""); }