Exemplo n.º 1
0
 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();
 }
Exemplo n.º 2
0
        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")));
        }
Exemplo n.º 3
0
 public void TestCleanUp()
 {
     using var context = new ModuleDomainServiceContext(_options);
     context.Database.EnsureDeleted();
     _connection.Close();
 }