public void Test_UploadFilePaymentDocView_Should_Return_ViewName_Correct() { //Arrage var mockRepo = new Mock <IPaymentDocRepository>(); var controller = new PaymentDocController(mockRepo.Object); //Act var target = controller.UploadFilePaymentDocView(); var viewName = target.ViewName; //Assert Assert.AreEqual(viewName, "UploadFilePaymentDocView"); }
public void Test_UploadPaymentDoc_Should_Return_UploadFilePaymentDocView() { //Arrage var paymentFile = MockPaymentDoc(); var mockRepo = new Mock <IPaymentDocRepository>(); var controller = new PaymentDocController(mockRepo.Object); controller.ModelState.AddModelError("Error", ""); //Act var target = controller.UploadFilePaymentDoc(null) as ViewResult; var viewName = target.ViewName; //Assert Assert.AreEqual(viewName, "UploadFilePaymentDocView"); }
public void Test_ShareFilePaymentDocView_Should_Retern_ShareFilePaymentDocView_And_ViewModel() { //Arrage var paymentPayment = MockPaymentDoc(); var mockRepo = new Mock <IPaymentDocRepository>(); mockRepo.Setup(p => p.GetPaymentDocumentById(paymentPayment.PaymentDocId)).Returns(paymentPayment); var controller = new PaymentDocController(mockRepo.Object); //Act var targer = controller.ShareFilePaymentDocView(paymentPayment.PaymentDocId); var viewName = targer.ViewName; var model = targer.Model as SharePaymentViewModel; //Assert Assert.AreEqual(viewName, "ShareFilePaymentDocView"); Assert.IsNotNull(model); }
public void Test_ListAllPaymentDocs_Should_Return_ListAllPaymentDocsView_And_ListData() { //Arrage var listPaymentDoc = MockListPaymentDocs(); var mockRepo = new Mock <IPaymentDocRepository>(); mockRepo.Setup(p => p.GetAllListPaymentDocuments()).Returns(listPaymentDoc); var controller = new PaymentDocController(mockRepo.Object); //Act var result = controller.ListAllPaymentDocs(); var viewName = result.ViewName; var model = result.Model as IEnumerable <PaymentDocument>; //Assert Assert.AreEqual(viewName, "ListAllPaymentDocs"); Assert.IsNotNull(model); }