public void ReturnsTrueWithBase64GuidResult(Guid expected, string input) { var result = Base64Guid.TryParse(input, out Base64Guid output); Assert.True(result); Assert.Equal(expected, output.Guid); }
public void ReturnsFalseWhenStringContentIsInvalid(string input) { var result = Base64Guid.TryParse(input, out Base64Guid output); Assert.False(result); Assert.Equal(default(Base64Guid), output); }
public void ReturnsFalseWhenStringLengthIsInvalid(String input) { var result = Base64Guid.TryParse(input, out var output); Assert.False(result); Assert.Equal(default(Base64Guid), output); }
public void ReturnsTrueWithBase64GuidResultFromInputWithPadding(Guid expected, string input) { input += "=="; var result = Base64Guid.TryParse(input, options => options.UsePadding(), out Base64Guid output); Assert.Equal(expected, output.Guid); }
public void ReturnsTrueWithBase64GuidResultFromUrlUnsafeInput(Guid expected, string input) { input = input.Replace("-", "+").Replace("_", "/"); var result = Base64Guid.TryParse(input, options => options.UseStandardBase64Encoding(), out Base64Guid output); Assert.Equal(expected, output.Guid); }
public void ReturnsFalseWhenStringContentIsInvalidForUrlUnsafeInput(string input) { input = input.Replace("+", "-").Replace("/", "_"); var result = Base64Guid.TryParse(input, options => options.UseStandardBase64Encoding(), out Base64Guid output); Assert.False(result); Assert.Equal(default(Base64Guid), output); }
public void ReturnsFalseWhenStringLengthIsInvalidForInputWithPadding(string input) { input += "=="; var result = Base64Guid.TryParse(input, options => options.UsePadding(), out Base64Guid output); Assert.False(result); Assert.Equal(default(Base64Guid), output); }
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); }