Пример #1
0
        public void HashTest()
        {
            var a = new TensorOld(2, 3);
            var b = new TensorOld(2, 3);

            Assert.Equal(a, b);
            Assert.NotEqual(a.GetHashCode(), b.GetHashCode());

            var dict = new Dictionary <TensorOld, int>();

            dict.Add(a, 1);
            dict.Add(b, 2);
            Assert.Equal(1, dict[a]);
            Assert.Equal(2, dict[b]);
        }