コード例 #1
0
 public void FirstBuyerWin()
 {
     MakeRegisteredShoppers();
     Assert.AreEqual((int)OrderStatus.Success, _orderBridge1.BuyLotteryTicket("Fanta", storeName, 1, 4).Status);
     Assert.AreEqual((int)OrderStatus.Success, _orderBridge2.BuyLotteryTicket("Fanta", storeName, 1, 4).Status);
     _orderBridge3.Cheat(3);
     Assert.AreEqual((int)OrderStatus.Success, _orderBridge3.BuyLotteryTicket("Fanta", storeName, 1, 4).Status);
     string[] expectedHistoryFirstBuyer =
     {
         "User: Shalom1 Product: DELIVERY : Fanta Store: LotteryStore Sale: Lottery Quantity: 1 Price: 1 Date: " + DateTime.Now.Date.ToString("dd/MM/yyyy"),
         "User: Shalom1 Product: Fanta Store: LotteryStore Sale: Lottery Quantity: 1 Price: 4 Date: " + DateTime.Now.Date.ToString("dd/MM/yyyy"),
     };
     string[] expectedHistorySecondBuyer =
     {
         "User: Shalom2 Product: Fanta Store: LotteryStore Sale: Lottery Quantity: 1 Price: 4 Date: " + DateTime.Now.Date.ToString("dd/MM/yyyy"),
     };
     string[] expectedHistoryThirdBuyer =
     {
         "User: Shalom3 Product: Fanta Store: LotteryStore Sale: Lottery Quantity: 1 Price: 4 Date: " + DateTime.Now.Date.ToString("dd/MM/yyyy"),
     };
     string[] actualHistoryFirstBuyer  = _adminBridge.ViewPurchaseHistoryByUser("Shalom1").ReportList;
     string[] actualHistorySecondBuyer = _adminBridge.ViewPurchaseHistoryByUser("Shalom2").ReportList;
     string[] actualHistoryThirdBuyer  = _adminBridge.ViewPurchaseHistoryByUser("Shalom3").ReportList;
     lotteryEventReport(expectedHistoryFirstBuyer, expectedHistorySecondBuyer, expectedHistoryThirdBuyer,
                        actualHistoryFirstBuyer, actualHistorySecondBuyer, actualHistoryThirdBuyer);
 }
コード例 #2
0
 public void Cheat(int cheatCode)
 {
     if (real != null)
     {
         real.Cheat(cheatCode);
     }
     else
     {
         throw new NotImplementedException();
     }
 }