Exemplo n.º 1
0
        public void KeysWithDifferentPrefixShouldNotBeEqual()
        {
            var key1 = new WorkerQueryKey("prefix1", new[] { 1 });
            var key2 = new WorkerQueryKey("prefix2", new[] { 1 });

            Assert.False(key1.Equals(key2));
        }
Exemplo n.º 2
0
        public void KeysWithDifferentParameterNamesShouldNotBeEqual()
        {
            var params1 = new Dictionary <string, object> {
                ["a"] = 1, ["b"] = 1
            };
            var params2 = new Dictionary <string, object> {
                ["a"] = 1, ["c"] = 1
            };

            var key1 = new WorkerQueryKey("prefix1", params1);
            var key2 = new WorkerQueryKey("prefix1", params2);

            Assert.False(key1.Equals(key2));
        }
Exemplo n.º 3
0
        public void KeysWithSamePrefixShouldBeEqual()
        {
            var key1 = new WorkerQueryKey("prefix1", new[] { 1 });
            var key2 = new WorkerQueryKey("prefix1", new[] { 1 });

            Assert.True(key1.Equals(key2));

            var params1 = new Dictionary <string, object> {
                ["a"] = 1, ["b"] = 1
            };
            var params2 = new Dictionary <string, object> {
                ["a"] = 1, ["b"] = 1
            };

            key1 = new WorkerQueryKey("prefix1", params1);
            key2 = new WorkerQueryKey("prefix1", params2);

            Assert.True(key1.Equals(key2));
        }