Exemple #1
0
        static void Main(string[] args)
        {
            var products = new Products();

            var result1 = products.GetSum(3, "Cost");

            Console.WriteLine(string.Join(",", result1.ToArray()));

            var result2 = products.GetSum(4, "Revenue");

            Console.WriteLine(string.Join(",", result2.ToArray()));

            Console.ReadKey();
        }
        public void GetSum_Test_Group_4_Revenue()
        {
            //Arrange
            Products target = new Products();

            List<int> expected = new List<int>() { 50, 66, 60 };

            //Act
            List<int> actual = target.GetSum(4, "Revenue");

            //Assert
            CollectionAssert.AreEqual(expected, actual);
        }
        public void GetSum_Test_Group_3_Cost()
        {
            //Arrange
            Products target = new Products();

            List<int> expected = new List<int>() {6,15,24,21 };

            //Act
            List<int> actual = target.GetSum(3, "Cost");

            //Assert
            CollectionAssert.AreEqual(expected, actual);
        }