public void Should_Convert_Guid_Correctly() { var id = Guid.NewGuid(); var shortId = ShortGuid.ToShortId(id); var longId = ShortGuid.FromShortId(shortId); Assert.Equal(id, longId); }
public void FromShortId_Should_Convert_Correctly() { var shortId = Guid.NewGuid().ToShortId() + "=="; Assert.NotNull(ShortGuid.FromShortId(shortId)); shortId = ShortGuid.ToShortId(Guid.NewGuid()) + "=="; Assert.NotNull(ShortGuid.FromShortId(shortId)); }
public void MakeCorrectConvertation() { var guid = new Guid(); var newGuid = new Guid(); try { newGuid = (Guid)ShortGuid.FromShortId(ShortGuid.ToShortId(guid)); } catch (Exception e) { Assert.True(false, e.Message); } Assert.Equal(guid, newGuid); }