コード例 #1
0
        public void opEquality_RelativeUri_RelativeUriDiffers()
        {
            var obj       = new RelativeUri("/abc");
            var comparand = new RelativeUri("/xyz");

            Assert.False(obj == comparand);
        }
コード例 #2
0
        public void opExplicit_RelativeUri_UriRelative()
        {
            var         expected = new RelativeUri("/");
            RelativeUri actual   = new Uri("/", UriKind.Relative);

            Assert.Equal(expected, actual);
        }
コード例 #3
0
        public void prop_Length_getEmpty()
        {
            const int expected = 0;
            var       actual   = new RelativeUri(string.Empty).Length;

            Assert.Equal(expected, actual);
        }
コード例 #4
0
        public void opInequality_RelativeUri_RelativeUriDiffers()
        {
            var obj       = new RelativeUri("/abc");
            var comparand = new RelativeUri("/xyz");

            Assert.True(obj != comparand);
        }
コード例 #5
0
        public void opImplicit_Uri_RelativeUri()
        {
            var expected = new Uri("/", UriKind.Relative);
            Uri actual   = new RelativeUri(expected);

            Assert.Equal(expected, actual);
        }
コード例 #6
0
        public void opImplicit_string_RelativeUri()
        {
            const string expected = "/";
            string       actual   = new RelativeUri(expected);

            Assert.Equal(expected, actual);
        }
コード例 #7
0
        public void opImplicit_RelativeUri_stringEmpty()
        {
            var         expected = new RelativeUri(string.Empty);
            RelativeUri actual   = string.Empty;

            Assert.Equal(expected, actual);
        }
コード例 #8
0
        public void opImplicit_RelativeUri_string()
        {
            var         expected = new RelativeUri("/");
            RelativeUri actual   = "/";

            Assert.Equal(expected, actual);
        }
コード例 #9
0
        public void opEquality_RelativeUri_RelativeUri()
        {
            var obj       = new RelativeUri("/");
            var comparand = new RelativeUri("/");

            Assert.True(obj == comparand);
        }
コード例 #10
0
        public void opInequality_RelativeUri_RelativeUriSame()
        {
            var obj       = new RelativeUri("/");
            var comparand = obj;

            Assert.False(obj != comparand);
        }
コード例 #11
0
        public void prop_Length_get()
        {
            const int expected = 4;
            var       actual   = new RelativeUri("/234").Length;

            Assert.Equal(expected, actual);
        }
コード例 #12
0
        public void op_Equals_objectDiffer()
        {
            var obj       = new RelativeUri("/abc");
            var comparand = new RelativeUri("/xyz");

            Assert.False(obj.Equals(comparand as object));
        }
コード例 #13
0
        public void op_Equals_object()
        {
            var obj       = new RelativeUri("/");
            var comparand = new RelativeUri("/");

            Assert.True(obj.Equals(comparand as object));
        }
コード例 #14
0
        public void op_CompareTo_object()
        {
            const int expected = 1;
            var       actual   = new RelativeUri("/").CompareTo(null as object);

            Assert.Equal(expected, actual);
        }
コード例 #15
0
        public void op_Equals_RelativeUriSame()
        {
            var obj       = new RelativeUri("/");
            var comparand = obj;

            Assert.True(obj.Equals(comparand));
        }
コード例 #16
0
        public void op_Equals_RelativeUriUnequal()
        {
            var obj       = new RelativeUri("/abc");
            var comparand = new RelativeUri("/xyz");

            Assert.False(obj.Equals(comparand));
        }
コード例 #17
0
        public void opGreaterThan_RelativeUri_RelativeUri()
        {
            var obj       = new RelativeUri("/");
            var comparand = new RelativeUri("/");

            Assert.False(obj > comparand);
        }
コード例 #18
0
        public void opGreaterThan_RelativeUriGreater_RelativeUri()
        {
            var obj       = new RelativeUri("/xyz");
            var comparand = new RelativeUri("/abc");

            Assert.True(obj > comparand);
        }
コード例 #19
0
        public void op_ToString()
        {
            const string expected = "/";
            var          actual   = new RelativeUri(expected).ToString();

            Assert.Equal(expected, actual);
        }
コード例 #20
0
        public void opLesserThan_RelativeUri_RelativeUriLesser()
        {
            var obj       = new RelativeUri("/xyz");
            var comparand = new RelativeUri("/abc");

            Assert.False(obj < comparand);
        }
コード例 #21
0
        public void op_CompareTo_objectSame()
        {
            var obj = new RelativeUri("/");

            const int expected = 0;
            var       actual   = obj.CompareTo(obj as object);

            Assert.Equal(expected, actual);
        }
コード例 #22
0
        public void op_GetHashCode()
        {
            var obj = new RelativeUri("/");

            var expected = obj.ToString().GetHashCode();
            var actual   = obj.GetHashCode();

            Assert.Equal(expected, actual);
        }
コード例 #23
0
        public void op_CompareTo_objectLesser()
        {
            var    obj       = new RelativeUri("/xyz");
            object comparand = new RelativeUri("/abc");

            const int expected = 23;
            var       actual   = obj.CompareTo(comparand);

            Assert.Equal(expected, actual);
        }
コード例 #24
0
        public void op_CompareTo_RelativeUriEqual()
        {
            var obj       = new RelativeUri("/");
            var comparand = new RelativeUri("/");

            const int expected = 0;
            var       actual   = obj.CompareTo(comparand);

            Assert.Equal(expected, actual);
        }
コード例 #25
0
        public void ctor_SerializationInfo_StreamingContext()
        {
            var         expected = new RelativeUri("/");
            RelativeUri actual;

            using (Stream stream = new MemoryStream())
            {
                var formatter = new BinaryFormatter();
                formatter.Serialize(stream, new RelativeUri("/"));
                stream.Position = 0;
                actual          = (RelativeUri)formatter.Deserialize(stream);
            }

            Assert.Equal(expected, actual);
        }
コード例 #26
0
        public void opGreaterThan_RelativeUriNull_RelativeUri()
        {
            var comparand = new RelativeUri("/");

            Assert.False(null > comparand);
        }
コード例 #27
0
        public void opGreaterThan_RelativeUri_RelativeUriNull()
        {
            var obj = new RelativeUri("/");

            Assert.True(obj > null);
        }
コード例 #28
0
        public void opLesserThan_RelativeUriNull_RelativeUri()
        {
            var comparand = new RelativeUri("/");

            Assert.True(null < comparand);
        }
コード例 #29
0
        public void opLesserThan_RelativeUri_RelativeUriNull()
        {
            var obj = new RelativeUri("/");

            Assert.False(obj < null);
        }
コード例 #30
0
        public void op_Equals_objectSame()
        {
            var obj = new RelativeUri("/");

            Assert.True(obj.Equals(obj as object));
        }