Esempio n. 1
0
            public void ReturnsTrueWithBase64GuidResult(Guid expected, string input)
            {
                var result = Base64Guid.TryParse(input, out Base64Guid output);

                Assert.True(result);
                Assert.Equal(expected, output.Guid);
            }
Esempio n. 2
0
            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);
            }
Esempio n. 4
0
            public void ReturnsTrueWithBase64GuidResultFromInputWithPadding(Guid expected, string input)
            {
                input += "==";

                var result = Base64Guid.TryParse(input, options => options.UsePadding(), out Base64Guid output);

                Assert.Equal(expected, output.Guid);
            }
Esempio n. 5
0
            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);
            }
Esempio n. 6
0
            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);
            }
Esempio n. 7
0
            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);
            }