public void TestInitialize() { _connection = new SqliteConnection(DATA_SOURCE); _connection.Open(); _options = new DbContextOptionsBuilder <ModuleDomainServiceContext>() .UseSqlite(_connection).Options; using var context = new ModuleDomainServiceContext(_options); context.Database.EnsureCreated(); }
public void AppendToStream_Should_Append_Event_To_Stream() { // Assert var context = new ModuleDomainServiceContext(_options); var eventStore = new SQLEventStore(context); // Act eventStore.AppendToStream(new EventStream("uniqueId", 0, new List <DomainEvent> { new ModuleGecreeerd { ModuleCode = "IOPR", ModuleNaam = "Object georienteerd programeren", AantalEc = 3, Cohort = "2019/2020" } })); // Assert Assert.IsTrue(context.Stream.Any(@event => @event.Stream.Id.Equals("uniqueId"))); }
public void TestCleanUp() { using var context = new ModuleDomainServiceContext(_options); context.Database.EnsureDeleted(); _connection.Close(); }