Beispiel #1
0
        public void FindJobByReferenceNotFound()
        {
            Franchise franchise = new Franchise(_ctx.Listen360, TestUtil.GetElementForXml(Properties.Resources.FakeJob1));

            TestUtil.SetupResponseXml(_ctx.WebRequest, "<jobs type=\"array\"></jobs>");
            IJob job = franchise.FindJobByReference("ABC123");

            Assert.Null(job);
        }
Beispiel #2
0
        public void FindJobByReference()
        {
            Franchise franchise = new Franchise(_ctx.Listen360, TestUtil.GetElementForXml(Properties.Resources.FakeFranchise1));

            TestUtil.SetupResponseXml(_ctx.WebRequest, string.Format("<jobs type=\"array\">{0}</jobs>", Properties.Resources.FakeJob1));
            IJob job = franchise.FindJobByReference("ABC123");

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