예제 #1
0
        public void CheckingForGettingContactDetailsInParticularTimeRange()
        {
            //creating list for expected output
            List <AddressBookContactDetails> contactDetailsExpected = new List <AddressBookContactDetails>();

            //adding data
            contactDetailsExpected.Add(new AddressBookContactDetails {
                firstName = "abc", lastName = "xyz", address = "pqr", city = "Bangalore", state = "Karnataka", zip = 123456, phoneNo = 9419494949, eMail = "abc.xyz"
            });
            //instatiating object for address book operations
            AddressBookOperations addressBookOperations = new AddressBookOperations();
            //getting actual contact list from address book operations-getting contact details from particular date range
            List <AddressBookContactDetails> contactDetailsActual = addressBookOperations.GetAllContactDetailsWithConditions(1);

            //assert for comparing list
            CollectionAssert.AreEqual(contactDetailsActual, contactDetailsExpected);
        }
예제 #2
0
        public void CheckingForGettingContactDetailsForParticularCity()
        {
            //creating list for expected output
            List <AddressBookContactDetails> contactDetailsExpected = new List <AddressBookContactDetails>();

            //adding data
            contactDetailsExpected.Add(new AddressBookContactDetails {
                firstName = "Vishal", lastName = "Garg", address = "Barwala", city = "Hisar", state = "Haryana", zip = 125121, phoneNo = 8570934858, eMail = "vishal.garg"
            });
            contactDetailsExpected.Add(new AddressBookContactDetails {
                firstName = "Mahak", lastName = "Singla", address = "address", city = "Hisar", state = "Haryana", zip = 125001, phoneNo = 9494949494, eMail = "mahak.singla"
            });

            //instatiating object for address book operations
            AddressBookOperations addressBookOperations = new AddressBookOperations();
            //getting actual contact list from address book operations-getting contact details from particular date range
            List <AddressBookContactDetails> contactDetailsActual = addressBookOperations.GetAllContactDetailsWithConditions(3);

            //assert for comparing list
            CollectionAssert.AreEqual(contactDetailsActual, contactDetailsExpected);
        }