public void ShouldTrack() { var dup = new DuplicateManager(Options.Create <DuplicateManagerOptions>(new DuplicateManagerOptions())); var key = DuplicateManager.Random(); var res = dup.Track(key); Assert.Equal(key, res); }
public void ShouldCheckTrueWithDuplicate() { var dup = new DuplicateManager(Options.Create <DuplicateManagerOptions>(new DuplicateManagerOptions())); var key = DuplicateManager.Random(); var res = dup.Check(key); var res2 = dup.Track(key); var res3 = dup.Check(key); Assert.False(res); Assert.True(res3); }
public async void ShouldCheckFalseAfterTimeout() { var dup = new DuplicateManager(Options.Create <DuplicateManagerOptions>(new DuplicateManagerOptions())); var key = DuplicateManager.Random(); var res = dup.Check(key); var res2 = dup.Track(key); await Task.Delay(1000 * 10); var res3 = dup.Check(key); Assert.False(res); Assert.False(res3); }