Esempio n. 1
0
        public void CreateWorkoutExcercise_ShouldReturnWorkoutExcercises()
        {
            //Arrange
            Workout_Excercise WorkoutExcerciseDataMock = new Workout_Excercise
            {
                Workout_DateTime           = DateTime.Now,
                Program_Version_Id         = 1,
                Excercise_Id               = 1,
                Weight                     = 100,
                Set_Number                 = 10000,
                Rep_Number                 = 5,
                Workout_Excercise_Note     = "Controller Unit Test",
                Workout_Excercise_DateTime = DateTime.Now
            };

            //WorkoutExcerciseRepoMock.Setup(repo => repo.CreateWorkout()).Returns(Task.Void);

            //act

            var result = WorkoutController.CreateWorkoutExcercise(WorkoutExcerciseDataMock);

            //asert
            var IsOfTypeWorkoutExcercise = Assert.IsType <ActionResult <Workout_Excercise> >(result);

            result.Should().NotBeNull();
            var okResult         = result.Should().BeOfType <ActionResult <Workout_Excercise> >().Subject;//fluent assertion version
            var WorkoutExcercise = okResult.Value.Should().BeAssignableTo <Workout_Excercise>().Subject;

            WorkoutExcercise.Program_Version_Id.Should().Be(1);
        }