Пример #1
0
        public void CompareTo_Invalid_Throws()
        {
            var key = new AttributeKey();

            Assert.Throws <ArgumentNullException>(() => key.CompareTo(null));
            Assert.Throws <ArgumentNullException>(() => key.CompareTo(new CatalogKey()));
        }
Пример #2
0
        public void CompareTo_Works()
        {
            var key = new AttributeKey();

            key.ReadFrom(Convert.FromBase64String("AC4AAAAAABcAAAAAABEAYwBvAG0ALgBhAHAAcABsAGUALgBkAGUAYwBtAHAAZgBz"), 0);

            var other = new AttributeKey();

            key.ReadFrom(Convert.FromBase64String("AC4AAAAAABcAAAAAABEAYwBvAG0ALgBhAHAAcABsAGUALgBkAGUAYwBtAHAAZgBz"), 0);

            Assert.Equal(0, key.CompareTo(key));
            Assert.Equal(1, key.CompareTo(other));
            Assert.Equal(-1, other.CompareTo(key));
        }