Exemplo n.º 1
0
			public void SetUp()
			{
				_route = new Route.Routing.Route("name", Guid.NewGuid(), "route");
				_route.AddRestrictions(
					new HeaderRestriction<DateHeader>("Date", headerValue => DateHeader.Parse(headerValue), header => true),
					new HeaderRestriction<AllowHeader>("Allow", headerValue => AllowHeader.ParseMany(headerValue), header => true),
					new HeaderRestriction<AllowHeader>("Allow", headerValue => AllowHeader.ParseMany(headerValue), header => true),
					new MethodRestriction("GET"));
			}
Exemplo n.º 2
0
			public void SetUp()
			{
				_route = new Route.Routing.Route("name", Guid.NewGuid(), "route");
				_route.AddRestrictions((IEnumerable<IRestriction>)new IRestriction[] { new MethodRestriction("GET"), new UrlPortRestriction(0) });
				_route.AddRestrictions(new MethodRestriction("POST"), new UrlPortRestriction(1));
			}
Exemplo n.º 3
0
			public void SetUp()
			{
				_route = new Route.Routing.Route("name", Guid.NewGuid(), "route");
				_route.AddRestrictions(new UrlHostRestriction("host", CaseInsensitivePlainComparer.Instance), new UrlPortRestriction(80));
				_request = MockRepository.GenerateMock<HttpRequestBase>();
				_request.Stub(arg => arg.Url).Return(new Uri("http://host:81"));
				_matchResult = _route.MatchesRequestAsync(_request).Result;
			}
Exemplo n.º 4
0
			public void SetUp()
			{
				_route = new Route.Routing.Route("name", Guid.NewGuid(), "route");
				_route.AddRestrictions(new UrlHostRestriction("host", CaseInsensitivePlainComparer.Instance), new UrlPortRestriction(80));
				_route.AddRestrictions(new UrlHostRestriction("host", CaseInsensitivePlainComparer.Instance), new UrlPortRestriction(80));
			}
Exemplo n.º 5
0
			public void SetUp()
			{
				_route = new Route.Routing.Route("name", Guid.NewGuid(), "route");
				_route.AddRestrictions(new MethodRestriction("GET"), new UrlPortRestriction(0), new MethodRestriction("POST"), new UrlPortRestriction(1));
			}