示例#1
0
        public void rows_less_than_0_throw_argumentException()
        {
            //arrange
            var target = new AggregateGoods();
            var goods  = GetGoods();

            //act
            Action actual = () => target.Sum(goods, 0, "Revenue");

            //assert
            actual.ShouldThrow <ArgumentException>();
        }
示例#2
0
        public void rows_4_column_revenue_sum_should_be_50_66_60()
        {
            //arrange
            var target   = new AggregateGoods();
            var goods    = GetGoods();
            var excepted = new List <int> {
                50, 66, 60
            };

            //act
            var actual = target.Sum(goods, 4, "Revenue");

            //assert
            Assert.AreEqual(excepted, actual);
        }
示例#3
0
        public void rows_3_column_cost_sum_should_be_6_15_24_21()
        {
            //arrange
            var target   = new AggregateGoods();
            var goods    = GetGoods();
            var excepted = new List <int> {
                6, 15, 24, 21
            };

            //act
            var actual = target.Sum(goods, 3, "Code");

            //assert
            Assert.AreEqual(excepted, actual);
        }