public void DeleteNoId() { // act var result = (ViewResult)controller.Delete(null); // assert Assert.AreEqual("Error", result.ViewName); }
public void AlbumControllerDelete() { var albumController = new AlbumsController(null, null); var result = albumController.Delete(1); Assert.IsNotNull(result); }
public void DeleteActionReturnsHttpBadRequestWhenAlbumIsNull() { var result = _albumsController.Delete(null); Assert.IsNotNull(result); Assert.IsInstanceOfType(result, typeof(HttpStatusCodeResult)); Assert.AreEqual(400, ((HttpStatusCodeResult)result).StatusCode); }