Пример #1
0
        public void Test_DeepLinkCollection_string_null_empty_whitespace()
        {
            try
            {
                string s = null;
                var    p = new TestCollectionCapableDeepLinkParser(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 TestCollectionCapableDeepLinkParser(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 TestCollectionCapableDeepLinkParser(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_DeepLinkCollection_uri_null()
        {
            try
            {
                Uri s = null;
                var p = new TestCollectionCapableDeepLinkParser(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");
            }
        }