public void TestDBConnectivity() { foreach (AddressData address in AddressData.GetAll()) { System.Console.Out.WriteLine(address.Deprecated); } }
public void AddressCreationTest(AddressData addressData) { List <AddressData> oldAddresses = AddressData.GetAll(); applicationManager.Addresses.Create(addressData); oldAddresses.Add(addressData); Assert.AreEqual(oldAddresses.Count + 1, applicationManager.Addresses.GetAddressesCount()); applicationManager.Navigation.GoToHomePage(); }
public void CompareAddressUI_DB() { if (PERFORM_LONG_UI_CHECKS) { List <AddressData> fromUI = app.Address.GetAddressList(); List <AddressData> fromDB = AddressData.GetAll(); fromUI.Sort(); fromDB.Sort(); Assert.AreEqual(fromUI, fromDB); } }
public void EmptyAddressCreationTest() { AddressData addressData = new AddressData("") { }; List <AddressData> oldAddresses = AddressData.GetAll(); applicationManager.Addresses.Create(addressData); Assert.AreEqual(oldAddresses.Count + 1, applicationManager.Addresses.GetAddressesCount()); applicationManager.Navigation.GoToHomePage(); }
public void CompareAddressesUI_DB() { if (PERFORM_LONG_UI_CHECKS) { List <AddressData> fromUI = applicationManager.Addresses.GetAddressList(); List <AddressData> fromDB = AddressData.GetAll(); fromUI = fromUI.OrderBy(x => x.ID).ToList(); fromDB = fromDB.OrderBy(x => x.ID).ToList(); Assert.AreEqual(fromUI, fromDB); } }
public void AddressCreationTest(AddressData address) { List <AddressData> oldAddress = AddressData.GetAll(); app.Address.Create(address); List <AddressData> newAddress = AddressData.GetAll(); oldAddress.Add(address); oldAddress.Sort(); newAddress.Sort(); Assert.AreEqual(oldAddress, newAddress); }
public void AddressRemovalTest() { applicationManager.Navigation.GoToHomePage(); applicationManager.Addresses.CheckHasAddress(); List <AddressData> oldAddresses = AddressData.GetAll(); AddressData toBeRemoved = oldAddresses[0]; applicationManager.Addresses.Remove(toBeRemoved); Assert.AreEqual(oldAddresses.Count - 1, applicationManager.Addresses.GetAddressesCount()); applicationManager.Navigation.GoToHomePage(); }
public void TestDBConnectivity() { DateTime start = DateTime.Now; List <AddressData> fromUi = app.Address.GetAddressList(); DateTime end = DateTime.Now; System.Console.Out.WriteLine(end.Subtract(start)); start = DateTime.Now; List <AddressData> fromDb = AddressData.GetAll(); end = DateTime.Now; System.Console.Out.WriteLine(end.Subtract(start)); }
public void AddressCreationTest2() { AddressData addressData = new AddressData("1name") { Lastname = "1lname", Middlename = "1mname", Nickname = "1nname", Notes = "hello" }; List <AddressData> oldAddresses = AddressData.GetAll(); applicationManager.Addresses.Create(addressData); Assert.AreEqual(oldAddresses.Count + 1, applicationManager.Addresses.GetAddressesCount()); applicationManager.Navigation.GoToHomePage(); }
public void TestAddingAddressToGroup() { GroupData group = GroupData.GetAll()[0]; List <AddressData> oldList = group.GetAddresses(); AddressData address = AddressData.GetAll().Except(oldList).First(); applicationManager.Addresses.AddAddressToGroup(address, group); List <AddressData> newList = group.GetAddresses(); oldList.Add(address); oldList = oldList.OrderBy(x => x.ID).ToList(); newList = newList.OrderBy(x => x.ID).ToList(); Assert.AreEqual(oldList, newList); }
public void TestRemovingAddressFromGroup() { GroupData group = GroupData.GetAll()[0]; List<AddressData> oldList = group.GetAddresses(); if (oldList.Count == 0) { Assert.Fail("No suffisient addresses found"}; AddressData address = AddressData.GetAll().Intersect(oldList).First(); applicationManager.Addresses.RemoveAddressFromGroup(address, group); List<AddressData> newList = group.GetAddresses(); oldList.RemoveAt(0); oldList = oldList.OrderBy(x => x.ID).ToList(); newList = newList.OrderBy(x => x.ID).ToList(); Assert.AreEqual(oldList, newList); } }
public void AddressRemovalTest() { AddressData address = new AddressData("Natalia", "Ivanova") { Middlename = "Alexander", Nickname = "nataliaivanova49", Title = "Test", Company = "ABC", Mobile = "+79041234567", Work = "88127654321", Fax = "88121726354", Email2 = "*****@*****.**", Email3 = "*****@*****.**", Homepage = "qqq.com", Bday = "17", Bmonth = "June", Byear = "1985", Aday = "17", Amonth = "June", Ayear = "2025", Groupselection = "none", Address2 = "1234567 Address2", Phone2 = "+79999999999", Notes = "Notes" }; app.Address.RemoveModifyAddressPreparation(address); List <AddressData> oldAddress = AddressData.GetAll(); AddressData toBeRemoved = oldAddress[0]; app.Address.Remove(toBeRemoved); List <AddressData> newAddress = AddressData.GetAll(); oldAddress.RemoveAt(0); Assert.AreEqual(oldAddress, newAddress); }
public void TestAddingAddressToGroup() { List <GroupData> allGroups = GroupData.GetAll(); if (allGroups.Count == 0) { GroupData groupToCreate = new GroupData("zzz"); groupToCreate.Header = "rrr"; groupToCreate.Footer = "ccc"; app.Groups.Create(groupToCreate); } GroupData group = GroupData.GetAll()[0]; List <AddressData> oldList = group.GetAddress(); List <AddressData> allAddress = AddressData.GetAll(); List <AddressData> addressNotInGroup = allAddress.FindAll(t => oldList.All(x => x.Id != t.Id)); if (addressNotInGroup.Count == 0) { AddressData addressToCreate = new AddressData("qqq", "rrr"); addressToCreate.Middlename = "qqq"; addressToCreate.Nickname = "qqq"; addressToCreate.Title = "qqq"; addressToCreate.Address = "qqq"; addressToCreate.Company = "qqq"; addressToCreate.Home = "qqq"; addressToCreate.Mobile = "qqq"; addressToCreate.Work = "qqq"; addressToCreate.Fax = "qqq"; addressToCreate.Email = "qqq" + "@gmail.com"; addressToCreate.Email2 = "qqq" + "@mail.ru"; addressToCreate.Email3 = "qqq" + "@yandex.ru"; addressToCreate.Homepage = "qqq.com"; addressToCreate.Bday = "17"; addressToCreate.Bmonth = "June"; addressToCreate.Byear = "1985"; addressToCreate.Aday = "17"; addressToCreate.Amonth = "June"; addressToCreate.Ayear = "2025"; addressToCreate.Groupselection = "none"; addressToCreate.Address2 = "qqq"; addressToCreate.Phone2 = "qqq"; addressToCreate.Notes = "qqq"; app.Address.Create(addressToCreate); addressNotInGroup.Add(addressToCreate); } AddressData address = addressNotInGroup.First(); //actions app.Address.AddAddressToGroup(address, group); List <AddressData> newList = group.GetAddress(); oldList.Add(address); newList.Sort(); oldList.Sort(); Assert.AreEqual(oldList, newList); }
public void AddressModificationTest() { AddressData newData = new AddressData("aaa", "bbb"); newData.Middlename = "qqq"; newData.Nickname = "qqq"; newData.Title = "qqq"; newData.Company = "qqq"; newData.Mobile = "+111"; newData.Work = "111"; newData.Fax = "111"; newData.Email2 = "*****@*****.**"; newData.Email3 = "*****@*****.**"; newData.Homepage = "111.com"; newData.Bday = "11"; newData.Bmonth = "June"; newData.Byear = null; newData.Aday = "11"; newData.Amonth = "June"; newData.Ayear = null; newData.Address2 = null; newData.Phone2 = null; newData.Notes = null; AddressData address = new AddressData("Natalia", "Ivanova"); address.Middlename = "Alexander"; address.Nickname = "nataliaivanova49"; address.Title = "Test"; address.Company = "ABC"; address.Mobile = "+79041234567"; address.Work = "88127654321"; address.Fax = "88121726354"; address.Email2 = "*****@*****.**"; address.Email3 = "*****@*****.**"; address.Homepage = "qqq.com"; address.Bday = "17"; address.Bmonth = "June"; address.Byear = "1985"; address.Aday = "17"; address.Amonth = "June"; address.Ayear = "2025"; address.Groupselection = "none"; address.Address2 = "1234567 Address2"; address.Phone2 = "++79999999999"; address.Notes = "Notes"; app.Address.RemoveModifyAddressPreparation(address); List <AddressData> oldAddress = AddressData.GetAll(); AddressData toBeRemoved = oldAddress[0]; app.Address.Modify(toBeRemoved, newData); List <AddressData> newAddress = AddressData.GetAll(); oldAddress[0].Firstname = newData.Firstname; oldAddress[0].Lastname = newData.Lastname; oldAddress.Sort(); newAddress.Sort(); Assert.AreEqual(oldAddress, newAddress); }