public void GetTimetableByMovie_InternalServerError_Test() { var theaterServiceMock = new Mock <ITheaterService>(); string title = ""; string movieTheater = ""; theaterServiceMock.Setup(x => x.GetTimetableByMovie(movieTheater, title)).Throws <Exception>(); var controller = new TheaterController(theaterServiceMock.Object); var actualResult = controller.GetTimetableByMovie(movieTheater, title); var result = (ObjectResult)actualResult; var asJson = JsonConvert.SerializeObject(result.Value); var deserialized = JsonConvert.DeserializeObject <Dictionary <string, object> >(asJson); Assert.IsTrue((bool)deserialized["Success"] == false); theaterServiceMock.VerifyAll(); }