public void Contractor_Create_Create_Good_Object() { //Arrnage ContractorController contractorController = new ContractorController(contractorRepository.Object, Mapper.Instance); //Act var result = contractorController.Create(); var viewResult = result as ViewResult; //Assert Assert.IsNotNull(viewResult); Assert.IsNull(viewResult.Model); }
public void Contractor_Create_Works_Good_Object() { //Arrnage var model = new mContractor { Pesel = "123123", FirstName = "asdasd", }; ContractorController contractorController = new ContractorController(contractorRepository.Object, Mapper.Instance); //Act var result = contractorController.Create(model); //Assert Assert.AreEqual(model.Pesel, contractorList.Last().Pesel); }