public async Task FactoryTest(LogLevel logLevel) { ServiceProvider provider = TestHelper.Register <DummyLogFactoryPlayer>(loggingBuilder => { //Exceptional.Settings.DefaultStore = _memoryStore; loggingBuilder.AddLuccaLogs(o => { }, "myLogger", _memoryStore); }); var player = provider.GetRequiredService <DummyLogFactoryPlayer>(); //Assert.Equal(_memoryStore, Exceptional.Settings.DefaultStore); player.Log(logLevel, 42, new Exception(), "the answer"); List <Error> found = await _memoryStore.GetAllAsync(); if (logLevel > LogLevel.Debug) { Assert.Single(found); Assert.Equal("Exception of type 'System.Exception' was thrown.", found.FirstOrDefault()?.Message); } else { Assert.Empty(found); } }