public MarketAnswer ViewPromotionHistory() { if (real != null) { return(real.ViewPromotionHistory()); } throw new NotImplementedException(); }
public void GetHistoryRecordsTest() { _ownerStoreBridge.PromoteToStoreManager("Big Smoke", "ManageProducts"); var answer = _ownerStoreBridge.ViewPromotionHistory(); Assert.AreEqual((int)StoreEnum.Success, answer.Status); var expected = new[] { "Store: HistoryShop Promoter: Pnina Promoted: Pnina Permissions: StoreOwner Date: " + DateTime.Now.ToString("dd/MM/yyyy") + " Description: HistoryShop has been opened", "Store: HistoryShop Promoter: Pnina Promoted: Big Smoke " + "Permissions: ManageProducts Date: " + DateTime.Now.ToString("dd/MM/yyyy") + " Description: Regular promotion" }; var actual = answer.ReportList; Assert.AreEqual(expected.Length, actual.Length); for (var i = 0; i < expected.Length; i++) { Assert.AreEqual(expected[i], actual[i]); } }