示例#1
0
        public void DoesntEqualForDifferentItems()
        {
            var key1 = new UriModuleItemResolverKey("module", "item1");
            var key2 = new UriModuleItemResolverKey("module", "item2");

            Assert.AreNotEqual(key1, key2);
        }
示例#2
0
        public void DoesntEqualForDifferentItems()
        {
            var key1 = new UriModuleItemResolverKey("module", "item1");
            var key2 = new UriModuleItemResolverKey("module", "item2");

            key1.Should().NotBe(key2);
        }
示例#3
0
        public void EqualsIndependentOfCase()
        {
            var module = "Module";
            var item   = "Item";

            var sampleKey = new UriModuleItemResolverKey(module, item);
            var upperKey  = new UriModuleItemResolverKey(module.ToUpper(), item.ToUpper());
            var lowerKey  = new UriModuleItemResolverKey(module.ToLower(), item.ToLower());

            Assert.AreEqual(sampleKey, upperKey);
            Assert.AreEqual(sampleKey.GetHashCode(), upperKey.GetHashCode());

            Assert.AreEqual(sampleKey, lowerKey);
            Assert.AreEqual(sampleKey.GetHashCode(), lowerKey.GetHashCode());

            Assert.AreEqual(upperKey, lowerKey);
            Assert.AreEqual(upperKey.GetHashCode(), lowerKey.GetHashCode());
        }
示例#4
0
        public void EqualsIndependentOfCase()
        {
            var module = "Module";
            var item   = "Item";

            var sampleKey = new UriModuleItemResolverKey(module, item);
            var upperKey  = new UriModuleItemResolverKey(module.ToUpper(), item.ToUpper());
            var lowerKey  = new UriModuleItemResolverKey(module.ToLower(), item.ToLower());

            sampleKey.Should().Be(upperKey);
            sampleKey.GetHashCode().Should().Be(upperKey.GetHashCode());

            sampleKey.Should().Be(lowerKey);
            sampleKey.GetHashCode().Should().Be(lowerKey.GetHashCode());

            upperKey.Should().Be(lowerKey);
            upperKey.GetHashCode().Should().Be(lowerKey.GetHashCode());
        }
示例#5
0
 /// <summary>
 /// Adds the given <see cref="IUriModuleItemResolver"/> as an object resolver by the given key.
 /// </summary>
 /// <param name="key">Key for access to the <see cref="IUriModuleItemResolver"/> being added.</param>
 /// <param name="uriModuleItemResolver">The <see cref="IUriModuleItemResolver"/> being added.</param>
 public void AddUriModuleItemResolver(UriModuleItemResolverKey key, IUriModuleItemResolver uriModuleItemResolver)
 {
     this._uriModuleItemResolvers.Add(key, uriModuleItemResolver);
 }
示例#6
0
 public void AddUriModuleItemResolver(UriModuleItemResolverKey key, IUriModuleItemResolver uriModuleItemResolver)
 {
     Contract.Requires <ArgumentNullException>(key != null);
     Contract.Requires <ArgumentNullException>(uriModuleItemResolver != null);
 }