Exemplo n.º 1
0
        public void GetPackages_WhenBooks001_ThenPackagesWith2BooksAndWith1()
        {
            CompareLists(new int[] { 2, 1 }, _calculator.GetPackages(new int[] { 0, 0, 1 }));
            CompareLists(new int[] { 1, 1, 1 }, _calculator.GetPackages(new int[] { 0, 0, 0 }));
            CompareLists(new int[] { 2, 1 }, _calculator.GetPackages(new int[] { 0, 1, 1 }));
            CompareLists(new int[] { 4, 1, 1 }, _calculator.GetPackages(new int[] { 0, 0, 0, 1, 2, 3 }));
            CompareLists(new int[] { 3, 2, 1 }, _calculator.GetPackages(new int[] { 0, 1, 1, 2, 2, 2 }));

            CompareLists(new int[] { 5, 5, 5, 5, 3 }, _calculator.GetPackages(new int[]
                                                                              { 0, 0, 0, 0, 0,
                                                                                1, 1, 1, 1, 1,
                                                                                2, 2, 2, 2,
                                                                                3, 3, 3, 3, 3,
                                                                                4, 4, 4, 4 }));
        }