Example #1
0
            public void ShouldReturnExpectedValue(long elapsedMs, long expiresAfterMs, long expiredForCheckMs,
                                                  bool expected)
            {
                var timer = new Mock <ITimer>();

                timer.Setup(x => x.ElapsedMilliseconds).Returns(elapsedMs);

                var routingTable = new RoutingTable(null, new[] { new Uri("neo4j://my-router") },
                                                    new[] { new Uri("neo4j://my-reader") }, Enumerable.Empty <Uri>(), expiresAfterMs / 1000, timer.Object);

                routingTable.IsExpiredFor(TimeSpan.FromMilliseconds(expiredForCheckMs)).Should().Be(expected);
            }