// GET api/contacts public IEnumerable <ContactModel> Get(string companyName) { string companyId = JigsawHelper.GetCompanyId(companyName); if (!string.IsNullOrEmpty(companyId)) { return(JigsawHelper.GetContacts(companyId)); } return(null); }
public void GetPurchasedContactTest() { ConfigurationManager.AppSettings["ConnectionInfo"] = "ek49phfby0cs"; ConfigurationManager.AppSettings["JigsawUserName"] = "******"; ConfigurationManager.AppSettings["JigsawPassword"] = "******"; string companyName = "American Dehydrated Foods, Inc."; string expectedCompanyId = "204339"; string actualCompanyId; actualCompanyId = JigsawHelper.GetCompanyId(companyName); Assert.AreEqual(expectedCompanyId, actualCompanyId); string companyId = actualCompanyId; int expected = 16; int actual; var model = JigsawHelper.GetContacts(companyId); actual = model.Count; Assert.AreEqual(expected, actual); long contactId = model[0].ContactId; string email = "*****@*****.**"; string address = "PO BOX 4087"; string phone = "+1.417.881.7755"; var contactInfo = JigsawHelper.GetPurchasedContact(contactId); Assert.AreEqual(email, contactInfo.Email); Assert.AreEqual(address, contactInfo.Address); Assert.AreEqual(phone, contactInfo.Phone); Assert.Inconclusive("Verify the correctness of this test method."); }
public void GetContactsTest() { ConfigurationManager.AppSettings["ConnectionInfo"] = "ek49phfby0cs"; string companyName = "American Dehydrated Foods, Inc."; string expectedCompanyId = "204339"; string actualCompanyId; actualCompanyId = JigsawHelper.GetCompanyId(companyName); Assert.AreEqual(expectedCompanyId, actualCompanyId); string companyId = actualCompanyId; int expected = 16; int actual; var model = JigsawHelper.GetContacts(companyId); actual = model.Count; Assert.AreEqual(expected, actual); Assert.Inconclusive("Verify the correctness of this test method."); }