Example #1
0
        public void Ctor_ValidStringParameter_Ok()
        {
            // Arrange
            String uri = new Uri("http://test.url.com").ToString();

            // Action
            RssUrl rssUrl = new RssUrl(uri);

            // Assert
            Assert.AreEqual(uri, rssUrl.UrlString);
        }
Example #2
0
        public void Ctor_ValidUriParameter_Ok()
        {
            // Arrange
            Uri uri = new Uri("http://test.url.com");

            // Action
            RssUrl rssUrl = new RssUrl(uri);

            // Assert
            Assert.AreEqual(uri, rssUrl.Url);
        }
Example #3
0
        public void SetString_ConvertToUri_Uri()
        {
            // Arrange
            RssUrl rssUrl = new RssUrl();
            Uri uri = new Uri("http://test.url.com");

            // Action
            rssUrl.Url = uri;

            // Assert
            Assert.AreEqual(uri.AbsoluteUri, rssUrl.UrlString);
        }
Example #4
0
        public void SetString_ValidStringParameter_Ok()
        {
            // Arrange
            var rssUrl = new RssUrl();
            String uri = new Uri("http://test.url.com").ToString();

            // Action
            rssUrl.UrlString = uri;

            // Assert
            Assert.AreEqual(uri, rssUrl.UrlString);
        }
Example #5
0
        public void SetUri_ValidUriParameter_Ok()
        {
            // Arrange
            RssUrl rssUrl = new RssUrl();
            Uri uri = new Uri("http://test.url.com");

            // Action
            rssUrl.Url = uri;

            // Assert
            Assert.AreEqual(uri, rssUrl.Url);
        }
Example #6
0
        public void SetString_Null_UriNull()
        {
            // Arrange
            RssUrl rssUrl = new RssUrl();

            // Action
            rssUrl.UrlString = null;

            // Assert
            Assert.AreEqual(null, rssUrl.Url);
        }
Example #7
0
        public void SetString_InvalidUriFormat_Error()
        {
            // Arrange
            RssUrl rssUrl = new RssUrl();
            const string InvalidUri = "adsfsadf";

            // Action
            RSSParameterException e = null;
            try
            {
                rssUrl.UrlString = InvalidUri;
            }
            catch (RSSParameterException ex)
            {
                e = ex;
            }

            // Assert
            Assert.IsNotNull(e);
        }