Beispiel #1
0
        private void AssertHistory(IEnumerable <PurchaseHistoryRecord> expectedHistoryRecords)
        {
            PurchaseHistory?purchaseHistory = MarketBridge.GetUserPurchaseHistory();

            new Assert_SetEquals <string, PurchaseHistoryRecord>
            (
                expectedHistoryRecords,
                x => x.PaymentId,
                (record_expected, record_actual) =>
            {
                //new Assert_SetEquals<ProductId, ProductInCart>
                // (
                //  record_expected.Products,
                //    x => x.ProductId
                // ).AssertEquals(record_actual.Products);
                Assert.AreEqual(record_expected.PaymentStatus, record_actual.PaymentStatus, "Expected a success payment status.");
                Assert.AreEqual(record_expected.DeliveryStatus, record_actual.DeliveryStatus, "Expected a success delivery status.");
                Assert.AreEqual(record_expected.PaymentId, record_actual.PaymentId, "The payment id is different than expected.");
                Assert.AreEqual(record_expected.DeliveryPackageId, record_actual.DeliveryPackageId, "The delivery package id is different than expected.");
                return(true);
            }
            ).AssertEquals(purchaseHistory);
        }