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

            TestUtil.SetupResponseXml(_ctx.WebRequest, string.Format("<technicians type=\"array\">{0}</technicians>", Properties.Resources.FakeTechnician1));
            ITechnician[] techs = franchise.GetTechnicians(2);

            Assert.IsTrue(_ctx.WebRequestFactory.CreateWebRequestCalled);
            Assert.AreEqual(string.Format("{0}/{1}/technicians?page=2", _ctx.Url, franchise.Path), _ctx.WebRequestFactory.CreateWebRequestLastUrl);
            Assert.AreEqual(1, techs.Length);
            Assert.AreEqual(15, techs[0].Id);
        }