private EntityAccessor <T> GetInitialEntity() { var message = PluginExecutionContext.MessageName; var handler = EntityGetter.GetHandler(message); return(handler.Get(this, Config).ToEntityAccessor <T>()); }
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); }
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; }