public void ConvertShortGuidTest() { var g = Guid.NewGuid(); var shortGuid = g.ToShortGuid(); Assert.Equal(g, ShortGuid.Parse(shortGuid)); var shortGuidUrlFriendly = g.ToShortGuid(true); Assert.Equal(g, ShortGuid.Parse(shortGuidUrlFriendly, true)); }
public Deck ToDeck() { return(new Deck { Id = ParseOrCreateGuid(id), GameId = ShortGuid.Parse(gameid), Name = name, Items = items.Select(i => new DeckItem { CardId = ShortGuid.Parse(i.id), Amount = i.amount }).ToArray() }); }
private Guid ParseOrCreateGuid(string id) { return(String.IsNullOrEmpty(id) ? Guid.NewGuid() : ShortGuid.Parse(id)); }
private static Guid GetGuid(string input) { Guid output; return(Guid.TryParse(input, out output) ? output : ShortGuid.Parse(input)); }
public static byte[] CreateCorrealtionIdBytes(string value) { var g = ShortGuid.Parse(value); return(Encoding.ASCII.GetBytes(g)); }
public void ShortGuid_ShouldParseShortToNormal(string shortGuid, string guid) { var sut = ShortGuid.Parse(shortGuid); Assert.Equal(Guid.Parse(guid), sut.ToGuid()); }