Пример #1
0
        public void Test_DeepLink_string_null_empty_whitespace()
        {
            try
            {
                string s = null;
                var    p = new TestDeepLinkParser(s);

                Assert.Fail("Should have thrown ArgumentNullException for null string");
            }
            catch (ArgumentNullException aex)
            {
                Debug.WriteLine(aex.ToString());
            }
            catch
            {
                Assert.Fail("Should have thrown ArgumentNullException for null string");
            }

            try
            {
                string s = string.Empty;
                var    p = new TestDeepLinkParser(s);

                Assert.Fail("Should have thrown ArgumentNullException for empty string");
            }
            catch (ArgumentNullException aex)
            {
                Debug.WriteLine(aex.ToString());
            }
            catch
            {
                Assert.Fail("Should have thrown ArgumentNullException for empty string");
            }

            try
            {
                string s = "   ";
                var    p = new TestDeepLinkParser(s);

                Assert.Fail("Should have thrown ArgumentNullException for whitespace-only string");
            }
            catch (ArgumentNullException aex)
            {
                Debug.WriteLine(aex.ToString());
            }
            catch
            {
                Assert.Fail("Should have thrown ArgumentNullException for whitespace-only string");
            }
        }
Пример #2
0
        public void Test_DeepLink_string_DuplicateKeys()
        {
            try
            {
                var s = SAMPLELINK + "&option2=value4";
                var p = new TestDeepLinkParser(s);

                Assert.Fail("Should have thrown ArgumentException");
            }
            catch (ArgumentException aex)
            {
                Debug.WriteLine(aex.ToString());
            }
            catch
            {
                Assert.Fail("Should have thrown ArgumentException");
            }
        }
Пример #3
0
        public void Test_DeepLink_uri_null()
        {
            try
            {
                Uri s = null;
                var p = new TestDeepLinkParser(s);

                Assert.Fail("Should have thrown ArgumentNullException for null string");
            }
            catch (ArgumentNullException aex)
            {
                Debug.WriteLine(aex.ToString());
            }
            catch
            {
                Assert.Fail("Should have thrown ArgumentNullException for null string");
            }
        }