public void WhenANewDevIsAdded_TheNumberOfDevsIncreasesBy1() { using (var db = new GameMarketContext()) { var numberOfDevsBefore = db.Developers.Count(); _crudMethods.Create("Bioware"); var numberOfDevsAfter = db.Developers.Count(); Assert.AreEqual(numberOfDevsBefore + 1, numberOfDevsAfter); } }
private void Btn_Click(object sender, RoutedEventArgs e) { Button btnClick = (Button)sender; if (btnClick.Name == "createBtn") { if (devCreateBox.Text != "") { if (_genreManager.Create(devCreateBox.Text)) { MessageBox.Show("Developer Created Successfully"); devCreateBox.Text = ""; PopulateListBox(); } else { MessageBox.Show("Duplicate Value Entered - Value not added"); } } else { MessageBox.Show("Input box empty - input valid value"); } } else if (btnClick.Name == "deleteBtn") { if (devDeleteBox.Text != "") { _genreManager.Delete(_genreManager.developerUpdate.DeveloperName); MessageBox.Show("Developer Deleted Successfully"); devCreateBox.Text = ""; devDeleteBox.Text = ""; devUpdateText.Text = ""; PopulateListBox(); } else { MessageBox.Show("Not Genre Select - Select genre to delete"); } } else if (btnClick.Name == "updateBtn") { if (devUpdateText.Text != "") { if (_genreManager.Update(_genreManager.developerUpdate.DeveloperName, devUpdateText.Text)) { MessageBox.Show("Developer Update Successfully"); devCreateBox.Text = ""; devDeleteBox.Text = ""; devUpdateText.Text = ""; PopulateListBox(); } else { MessageBox.Show("New Developer entered already exists"); } } else { MessageBox.Show("Not Developer Select - Select genre to update"); } } }