public void DeleteNoId()
        {
            // act
            var result = (ViewResult)controller.Delete(null);

            // assert
            Assert.AreEqual("Error", result.ViewName);
        }
Esempio n. 2
0
        public void AlbumControllerDelete()
        {
            var albumController = new AlbumsController(null, null);

            var result = albumController.Delete(1);

            Assert.IsNotNull(result);
        }
Esempio n. 3
0
        public void DeleteActionReturnsHttpBadRequestWhenAlbumIsNull()
        {
            var result = _albumsController.Delete(null);

            Assert.IsNotNull(result);
            Assert.IsInstanceOfType(result, typeof(HttpStatusCodeResult));
            Assert.AreEqual(400, ((HttpStatusCodeResult)result).StatusCode);
        }