public void Serialize_Null()
        {
            // arrange
            UrlType dateType = new UrlType();

            // act
            object serializedValue = dateType.Serialize(null);

            // assert
            Assert.Null(serializedValue);
        }
Example #2
0
        public void Serialize_RelativeUrl()
        {
            // arrange
            var urlType = new UrlType();
            var uri     = new Uri("/relative/path", UriKind.Relative);

            // act
            object serializedValue = urlType.Serialize(uri);

            // assert
            Assert.Equal(uri.ToString(), Assert.IsType <string>(serializedValue));
        }
Example #3
0
        public void Serialize_Url()
        {
            // arrange
            UrlType urlType = new UrlType();
            Uri     uri     = new Uri("http://domain.test/url");

            // act
            object serializedValue = urlType.Serialize(uri);

            // assert
            Assert.Equal(uri, Assert.IsType <Uri>(serializedValue));
        }
Example #4
0
        public void Serialize_Url()
        {
            // arrange
            var urlType = new UrlType();
            var uri     = new Uri("http://domain.test/url");

            // act
            object serializedValue = urlType.Serialize(uri);

            // assert
            Assert.Equal(uri.AbsoluteUri, Assert.IsType <string>(serializedValue));
        }
        public void Serialize_Url()
        {
            // arrange
            UrlType urlType       = new UrlType();
            Uri     uri           = new Uri("http://domain.test/url");
            string  expectedValue = uri.AbsoluteUri;

            // act
            string serializedValue = (string)urlType.Serialize(uri);

            // assert
            Assert.Equal(expectedValue, serializedValue);
        }