public void When_clientId_is_unknown()
        {
            var fakeWebHelper = new FakeWebServiceCaller("<error>notfound</error>", (int)HttpStatusCode.NotFound);
            var service = new AuthorisationService(fakeWebHelper);
            var processor = new AuthorisationProcessor(service);

            string unknownClientId = "notfound";
            var result = processor.Authorise(unknownClientId);

            Assert.That(result.StatusCode, Is.EqualTo((int) HttpStatusCode.NotFound));
        }
        public void When_Internal_server_error_happens()
        {
            var fakeWebHelper = new FakeWebServiceCaller("<error>InternalServerError</error>",
                                                         (int) HttpStatusCode.InternalServerError);
            var service = new AuthorisationService(fakeWebHelper);
            var processor = new AuthorisationProcessor(service);

            string internalError = "InternalServerError";
            var result = processor.Authorise(internalError);

            Assert.That(result.StatusCode, Is.EqualTo((int)HttpStatusCode.InternalServerError));
        }
        public void Setup()
        {
            _authId = "xxxxx";

            _startDate = "2011-03-17";
            _startTime = "12:30";
            _expireafter = "3600000";
            _expected = "http://domain.com/video/history/" + _authId;
            _xml = XmlHelper.Create(_authId, _startDate, _startTime, _expireafter, _expected);
            _fakeWebServiceCaller = new FakeWebServiceCaller(_xml, (int)HttpStatusCode.OK);
            _service = new AuthorisationService(_fakeWebServiceCaller);
        }
        public void SetUp()
        {
            _clientId = "zzzzz";
            _authId = "xxxxx";
            _startDate = "2011-03-17";
            _startTime = "12:30";
            _expireafter = "3600000";
            _history = "http://domain.com/video/history/" + _authId;
            _responseXml = XmlHelper.Create(_authId, _startDate, _startTime, _expireafter, _history);

            _webServiceCaller = new FakeWebServiceCaller(_responseXml, (int)HttpStatusCode.OK);
            _service = new AuthorisationService(_webServiceCaller);
            _processor = new AuthorisationProcessor(_service);
        }
 public void Setup()
 {
     _xml = "<error>notfound</error>";
     _fakeWebServiceCaller = new FakeWebServiceCaller(_xml, (int)HttpStatusCode.NotFound);
     _service = new AuthorisationService(_fakeWebServiceCaller);
 }