Esempio n. 1
0
        public void FindCustomerByReferenceNotFound()
        {
            Franchise franchise = new Franchise(_ctx.Listen360, TestUtil.GetElementForXml(Properties.Resources.FakeFranchise1));

            TestUtil.SetupResponseXml(_ctx.WebRequest, "<customers type=\"array\"></customers>");
            ICustomer customer = franchise.FindCustomerByReference("ABC123");

            Assert.Null(customer);
        }
Esempio n. 2
0
        public void FindCustomerByReference()
        {
            Franchise franchise = new Franchise(_ctx.Listen360, TestUtil.GetElementForXml(Properties.Resources.FakeFranchise1));

            TestUtil.SetupResponseXml(_ctx.WebRequest, string.Format("<customers type=\"array\">{0}</customers>", Properties.Resources.FakeCustomer1));
            ICustomer customer = franchise.FindCustomerByReference("ABC123");

            Assert.IsTrue(_ctx.WebRequestFactory.CreateWebRequestCalled);
            Assert.AreEqual(string.Format("{0}/{1}/customers?reference=ABC123", _ctx.Url, franchise.Path), _ctx.WebRequestFactory.CreateWebRequestLastUrl);
            Assert.NotNull(customer);
        }