Esempio n. 1
0
        public void CanMerge()
        {
            var x = new ResultCube();

            x.Initialize(new Dictionary <string, Type> {
                { "gwah", typeof(string) }, { "wwahh", typeof(int) }
            });
            var y = new ResultCube();

            y.Initialize(new Dictionary <string, Type> {
                { "gwah", typeof(string) }, { "wwahh", typeof(int) }
            });

            x.AddRow(new object[] { "woooh", 6 }, 77.6);
            y.AddRow(new object[] { "woooh", 6 }, 77.4);

            var d = x.MergeQuick(y);

            Assert.Equal(2, d.GetAllRows().Length);
            d = x.Merge(y);
            Assert.Equal(2, d.GetAllRows().Length);

            var z = new ResultCube();

            z.Initialize(new Dictionary <string, Type> {
                { "gwah", typeof(bool) }, { "wwahh", typeof(int) }
            });
            Assert.Throws <Exception>(() => x.MergeQuick(z));
            Assert.Throws <Exception>(() => x.Merge(z));
        }