public void GetGardenPlant() { Database db = new Database(); PlantsLookup b = new PlantsLookup(); b = db.GetPlantById(2); Assert.AreNotEqual(b, null); }
public void GettLinkToImage() { int plantId = 2; string expected = "pack://application:,,,/Pictures/Plants/Artichoke.png"; Database db = new Database(); PlantsLookup p = new PlantsLookup(); p = db.GetPlantById(plantId); string actual = p.PictureSource; Assert.AreEqual(expected, actual); }
private void RibbonButton_Plants(object sender, RoutedEventArgs e) { Button someButton = sender as Button; if (someButton != null) { isDrawingBeds = false; int tag; bool res = int.TryParse((string)someButton.Tag, out tag); if (res == false) { MessageBox.Show("Unable to fetch the plant from database", "Database error", MessageBoxButton.OK, MessageBoxImage.Exclamation); return; } pLookup = db.GetPlantById(tag); } }