private async Task <Customer> ExecuteRequest(MQItem item)
        {
            var customer = (Customer)item.Item;

            //mockup call
            switch (item.Action)
            {
            case CrudAction.Update:
                return(OldApiMockup.Update(customer));

                break;

            case CrudAction.Add:
                return(OldApiMockup.Add(customer));

                break;

            case CrudAction.Delete:
                return(OldApiMockup.Delete(customer.Id));

                break;

            case CrudAction.Get:
                return(OldApiMockup.Get(customer.Id));

            default:
                break;
            }

            return((Customer)item.Item);
        }
Exemple #2
0
        public void UpdateShouldBeTrue()
        {
            PrepareDb();
            OldApiMockup.Update(new Customer {
                Id = 555, Name = "Arya Stark"
            });
            var record = OldApiMockup.Get(555);

            Assert.IsTrue(record.Name == "Arya Stark");
        }