Beispiel #1
0
        public async Task Previous_of_non_persisted()
        {
            IDb db = new MemDb();
            ConsumerSessionRocksRepository repository = new ConsumerSessionRocksRepository(db, new ConsumerSessionDecoder());
            ConsumerSession retrieved = await repository.GetPreviousAsync(_cases[1]);

            retrieved.Should().BeNull();
        }
Beispiel #2
0
        public async Task Update_get(ConsumerSession session)
        {
            IDb db = new MemDb();
            ConsumerSessionRocksRepository repository = new ConsumerSessionRocksRepository(db, new ConsumerSessionDecoder());
            await repository.UpdateAsync(session);

            ConsumerSession retrieved = await repository.GetAsync(session.Id);

            retrieved.Should().BeEquivalentTo(session);
        }
Beispiel #3
0
        public async Task Previous_of_second()
        {
            IDb db = new MemDb();
            ConsumerSessionRocksRepository repository = new ConsumerSessionRocksRepository(db, new ConsumerSessionDecoder());
            await repository.AddAsync(_cases[1]);

            await repository.AddAsync(_cases[0]);

            ConsumerSession retrieved = await repository.GetPreviousAsync(_cases[1]);

            retrieved.Should().BeEquivalentTo(_cases[0]);
        }