예제 #1
0
        public void EncodeDecodeWithGuidTest(int c)
        {
            var gen = new UlidGen();

            for (var i = 0; i < c; i++)
            {
                var id = gen.Generate();
                Ulid
                .Decode(id.Encode())
                .ToGuid()
                .ShouldBe(id.ToGuid());
            }
        }
예제 #2
0
 public void DecodeThrowsOnUnexpectedCharacterTest()
 {
     Should.Throw <ArgumentOutOfRangeException>(
         () => Ulid.Decode(null)
         );
     Should.Throw <ArgumentOutOfRangeException>(
         () => Ulid.Decode("")
         );
     Should.Throw <ArgumentOutOfRangeException>(
         () => Ulid.Decode("absdgg34tgga")
         );
     Should.Throw <ArgumentOutOfRangeException>(
         () => Ulid.Decode("привет, мир!")
         );
 }