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()); } }
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("привет, мир!") ); }