Esempio n. 1
0
        public void Endpoint_with_no_methods_configured_does_not_allow_any_methods()
        {
            var endpoint = new EndpointDetails(UrlPattern, new List<HttpMethod>(), credentials => true, _resourceRepository, Path);

            Assert.That(endpoint.Allows(HttpMethod.Delete), Is.False);
            Assert.That(endpoint.Allows(HttpMethod.Get), Is.False);
            Assert.That(endpoint.Allows(HttpMethod.Head), Is.False);
            Assert.That(endpoint.Allows(HttpMethod.Post), Is.False);
            Assert.That(endpoint.Allows(HttpMethod.Put), Is.False);
        }
Esempio n. 2
0
        public void Endpoint_with_no_methods_configured_has_empty_allow_header()
        {
            var endpoint = new EndpointDetails(UrlPattern, new List<HttpMethod>(), credentials => true, _resourceRepository, Path);

            Assert.That(endpoint.AllowHeader, Is.EqualTo(""));
        }
Esempio n. 3
0
 public void SetUp()
 {
     _nullEndpointDetails = EndpointDetails.Null();
     _resourceRepository = MockRepository.GenerateStub<IResourceRepository>();
     _resourceRepository.Stub(r => r.Exists(Arg<Dictionary<string, string>>.Matches(d => d["id"] == "123"))).Return(true);
     _endpointDetails = new EndpointDetails(UrlPattern, new List<HttpMethod> { HttpMethod.Get, HttpMethod.Delete }, credentials => true, _resourceRepository, Path);
 }