public void ReturnsTrueWithBase64GuidResultFromUrlUnsafeInputWithPadding(Guid expected, String input) { input = input.Replace("-", "+").Replace("_", "/") + "=="; var result = Base64Guid.TryParse(input, options => { options.UseStandardBase64Encoding(); options.UsePadding(); }, out var output); Assert.Equal(expected, output.Guid); }
public void ReturnsUrlUnsafeBase64StringWithPadding(Guid input, String expected) { expected = expected.Replace("-", "+").Replace("_", "/") + "=="; var base64Guid = new Base64Guid(input, options => { options.UseStandardBase64Encoding(); options.UsePadding(); }); var result = base64Guid.ToString(); Assert.Equal(expected, result); }
public void ReturnsBase64Guid(Guid expected, string input) { var result = Base64Guid.Parse(input); Assert.Equal(expected, result.Guid); }
public void ThrowsWhenStringContentIsInvalidForUrlUnsafeInput(string input) { input = input.Replace("+", "-").Replace("/", "_"); Assert.Throws <FormatException>(() => Base64Guid.Parse(input, options => options.UseStandardBase64Encoding())); }
public void ThrowsWhenStringContentIsInvalid(string input) { Assert.Throws <FormatException>(() => Base64Guid.Parse(input)); }
public void ThrowsWhenStringLengthIsInvalidForInputWithPadding(string input) { input += "=="; Assert.Throws <FormatException>(() => Base64Guid.Parse(input, options => options.UsePadding())); }
public ActionResult <string> GetWithRouteParameter(Base64Guid id) { return(id.Guid.ToString()); }
public void ConstructsWithEmptyGuid() { var result = new Base64Guid(); Assert.Equal(Guid.Empty, result.Guid); }
public void ThrowsWhenArgumentIsNull() => Assert.Throws <ArgumentNullException>(() => Base64Guid.Parse(null));
public ActionResult <String> GetWithQueryParameter(Base64Guid id) => id.Guid.ToString();
public void ThrowsWhenStringLengthIsInvalid(String input) => Assert.Throws <FormatException>(() => Base64Guid.Parse(input));