public void Setup()
 {
     UrlParser.Register<RelativeUrlParser>();
     var controllerType = typeof(TestController);
     var operationUrl = "/api/test/operation";
     var methodInfo = controllerType.GetMethod("Operation");
     var entryPoint = new EntryPointInfo(UrlParser.Parse("/api")).WithSecurityDetailsFrom(controllerType.Assembly);
     _operationInfo = new FakeOperationInfo(methodInfo, UrlParser.Parse(operationUrl), null, new Regex(operationUrl)).WithSecurityDetailsFrom(methodInfo);
     new FakeControllerInfo(entryPoint, UrlParser.Parse("/api/test"), _operationInfo).WithSecurityDetailsFrom(controllerType);
 }
Exemple #2
0
        public void Setup()
        {
            UrlParser.Register <RelativeUrlParser>();
            var controllerType = typeof(TestController);
            var operationUrl   = "/api/test/operation";
            var methodInfo     = controllerType.GetMethod("Operation");
            var entryPoint     = new EntryPointInfo(UrlParser.Parse("/api")).WithSecurityDetailsFrom(controllerType.Assembly);

            _operationInfo = new FakeOperationInfo(methodInfo, UrlParser.Parse(operationUrl), null, new Regex(operationUrl)).WithSecurityDetailsFrom(methodInfo);
            new FakeControllerInfo(entryPoint, UrlParser.Parse("/api/test"), _operationInfo).WithSecurityDetailsFrom(controllerType);
        }
Exemple #3
0
        public void it_should_create_an_instance_correctly()
        {
            var result = new FakeOperationInfo(
                Method,
                UrlParser.Parse("/"),
                "/",
                new Regex(".*"),
                new ResultInfo(Result, new ToBodyAttribute(), "/", "test"),
                new ArgumentInfo(Parameter, new FromUrlAttribute(), "/", "test"));

            result.Should().BeOfType <FakeOperationInfo>();
        }
        public void it_should_create_an_instance_correctly()
        {
            var result = new FakeOperationInfo(
                Method,
                UrlParser.Parse("/"),
                "/",
                new Regex(".*"),
                new ResultInfo(Result, new ToBodyAttribute(), "/", "test"),
                new ArgumentInfo(Parameter, new FromUrlAttribute(), "/", "test"));

            result.Should().BeOfType<FakeOperationInfo>();
        }
 public void Teardown()
 {
     _operationInfo = null;
 }
Exemple #6
0
 public void Teardown()
 {
     _operationInfo = null;
 }