コード例 #1
0
        public void Buy_budget500_cost700_resultArgumentException()
        {
            // arrange
            int budget = 500;
            int cost   = 700;

            // act
            Cashbox cashbox = new Cashbox(budget);

            cashbox.Buy(cost);
        }
コード例 #2
0
        public void Buy_budget1000_cost700_result300()
        {
            // arrange
            int budget   = 1000;
            int cost     = 700;
            int expected = 300;

            // act
            Cashbox cashbox = new Cashbox(budget);

            cashbox.Buy(cost);
            int actual = cashbox.Budget;

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