public void Should_Create_New_Exercise() { //ARRANGE var exerciseSvc = new Mock <IExerciseService>(MockBehavior.Strict); var exercise = new Exercise(); exerciseSvc .Setup(x => x.Add(It.IsAny <Exercise>(), true)) .Returns((Exercise newExercise, bool save) => exercise); var sut = new ExerciseController(exerciseSvc.Object); SetupUser(sut); //ACT var response = sut.Post(exercise); //ASSERT Assert.IsNotNull(response); Assert.IsInstanceOfType(response.Result, typeof(OkObjectResult)); Assert.ReferenceEquals((response.Result as OkObjectResult).Value, exercise); }