Ejemplo n.º 1
0
 public EndpointsAdapterDriver()
 {
     _adapter = new EndpointsAdapter(
         Substitute.For <ICommandFactory <CreateTodoRequestData, IAddTodoResponseInProgress> >(),
         Substitute.For <ICommandFactory <LinkTodosRequestData, ILinkTodoResponseInProgress> >(),
         new TokenValidationParameters
     {
         ValidIssuer      = TestTokens.Issuer,
         IssuerSigningKey = TestTokens.SecurityKey
     },
         Substitute.For <IEndpointsSupport>());
 }
    public ServiceLogicRoot(
        TokenValidationParameters tokenValidationParameters,
        ILoggerFactory loggerFactory)
    {
        var storageAdapter = new StorageAdapter();
        var appLogicRoot   = new AppLogicRoot(
            storageAdapter.UserTodosDao,
            new NewGuidBasedIdSequence());
        var endpointsAdapter = new EndpointsAdapter(
            appLogicRoot.TodoCommandFactory,
            appLogicRoot.TodoCommandFactory,
            tokenValidationParameters,
            LoggingAdapter.CreateServiceSupport(loggerFactory));

        _endpointsAdapter = endpointsAdapter;
        _storageAdapter   = new StorageAdapter();
    }