public void TestInitialize() { _ContactInformationFacade = Container.Resolve <ContactInformationFacade>(); var randomNum = new Random(100).Next(200); _ContactInformation = new ContactInformation() { FirstName = "TestFirstName" + randomNum, LastName = "TestLastName" + randomNum, Address = "TestAddress", EmailAddress = "*****@*****.**", PhoneNumber = "1234567890", IsActive = true }; }
public void UpdateContactInformationTest() { //Seed the data to update _ContactInformationFacade.AddContactInformation(_ContactInformation); var results = _ContactInformationFacade.GetContactInformation(); results.First().FirstName += new Random(10).Next(200); _ContactInformation = results.First(); var isUpdated = _ContactInformationFacade.UpdateContactInformation(_ContactInformation); Assert.IsTrue(isUpdated, "New contact is not added. AddContactInformation Method is not working."); results.Where(result => result.FirstName == _ContactInformation.FirstName && result.LastName == _ContactInformation.LastName && result.Address == _ContactInformation.Address && result.EmailAddress == _ContactInformation.EmailAddress && result.IsActive == _ContactInformation.IsActive && result.PhoneNumber == _ContactInformation.PhoneNumber); Assert.IsTrue(results.Count > 0, "New contact is not added. AddContactInformation Method is not working."); }