protected HandlerTest() { Events = new PendingEventsStore(); Storage = new InMemoryStorage(Events); Storage.RegisterAggregate <ToggleID, Toggle>(); Storage.RegisterProjection <ToggleView>(); Toggle = Toggle.CreateNew(EditorID.Parse("editor"), "name", "desc"); Locator = ToggleLocator.Create(Toggle.ID); Editor = EditorID.Parse("Editor:" + Guid.NewGuid()); }
public ApiFixture() { _fixture = new Fixture(); _storage = new InMemoryStorage(); _storage.RegisterProjection <ToggleView>(); _storage.RegisterAggregate <ToggleID, Toggle>(); _system = SystemUnderTest.ForStartup <Startup>(); _system.Configure(builder => builder.UseLamar()); _system.ConfigureServices(services => { services.AddSingleton <IStorage>(_storage); services.AddScoped(sp => _storage.CreateSession()); }); Editor = EditorID.Parse("me"); }
protected HandlerPipelineTest() { Editor = EditorID.Parse("me"); Storage = new InMemoryStorage(); Storage.RegisterAggregate <ToggleID, Toggle>(); Storage.RegisterProjection <ToggleView>(); var container = new Container(_ => { _.IncludeRegistry <MediatrRegistry>(); _.For <IStorage>().Use(Storage); _.For <IStorageSession>().Use(c => c.GetInstance <IStorage>().CreateSession()); _.For <ILoggerFactory>().Use(Substitute.For <ILoggerFactory>()); _.For(typeof(ILogger <>)).Use(typeof(Logger <>)); }); _mediator = container.GetInstance <IMediator>(); }