public void AddPlant(long id, string friendlyName, string sciName)
 {
     _service.AddPlantAsync(new PlantModel()
     {
         Id             = id,
         FriendlyName   = friendlyName,
         ScientificName = sciName
     });
     Assert.IsTrue(_service.GetPlant(id) != null);
     Assert.IsTrue(_service.PlantExists(id));
 }
Exemple #2
0
        public async Task <ActionResult <PlantModel> > PostPlantModel(PlantModel plantModel)
        {
            await _plantService.AddPlantAsync(plantModel);

            return(CreatedAtAction(nameof(GetPlantModel), new { id = plantModel.Id }, plantModel));
        }