Exemplo n.º 1
0
        public void TestGenerateContactName()
        {
            var contactName = "Martin";
            var contact     = DataGenerator.Build(contactName);

            Assert.AreEqual(contactName, contact.Name);
        }
Exemplo n.º 2
0
        public void TestGenerateContactEmail()
        {
            var contactName = "Martin";
            var contact     = DataGenerator.Build(contactName);

            Assert.AreEqual($"{contactName.ToLower()}@email.com", contact.Email);
        }
        public void TestFetchContactByPhoneNumber()
        {
            var contact = DataGenerator.Build("Martin");

            contact.Identifier = ContactDataAccess.Create(contact);

            var filterDTO = new FilterContactDTO()
            {
                Results             = 5,
                PersonalPhoneNumber = contact.PersonalPhoneNumber,
            };

            Assert.AreEqual(contact.Identifier, ContactDataAccess.Search(filterDTO).Single().Identifier);
        }
Exemplo n.º 4
0
        public void TestUpdateCompany()
        {
            var currentTestContactRepository = new EntityRepository <Contact>("Contact");

            var contact = DataGenerator.Build("John");

            contact.Identifier = currentTestContactRepository.Create(contact);

            var newCompanyName = "NewCompany";

            contact.Company = newCompanyName;
            currentTestContactRepository.Update(contact);

            Assert.AreEqual(newCompanyName, currentTestContactRepository.Get(contact.Identifier.Value).Company);
        }