protected async Task CreateToggle(Action <Toggle> setup = null)
        {
            using (var session = _storage.CreateSession())
            {
                var toggle = Toggle.CreateNew(
                    Editor,
                    "Test Toggle One",
                    "Some toggle description goes here");

                setup?.Invoke(toggle);

                await session.Save(toggle);

                ToggleID = toggle.ID;
            }
        }
Beispiel #2
0
        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");
        }
Beispiel #3
0
 public async Task SaveToggle(Toggle toggle)
 {
     using (var session = _storage.CreateSession())
         await session.Save(toggle);
 }