public void CreateTest() { StoreManagerController target = new StoreManagerController(); // TODO: Initialize to an appropriate value Album album = null; // TODO: Initialize to an appropriate value ActionResult expected = null; // TODO: Initialize to an appropriate value ActionResult actual; actual = target.Create(album); Assert.AreEqual(expected, actual); Assert.Inconclusive("Verify the correctness of this test method."); }
public void EditTest() { StoreManagerController target = new StoreManagerController(); int id = 669; ActionResult actual; actual = target.Edit(id); Assert.IsNotNull(actual); Assert.IsInstanceOfType(actual, typeof(ViewResult)); ViewResult viewResult = (ViewResult)actual; Assert.IsInstanceOfType(viewResult.ViewData.Model, typeof(StoreManagerViewModel)); StoreManagerViewModel model = (StoreManagerViewModel)viewResult.ViewData.Model; Assert.AreEqual(id, model.Album.AlbumId); Assert.AreEqual("Ring My Bell", model.Album.Title); Assert.AreEqual(10, model.Genres.Count()); }
public void CreateTest() { using (TransactionScope ts = new TransactionScope()) { StoreManagerController target = new StoreManagerController(); Album album = new Album() { GenreId = 1, ArtistId = 1, Title = "New Album", Price = 10, AlbumArtUrl = "/Content/Images/placeholder.gif" }; ActionResult actual; actual = target.Create(album); Assert.IsTrue(album.AlbumId != 0); MusicStoreEntities storeDB = new MusicStoreEntities(); var newAlbum = storeDB.Albums.SingleOrDefault(a => a.AlbumId == album.AlbumId); Assert.AreEqual(album.GenreId, newAlbum.GenreId); Assert.AreEqual(album.ArtistId, newAlbum.ArtistId); Assert.AreEqual(album.Title, newAlbum.Title); Assert.AreEqual(album.Price, newAlbum.Price); Assert.AreEqual(album.AlbumArtUrl, newAlbum.AlbumArtUrl); } }
public void DeleteTest() { using (TransactionScope ts = new TransactionScope()) { StoreManagerController target = new StoreManagerController(); int id = 669; ActionResult actual; actual = target.Delete(id, null); Assert.IsNotNull(actual); MusicStoreEntities storeDB = new MusicStoreEntities(); var album = storeDB.Albums.SingleOrDefault(a => a.AlbumId == id); Assert.IsNull(album); } }