public void updateDemographic_Failed() { // Arrange var controller = new RegistrationController(new RegistrationRepository(token)); // Act var demographicsViewModel = new ContactDemographicsViewModel { ContactID = 0, ContactTypeID = 1, ClientTypeID = 1, FirstName = "FirstName", Middle = "MiddleName", LastName = "LastName", SuffixID = 1, GenderID = 1, TitleID = 1, DOB = DateTime.Now, DOBStatusID = 1, SSN = "123451234", SSNStatusID = 1, DriverLicense = "8765477", IsPregnant = false, PreferredName = "PreferredName", DeceasedDate = DateTime.Now, ContactMethodID = 1, Age = 1, ReferralSourceID = 1, ContactPresentingProblem = new ContactPresentingProblemModel() { ContactPresentingProblemID = 0, EffectiveDate = DateTime.Now, ExpirationDate = DateTime.Now, PresentingProblemTypeID = 1 }, Addresses = new List <ContactAddressModel> { new ContactAddressModel() { AddressTypeID = 1, Line1 = "C40", City = "Noida", StateProvince = 1, County = 1, EffectiveDate = DateTime.Now, ExpirationDate = DateTime.Now.AddDays(2), MailPermissionID = 1 } } }; var modelResponse = controller.UpdateContactDemographics(demographicsViewModel); var rowAffected = modelResponse.RowAffected; // Assert Assert.IsTrue(rowAffected == 0); }
public void UpdateContactDemographic_Failed() { Mock_ContactDemographics_Failed(); // Arrange RegistrationController contactDemographicController = new RegistrationController(registrationDataProvider); //Act var updateContactDemographicResult = contactDemographicController.UpdateContactDemographics(emptyContactDemographicModel); var response = updateContactDemographicResult as HttpResult <Response <ContactDemographicsModel> >; var contactDemography = response.Value.DataItems; //Assert Assert.IsNull(response.Value.DataItems[0].FirstName); Assert.IsNull(response.Value.DataItems[0].LastName); }
public void UpdateContactDemographic_Failed() { // Arrange ContactDemographics_Failed(); RegistrationController contactDemographicController = new RegistrationController(registrationRuleEngine); //Act var updateContactDemographicResult = contactDemographicController.UpdateContactDemographics(contactDemographicModel); var response = updateContactDemographicResult as HttpResult <Response <ContactDemographicsModel> >; var contactDemography = response.Value.DataItems; var count = contactDemography.Count(); //Assert Assert.IsNull(contactDemography[0].FirstName); Assert.IsNull(contactDemography[0].LastName); }
public void UpdateContactDemographic_Success() { Mock_ContactDemographics_Success(); // Arrange RegistrationController contactDemographicController = new RegistrationController(registrationDataProvider); //Act var updateContactDemographicResult = contactDemographicController.UpdateContactDemographics(contactDemographicModel); var response = updateContactDemographicResult as HttpResult <Response <ContactDemographicsModel> >; var contactDemography = response.Value.DataItems; var count = contactDemography.Count(); //Assert Assert.IsNotNull(contactDemography); Assert.IsTrue(count > 0); }
public void UpdateContactDemographic_Success() { // Arrange ContactDemographic_Success(); RegistrationController contactDemographicController = new RegistrationController(registrationRuleEngine); //Act var updateContactDemographicsModel = new ContactDemographicsModel { ContactID = 8, ContactTypeID = 1, ClientTypeID = 1, FirstName = "FirstName", Middle = "MiddleName", LastName = "LastName", SuffixID = 1, GenderID = 1, TitleID = 1, DOB = DateTime.Now, DOBStatusID = 1, SSN = "123451234", SSNStatusID = 1, DriverLicense = "765432", IsPregnant = false, PreferredName = "PreferredName", DeceasedDate = DateTime.Now, ContactMethodID = 1, ReferralSourceID = 1, }; var updateContactDemographicResult = contactDemographicController.UpdateContactDemographics(updateContactDemographicsModel); var response = updateContactDemographicResult as HttpResult <Response <ContactDemographicsModel> >; var contactDemography = response.Value.DataItems; var count = contactDemography.Count(); //Assert Assert.IsNotNull(contactDemography); Assert.IsTrue(count > 0); }