Пример #1
0
        public void CompositeShardingID_6()
        {
            var id1 = new CompositeShardingID(1, null);
            var id2 = new CompositeShardingID(1, null);

            Assert.AreEqual(id1.GetDistributedStableHash(), id2.GetDistributedStableHash());
        }
Пример #2
0
        public void CompositeShardingID_5()
        {
            var id1 = new CompositeShardingID(1, null);
            var id2 = new CompositeShardingID(null, 1);
            var id3 = new CompositeShardingID(null, 1, "string", "string2", true, 34d, 312m,
                                              4, 8, 7, "dsadasdasd", 2, "dsafdsfdsf", 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, "sdjfsdf9", 0, 1, "dsaasdasd2", '3', '4', "sssssssssssss5", 6, 7,
                                              8, 9, 0, 1, 2342342.12312312, 3, 4, 123215m, 6, 1237321322.23, 8, 9, 0);

            var id4 = new CompositeShardingID(null, 1, "string", "string2",
                                              new CompositeShardingID(1, 2, 3, 4, 5)
                                              );

            var hc1 = id1.GetDistributedStableHash();
            var hc2 = id2.GetDistributedStableHash();
            var hc3 = id3.GetDistributedStableHash();
            var hc4 = id4.GetDistributedStableHash();

            Console.WriteLine("{0}   ->  {1}", id1, hc1);
            Console.WriteLine("{0}   ->  {1}", id2, hc2);
            Console.WriteLine("{0}   ->  {1}", id3, hc3);
            Console.WriteLine("{0}   ->  {1}", id4, hc4);

            Assert.AreNotEqual(hc1, hc2);
            Assert.AreNotEqual(hc1, hc3);
            Assert.AreNotEqual(hc2, hc3);
            Assert.AreNotEqual(hc1, hc4);
            Assert.AreNotEqual(hc2, hc4);
            Assert.AreNotEqual(hc3, hc4);
        }
Пример #3
0
        public void CompositeShardingID_3()
        {
            var id1 = new CompositeShardingID(1, 23, 11);
            var id2 = new CompositeShardingID(1, 23);

            Assert.AreNotEqual(id1.GetDistributedStableHash(), id2.GetDistributedStableHash());
        }
Пример #4
0
        public void CompositeShardingID_1()
        {
            var id1 = new CompositeShardingID(1, new GDID(0, 123));
            var id2 = new CompositeShardingID(1, new GDID(1, 123));

            Assert.AreNotEqual(id1.GetDistributedStableHash(), id2.GetDistributedStableHash());
        }
Пример #5
0
        public void CompositeShardingID_6()
        {
          var id1 = new CompositeShardingID(1,null);
          var id2 = new CompositeShardingID(1,null);

          Assert.AreEqual( id1.GetDistributedStableHash(), id2.GetDistributedStableHash());
        }
Пример #6
0
        public void CompositeShardingID_5()
        {
          var id1 = new CompositeShardingID(1,null);
          var id2 = new CompositeShardingID(null,1);
          var id3 = new CompositeShardingID(null,1,"string","string2", true, 34d, 312m,
                   4,8,7,"dsadasdasd",2,"dsafdsfdsf",4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,"sdjfsdf9",0,1,"dsaasdasd2",'3','4',"sssssssssssss5",6,7,
                   8,9,0,1,2342342.12312312,3,4,123215m,6,1237321322.23,8,9,0);

          var id4 = new CompositeShardingID(null, 1,"string","string2", 
                             new CompositeShardingID(1,2,3,4,5)
          );

          var hc1 = id1.GetDistributedStableHash();
          var hc2 = id2.GetDistributedStableHash();
          var hc3 = id3.GetDistributedStableHash();
          var hc4 = id4.GetDistributedStableHash();

          Console.WriteLine("{0}   ->  {1}", id1, hc1);
          Console.WriteLine("{0}   ->  {1}", id2, hc2);
          Console.WriteLine("{0}   ->  {1}", id3, hc3);
          Console.WriteLine("{0}   ->  {1}", id4, hc4);

          Assert.AreNotEqual( hc1, hc2);
          Assert.AreNotEqual( hc1, hc3);
          Assert.AreNotEqual( hc2, hc3);
          Assert.AreNotEqual( hc1, hc4);
          Assert.AreNotEqual( hc2, hc4);
          Assert.AreNotEqual( hc3, hc4);

        }
Пример #7
0
        public void CompositeShardingID_3()
        {
          var id1 = new CompositeShardingID(1,23,11);
          var id2 = new CompositeShardingID(1,23);

          Assert.AreNotEqual( id1.GetDistributedStableHash(), id2.GetDistributedStableHash());
        }
Пример #8
0
        public void CompositeShardingID_1()
        {
          var id1 = new CompositeShardingID(1,new GDID(0,123));
          var id2 = new CompositeShardingID(1,new GDID(1,123));

          Assert.AreNotEqual( id1.GetDistributedStableHash(), id2.GetDistributedStableHash());
        }