private EntityAccessor <T> GetInitialEntity()
        {
            var message = PluginExecutionContext.MessageName;
            var handler = EntityGetter.GetHandler(message);

            return(handler.Get(this, Config).ToEntityAccessor <T>());
        }
Exemple #2
0
        public async Task EntityGetterTest()
        {
            var getter = new EntityGetter <Order>(_db.Object);
            var order  = await getter.GetAsync(1);

            Assert.NotNull(order);
            Assert.Equal(1, order.Id);
        }
Exemple #3
0
        public async Task ViewModelGetterTest()
        {
            InitMapper();
            var getter = new EntityGetter <Order, OrderItemViewModel>(_db.Object);
            var order  = await getter.GetAsync(1, x => x.Customer, y => y.Product);

            Assert.NotNull(order);
            Assert.Equal(1, order.Id);
        }
 private void When_I_request_this_entity(string nzbn)
 {
     _receivedResponse = EntityGetter.Get(nzbn).Result;
 }