public void FromShortId_Should_Convert_String_Correctly() { var guid = Guid.NewGuid().ToString(); var expectedGuid = guid.FromShortId(); Assert.Equal(expectedGuid, ShortGuid.FromShortId(guid)); }
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 CorrectlyConvertStringGuidToGuid() { try { Assert.True(ShortGuid.FromShortId(Guid.NewGuid().ToShortId()) is Guid); } catch (Exception e) { Assert.True(false, e.Message); } }
public void WorkCorrectlyIfFromShortIdTakesDoubleEquasion() { try { ShortGuid.FromShortId(Guid.NewGuid().ToShortId() + "=="); } catch (Exception e) { Assert.True(false, e.Message); } Assert.True(true); }
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); }
public void ReturnNullIfFromFhortIdArgumentIsNull() { Assert.Null(ShortGuid.FromShortId(null)); }
public void ThrowExceptionIfFromFhortIdArgumentIsNotValid() { Assert.Throws <FormatException>(() => ShortGuid.FromShortId("Definitely not Guid")); }
public void IfPassNullThenReturnNull() { var newGuid = ShortGuid.FromShortId(null); Assert.Null(newGuid); }
public void FromShortId_Returns_Null_If_Argument_Null() { Assert.Null(ShortGuid.FromShortId(null)); }
public void FromShortId_Should_Fail_If_Argument_Invalid() { Assert.Throws <FormatException>(() => ShortGuid.FromShortId("1234")); }