Пример #1
0
        public void Test002_GivenHelpTheBookseller_WhenTheStockIsFilled_ThenTheSummaryReturnsAllCategoriesWithCorrectAmounts()
        {
            string[] stockList    = new string[] { "ABART 10", "CDXEF 5", "BKWRK 10", "BCTK 2" };
            string[] categoryList = new string[] { "A", "B", "C" };

            string expectedResult = "(A : 10) - (B : 12) - (C : 5)";
            string actualResult   = HelpTheBookseller.GetStockSummary(stockList, categoryList);

            Assert.AreEqual(expectedResult, actualResult);
        }
Пример #2
0
        public void Test004_GivenHelpTheBookseller_WhenCategoryListIsAnEmptyArray_ThenTheSummaryReturnsEmptyString()
        {
            string[] stockList    = new string[] { "ABART 10", "CDXEF 5", "BKWRK 10", "BCTK 2" };
            string[] categoryList = new string[] { };

            string expectedResult = "";
            string actualResult   = HelpTheBookseller.GetStockSummary(stockList, categoryList);

            Assert.AreEqual(expectedResult, actualResult);
        }
Пример #3
0
        public void Test001_GivenHelpTheBookseller_WhenTheStockQuantitiesAreZero_ThenTheSummaryReturnsAllCategoriesAsEmpty()
        {
            string[] stockList    = new string[] { "ABART 0", "CDXEF 0", "BKWRK 0" };
            string[] categoryList = new string[] { "A", "B", "C" };

            string expectedResult = "(A : 0) - (B : 0) - (C : 0)";
            string actualResult   = HelpTheBookseller.GetStockSummary(stockList, categoryList);

            Assert.AreEqual(expectedResult, actualResult);
        }