public void GetImplementation_ReturnsImplementation_WhenItExists() { var dummyRoute = new Route("whatever", "whatever"); _routeFinderMock .Setup(x => x.FindRoute(It.IsAny <string>())) .Returns(dummyRoute); var dummyImplementation = new HttpMethodImplementation(HttpMethod.Get, "whatever", "whatever", "whatever"); _httpMethodImplementationFinderMock .Setup(x => x.FindImplementation(It.IsAny <Request>(), It.IsAny <Route>())) .Returns(dummyImplementation); var implementation = _manager.GetImplementation(_dummyRequest); Assert.IsNotNull(implementation); }
public static IHttpMethodImplementation Create(HttpMethod httpMethod, string type, string method) { Enforce.StringNotNullOrEmpty(type, nameof(type)); Enforce.StringNotNullOrEmpty(method, nameof(method)); var splittedType = type.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries); if (splittedType.Length != 2) { throw new DoloresConfigurationException("The configured Type must be a string value containing the fully qualified class name and the assembly name separated by a comma."); } string fullyQualifiedClassName = splittedType[0]; string assemblyName = splittedType[1]; IHttpMethodImplementation httpMethodImplementation = new HttpMethodImplementation(httpMethod, assemblyName, fullyQualifiedClassName, method); return(httpMethodImplementation); }