Пример #1
0
 public async Task GenSecondId()
 {
     var target = new MemoryStore();
     var firstId = await target.ReserveIds(1L);
     var secondId = await target.ReserveIds(1L);
     Assert.AreEqual(2L, secondId[0]);
 }
Пример #2
0
 public async Task GenMultiFirstId()
 {
     var target = new MemoryStore();
     var firstId = await target.ReserveIds(2L);
     Assert.AreEqual(1L, firstId[0]);
     Assert.AreEqual(2L, firstId[1]);
 }
Пример #3
0
 public async Task GenMultiThirdId()
 {
     var target = new MemoryStore();
     var firstId = await target.ReserveIds(2L);
     var secondId = await target.ReserveIds(2L);
     var thirdId = await target.ReserveIds(2L);
     Assert.AreEqual(5L, thirdId[0]);
     Assert.AreEqual(6L, thirdId[1]);
 }
Пример #4
0
 public StoreLock(MemoryStore store, Action disposeAction)
 {
     this.store = store;
     this.disposeAction = disposeAction;
 }