public void InstanceOK() { //Create an instance of the class we want to create clsGenre AGenre = new clsGenre(); //Test to see that it exisrs Assert.IsNotNull(AGenre); }
public void GenreDescPropertyOk() { clsGenre aGenre = new clsGenre(); string genreDesc = "Sci-Fi"; aGenre.GenreDesc = genreDesc; Assert.AreEqual(aGenre.GenreDesc, genreDesc); }
public void SetDetails(clsGenre prGenre) { _Genre = prGenre; txtGenreName.Enabled = string.IsNullOrEmpty(_Genre.GenreName); UpdateForm(); UpdateDisplay(); Show(); }
public void GenreIdPropertyOk() { clsGenre aGenre = new clsGenre(); Int32 genreId = 1; aGenre.GenreId = genreId; Assert.AreEqual(aGenre.GenreId, genreId); }
public void GenreTitlePropertyOK() { //Create an instance of the class we want to create clsGenre AGenre = new clsGenre(); //Create some test data to align to the property string SomeGenreTitle = "Action"; //Assign the data to the property AGenre.GenreTitle = SomeGenreTitle; Assert.AreEqual(AGenre.GenreTitle, SomeGenreTitle); }
public void GenreIDPropertyOK() { //Create an instance of the class we want to create clsGenre AGenre = new clsGenre(); //Create some test data to align to the property Int32 SomeGenreID = 1; //Assign the data to the property AGenre.GenreID = SomeGenreID; Assert.AreEqual(AGenre.GenreID, SomeGenreID); }
public void CountMatchesList() { clsGenreCollection genres = new clsGenreCollection(); List <clsGenre> testList = new List <clsGenre>(); clsGenre testItem = new clsGenre(); testItem.GenreId = 1; testItem.GenreDesc = "Sci-Fi"; testList.Add(testItem); genres.AllGenres = testList; Assert.AreEqual(genres.Count, testList.Count); }
public void GenreNameProperty() { //create an instance of the class we want to create clsGenre AnGenre = new clsGenre(); //create some test data to assign to the property string TestData = "comedy"; //assign the data to the proerty AnGenre.GenreName = TestData; //test to see that the two values are the same Assert.AreEqual(AnGenre.GenreName, TestData); }
public void ValidMethodOK() { //create an instance of the class we want to create clsGenre AGenre = new clsGenre(); //boolean variable to store the result of the validation Boolean Ok = false; //create some data to use with the method string GenreName = "Bob"; string Age = "23"; //invoke the method Ok = AGenre.Valid(GenreName, Age); //test tto see that the reuslt is correct Assert.IsTrue(Ok); }
private void btnDeleteGenre_Click(object sender, EventArgs e) { string lcKey = Convert.ToString(lstGenres.SelectedItem); if (lcKey != null && MessageBox.Show("Are you sure?", "Deleting Genre", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) try { clsGenre lcGenre = new clsGenre() { GenreName = lcKey }; Program.SvcClient.DeleteGenre(lcGenre); lstGenres.ClearSelected(); UpdateDisplay(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error deleting Genre"); } }
public void CountMatchesList() { //Create an instance of the class we want to create clsGenreCollection Genres = new clsGenreCollection(); //Create some test data to align to the property //In this case, the data needs to be a list of objects List <clsGenre> TestList = new List <clsGenre>(); //Add an item to the list //Create an item of test data clsGenre TestItem = new clsGenre(); //Set its properties TestItem.GenreID = 1; TestItem.GenreTitle = "Action"; //Add the item to the test list TestList.Add(TestItem); //Assign the data to the property Genres.GenreList = TestList; //Test to see that the two values are the same Assert.AreEqual(Genres.Count, TestList.Count); }
public void InstanceOk() { clsGenre aGenre = new clsGenre(); Assert.IsNotNull(aGenre); }