Exemple #1
0
 public NutrientQueryController(
     ListNutrientsHandler listNutrientsHandler,
     GetNutrientDetailsHandler getNutrientDetailsHandler)
 {
     this.listNutrientsHandler      = listNutrientsHandler;
     this.getNutrientDetailsHandler = getNutrientDetailsHandler;
 }
Exemple #2
0
        public static async Task Main(string[] args)
        {
            var repository     = new NutrientRepository();
            var commandHandler = new CreateNutrientHandler(repository);
            var command        = new CreateNutrient("Vitamin D");
            await commandHandler.HandleCommandAsync(command);

            var queryHandler = new ListNutrientsHandler(repository);
            var query        = new ListNutrients(o => o.Title == "Vitamin D");
            var result       = await queryHandler.HandleQueryAsync(query);

            System.Console.ReadKey();
        }
Exemple #3
0
 public void Setup()
 {
     this.repository = A.Fake <IRepository <Nutrient, Guid> >();
     this.sut        = new ListNutrientsHandler(this.repository);
 }