Ejemplo n.º 1
0
        public void GuidTest(int c)
        {
            var gen = new UlidGen();
            var l   = new List <Ulid>();
            var ls  = new List <Guid>();

            for (var i = 0; i < c; i++)
            {
                l.Add(gen.Generate());
                ls.Add(l[i].ToGuid());
            }

            for (var i = 0; i < l.Count; i++)
            {
                var ulid = Ulid.FromGuid(ls[i]);
                ulid.ShouldBe(l[i], $"{ulid} != {l[i]} at {i} element!");
            }
        }
Ejemplo n.º 2
0
 public static Ulid ToUlid(this Guid guid) => Ulid.FromGuid(guid);