public void SameString_ParsedAsSameGuid(string str) { var guids = Enumerable.Range(0, 10) .Select(_ => (Guid)MiniGuid.Parse(str)) .ToHashSet(); Assert.Single(guids); }
public void Deserializes_FromString() { var json = @"{ ""guid"": ""abcdeABCDEabcdeABCDEabcdeA"" }"; var dummy = JsonConvert.DeserializeObject <Dummy>(json); Assert.Equal(MiniGuid.Parse("abcdeABCDEabcdeABCDEabcdeA"), dummy.Guid); }
public void ToString_Parse_RoundTrip() { for (int i = 0; i < 1000; i++) { var guid1 = MiniGuid.NewGuid(); var guid2 = MiniGuid.Parse(guid1.ToString()); Assert.Equal(guid1, guid2); } }