예제 #1
0
        public void GetCompanyIdTest()
        {
            ConfigurationManager.AppSettings["ConnectionInfo"] = "ek49phfby0cs";


            string companyName = "Sub Technologies Inc";
            string expected    = "3987840";
            string actual;

            actual = JigsawHelper.GetCompanyId(companyName);
            Assert.AreEqual(expected, actual);

            companyName = "FOUR G CONSTRUCTION INC";
            expected    = "";
            actual      = JigsawHelper.GetCompanyId(companyName);
            Assert.AreEqual(expected, actual);

            companyName = "COMET INDUSTRIES INC";
            expected    = "1258384";
            actual      = JigsawHelper.GetCompanyId(companyName);
            Assert.AreEqual(expected, actual);

            companyName = "AMPLEFORTH ENTERPRISES INC";
            expected    = "";
            actual      = JigsawHelper.GetCompanyId(companyName);
            Assert.AreEqual(expected, actual);

            companyName = "AMERICAN DEHYDRATED FOODS INC";
            expected    = "204339";
            actual      = JigsawHelper.GetCompanyId(companyName);
            Assert.AreEqual(expected, actual);
        }
예제 #2
0
        // GET api/contacts
        public IEnumerable <ContactModel> Get(string companyName)
        {
            string companyId = JigsawHelper.GetCompanyId(companyName);

            if (!string.IsNullOrEmpty(companyId))
            {
                return(JigsawHelper.GetContacts(companyId));
            }

            return(null);
        }
예제 #3
0
        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.");
        }
예제 #4
0
        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.");
        }