Beispiel #1
0
        public void BulkCreate_PostedInvoicesToSave_SuccessfulRedirectToRoute()
        {
            //arrange
            var invoices = new List <CreateBulkInvoiceViewModel>();

            mockInvoiceService.Setup(s => s.BulkCreate(It.IsAny <List <CreateBulkInvoiceViewModel> >())).Returns(1);

            //act
            var result = (RedirectToActionResult)_controller.BulkCreate(invoices);

            //ass
            Assert.AreEqual("BulkMain", result.ActionName);  //ensure redirect successfully to this route
        }