public void ReceiveIdempotencyServiceFindShouldReturnFalseIfValueNotPresent1() { IReceiveIdempotencyService <string> receiveIdempotencyService = new ReceiveIdempotencyService <string>(1 * 60000); Assert.IsFalse(receiveIdempotencyService.Find("Hello")); receiveIdempotencyService.Dispose(); }
public void ReceiveIdempotencyServiceShouldBeAbleToAdd() { IReceiveIdempotencyService <string> receiveIdempotencyService = new ReceiveIdempotencyService <string>(1 * 60000); Assert.IsTrue(receiveIdempotencyService.Add("Hello")); receiveIdempotencyService.Dispose(); }
public void ReceiveIdempotencyServiceFindShouldReturnTrueIfValuePresent() { IReceiveIdempotencyService <string> receiveIdempotencyService = new ReceiveIdempotencyService <string>(1 * 60000); receiveIdempotencyService.Add("Hello"); Assert.IsTrue(receiveIdempotencyService.Find("Hello")); receiveIdempotencyService.Dispose(); }
public void ReceiveIdempotencyServiceShouldRemoveItemsAfterTimeout() { IReceiveIdempotencyService <string> receiveIdempotencyService = new ReceiveIdempotencyService <string>(5 * 1000); receiveIdempotencyService.Add("Hello"); Thread.Sleep(10 * 1000); Assert.IsFalse(receiveIdempotencyService.Remove("Hello")); receiveIdempotencyService.Dispose(); }
public void ReceiveIdempotencyServiceShouldNotRemoveItemsIfExpiryIsPaused() { IReceiveIdempotencyService <string> receiveIdempotencyService = new ReceiveIdempotencyService <string>(5 * 1000); receiveIdempotencyService.Add("Hello"); receiveIdempotencyService.PausePacketExpiry(); Thread.Sleep(10 * 1000); Assert.IsTrue(receiveIdempotencyService.Find("Hello")); receiveIdempotencyService.Dispose(); }