Exemplo n.º 1
0
        private async void PaymentERL_TestGetPaymentERL()
        {
            var paymentEdit = await PaymentERL.GetPaymentERL();

            Assert.NotNull(paymentEdit);
            Assert.Equal(3, paymentEdit.Count);
        }
Exemplo n.º 2
0
        private async void PaymentERL_TestAddPaymentsEntry()
        {
            var paymentEditList = await PaymentERL.GetPaymentERL();

            var countBeforeAdd = paymentEditList.Count;

            var paymentToAdd = paymentEditList.AddNew();

            await BuildPayment(paymentToAdd);

            var updatedPaymentsList = await paymentEditList.SaveAsync();

            Assert.NotEqual(countBeforeAdd, updatedPaymentsList.Count);
        }
Exemplo n.º 3
0
        private async void PaymentERL_TestUpdatePaymentsEntry()
        {
            const int idToUpdate = 1;

            var paymentEditList = await PaymentERL.GetPaymentERL();

            var countBeforeUpdate = paymentEditList.Count;
            var paymentToUpdate   = paymentEditList.First(a => a.Id == idToUpdate);

            paymentToUpdate.Notes = "This was updated";

            var updatedList = await paymentEditList.SaveAsync();

            Assert.Equal("This was updated", updatedList.First(a => a.Id == idToUpdate).Notes);
            Assert.Equal(countBeforeUpdate, updatedList.Count);
        }
Exemplo n.º 4
0
        private async void PaymentERL_TestDeletePaymentsEntry()
        {
            var paymentEdit = await PaymentERL.GetPaymentERL();

            var listCount       = paymentEdit.Count;
            var paymentToDelete = paymentEdit.First(et => et.Id == 99);

            // remove is deferred delete
            var isDeleted = paymentEdit.Remove(paymentToDelete);

            var paymentListAfterDelete = await paymentEdit.SaveAsync();

            Assert.NotNull(paymentListAfterDelete);
            Assert.IsType <PaymentERL>(paymentListAfterDelete);
            Assert.True(isDeleted);
            Assert.NotEqual(listCount, paymentListAfterDelete.Count);
        }