Example #1
0
        public void Create_should_throw_when_increment_is_out_of_range(int increment)
        {
            var exception = Record.Exception(() => ObjectIdReflector.Create(1, 1, increment));
            var e         = exception.Should().BeOfType <ArgumentOutOfRangeException>().Subject;

            e.ParamName.Should().Be("increment");
        }
Example #2
0
        public void Create_should_throw_when_random_is_out_of_range(long random)
        {
            var exception = Record.Exception(() => ObjectIdReflector.Create(1, random, 1));
            var e         = exception.Should().BeOfType <ArgumentOutOfRangeException>().Subject;

            e.ParamName.Should().Be("random");
        }
Example #3
0
        public void Create_should_generate_expected_a_b_c(uint timestamp, long random, uint increment, uint expectedA, uint expectedB, uint expectedC)
        {
            var objectId = ObjectIdReflector.Create((int)timestamp, random, (int)increment);

            objectId._a().Should().Be((int)expectedA);
            objectId._b().Should().Be((int)expectedB);
            objectId._c().Should().Be((int)expectedC);
        }
Example #4
0
 public void Create_should_not_throw_when_arguments_are_valid(long random, int increment)
 {
     var _ = ObjectIdReflector.Create(1, random, increment);
 }