public void ReadWriteDeathCount() { var container = new TestContainerManager().InitializeAndIsolateRepository(); var testWrite = TestHelper.RandomInt(); using (var context = container.GetInstance <BotDbContext>()) { var stateIntegerRepository = new StateIntegerRepository(context.StateIntegers); stateIntegerRepository.DeathCount = testWrite; context.SaveChanges(); } long testRead; using (var context = container.GetInstance <BotDbContext>()) { var stateIntegerRepository = new StateIntegerRepository(context.StateIntegers); testRead = stateIntegerRepository.DeathCount; } Assert.AreEqual(testWrite, testRead); }
public void ReadWriteLatestStreamOffTime() { var container = new TestContainerManager().InitializeAndIsolateRepository(); var testWrite = TestHelper.RandomDateTime(); using (var context = container.GetInstance <BotDbContext>()) { var stateIntegerRepository = new StateIntegerRepository(context.StateIntegers); stateIntegerRepository.LatestStreamOffTime = testWrite; context.SaveChanges(); } DateTime testRead; using (var context = container.GetInstance <BotDbContext>()) { var stateIntegerRepository = new StateIntegerRepository(context.StateIntegers); testRead = stateIntegerRepository.LatestStreamOffTime; } Assert.AreEqual(testWrite.Ticks, testRead.Ticks); }