public void it_should_acknowledge_two_operations_as_inequal() { var leftOperand = new OperationInfo<string>(Method, Url, "/", new Regex(".*"), "test"); var rightOperand = new OperationInfo<string>(Method, UrlParser.Parse("/test"), "/", new Regex(".*"), "test"); (leftOperand != rightOperand).Should().BeTrue(); }
public void it_should_acknowledge_two_objects_to_be_different() { var leftOperand = new OperationInfo<string>(Method, Url, "/", new Regex(".*"), "test"); leftOperand.Equals(null).Should().BeFalse(); leftOperand.Equals(String.Empty).Should().BeFalse(); }
public RequestMapping(IController target, OperationInfo<Verb> operation, HttpUrl methodRoute) { if (target == null) { throw new ArgumentNullException("target"); } if (operation == null) { throw new ArgumentNullException("operation"); } Target = target; Operation = operation; MethodRoute = methodRoute; ArgumentSources = new Dictionary<int, ArgumentValueSources>(operation.UnderlyingMethod.GetParameters().Length + (operation.UnderlyingMethod.ReturnType != typeof(void) ? 1 : 0)); }
public OptionsRequestMapping(OperationInfo<Verb> operation, HttpUrl methodRoute, HttpStatusCode responseStatusCode, params string[] allowed) { if (operation == null) { throw new ArgumentNullException("operation"); } if (allowed == null) { throw new ArgumentNullException("allowed"); } if (allowed.Length == 0) { throw new ArgumentOutOfRangeException("allowed"); } Target = new OptionsController(responseStatusCode, allowed); Operation = operation; MethodRoute = methodRoute; ArgumentSources = new Dictionary<int, ArgumentValueSources>(operation.UnderlyingMethod.GetParameters().Length + (operation.UnderlyingMethod.ReturnType != typeof(void) ? 1 : 0)); }