コード例 #1
0
        public void Day_should_equal_number_of_days_since_last_rollover()
        {
            var startInstant = Instant.MinValue;

            for (var i = 0; i < SeedGenerator.DaysPerSeed; i++)
            {
                var fakeClock = new FakeClock(startInstant.Plus(Duration.FromDays(i)));
                var seed      = new SeedGenerator(fakeClock);

                seed.GetCurrent().DaysSinceRollover.Should().Be(i);
            }
        }
コード例 #2
0
        public void Value_should_be_same_for_n_days()
        {
            var startInstant = Instant.MinValue;

            var seeds = new List <int>();

            for (var i = 0; i < SeedGenerator.DaysPerSeed; i++)
            {
                var fakeClock = new FakeClock(startInstant.Plus(Duration.FromDays(i)));
                var seed      = new SeedGenerator(fakeClock);
                seeds.Add(seed.GetCurrent().Value);
            }

            var first = seeds.First();

            seeds.All(x => x == first).Should().BeTrue();
        }