public IObservable <IMessageStream> GetMessageStream(IEndpointDetails endpointDetails) { return(Extensions.ObservableExtensions.ReturnAsync(() => { return _endpointProvider.GetEndpoint(endpointDetails).MessageStream; })); }
public void SetUp() { _successor = MockRepository.GenerateStub<IHandler>(); _handler = new OptionsHandler(_successor); _endpointDetails = MockRepository.GenerateStub<IEndpointDetails>(); _credentials = MockRepository.GenerateStub<ICredentials>(); }
public IResult Handle(IEndpointDetails endpoint, ICredentials credentials, HttpMethod httpMethod) { // _endpointDetails: Authorize against endpoint? return httpMethod == HttpMethod.Options ? new OptionsResult(endpoint) : _successor.Handle(endpoint, credentials, httpMethod); }
public void SetUp() { _resourceFoundSuccessor = MockRepository.GenerateStub<IHandler>(); _resourceNotFoundSuccessor = MockRepository.GenerateStub<IHandler>(); _handler = new ResourceExistsHandler(_resourceFoundSuccessor, _resourceNotFoundSuccessor); _endpointDetails = MockRepository.GenerateStub<IEndpointDetails>(); _credentials = MockRepository.GenerateStub<ICredentials>(); }
public void TestFixtureSetUp() { _endpointDetails = MockRepository.GenerateStub<IEndpointDetails>(); _endpointDetails.Stub(ed => ed.AllowHeader).Return(AllowAllTheThings); _result = new CreatedResult(_endpointDetails); _responseDetails = MockRepository.GenerateStub<IResponseDetails>(); _result.Update(_responseDetails); }
public bool Equals(IEndpointDetails other) { if (string.CompareOrdinal(Address, other.Address) == 0 && Type == ((RabbitMqEndpointDetails)other).Type) { return(true); } return(false); }
public void Returns_not_found_result() { _notFoundHandler = new NotFoundHandler(null); _endpointDetails = MockRepository.GenerateStub<IEndpointDetails>(); _credentials = MockRepository.GenerateStub<ICredentials>(); var result = _notFoundHandler.Handle(_endpointDetails, _credentials, null); Assert.That(result, Is.TypeOf<NotFoundResult>()); }
public IObservable <Unit> Send( IMessage message, IEndpointDetails endpointDetails, string targetSessionId = null) { return(Extensions.ObservableExtensions.ReturnAsync(() => { var endpoint = _endpointProvider.GetEndpoint(endpointDetails); endpoint.Send(message, targetSessionId); return new Unit(); })); }
public IResult Handle(IEndpointDetails endpoint, ICredentials credentials, HttpMethod httpMethod) { return endpoint.Exists ? _successor.Handle(endpoint, credentials, httpMethod) : NotFoundResult.ForUnknownAddress(); }
private IResult CheckCredentials(IEndpointDetails endpoint, ICredentials credentials, HttpMethod httpMethod) { return credentials.IsAuthenticated ? _successor.Handle(endpoint, credentials, httpMethod) : new UnauthorizedResult(credentials.FailureMessage); }
public IResult Handle(IEndpointDetails endpoint, ICredentials credentials, HttpMethod httpMethod) { return endpoint.ResourceExists ? _resourceFoundSuccessor.Handle(endpoint, credentials, httpMethod) : _resourceNotFoundSuccessor.Handle(endpoint, credentials, httpMethod); }
public IResult Handle(IEndpointDetails endpoint, ICredentials credentials, HttpMethod httpMethod) { return httpMethod == HttpMethod.Put ? _putHandler.Handle(endpoint, credentials, httpMethod) : NotFoundResult.ForNonexistentResource(); }
public MethodNotAllowedResult(IEndpointDetails endpointDetails) { _endpointDetails = endpointDetails; }
public CreatedResult(IEndpointDetails endpointDetails) { _endpointDetails = endpointDetails; }
public IResult Handle(IEndpointDetails endpoint, ICredentials credentials, HttpMethod httpMethod) { endpoint.Save(); return new CreatedResult(endpoint); }
public IResult Handle(IEndpointDetails endpoint, ICredentials credentials, HttpMethod httpMethod) { return new OkResult(endpoint); }
public IResult Handle(IEndpointDetails endpoint, ICredentials credentials, HttpMethod httpMethod) { return endpoint.Allows(httpMethod) ? _successor.Handle(endpoint, credentials, httpMethod) : new MethodNotAllowedResult(endpoint); }
public bool TryGetEndpointDetails( string endpointKey, out IEndpointDetails endpointDetails) { return(_endpoints.TryGetValue(endpointKey, out endpointDetails)); }
public OptionsResult(IEndpointDetails endpointDetails) { _endpointDetails = endpointDetails; }
public IResult Handle(IEndpointDetails endpoint, ICredentials credentials, HttpMethod httpMethod) { return !credentials.IsAnonymous ? CheckCredentials(endpoint, credentials, httpMethod) : _successor.Handle(endpoint, credentials, httpMethod); }
public OkResult(IEndpointDetails endpointDetails) { _endpointDetails = endpointDetails; }
public IResult Handle(IEndpointDetails endpoint, ICredentials credentials, HttpMethod httpMethod) { return endpoint.IsAuthorizedFor(credentials) ? _successor.Handle(endpoint, credentials, httpMethod) : UnauthorizedResult.ForInsufficientPrivileges(); }