public void Handle_CanModify_Test1()
        {
            //arrange
            var states      = CreateTestListStates();
            var inclination = new Inclination();

            inclination.SetStates(states);
            inclination.CanModify = false;

            var head = new Head(new List <IBodyPart>()
            {
                inclination
            });

            var robot = new Robot(new List <IBodyPartCollection>()
            {
                head
            });

            //act
            var request = new RequestPreviousStateOfBodyPartInteractor(robot);

            var requestMessage = new PreviousStateOfBodyPartRequestMessage(head.Id, inclination.Id);

            var responseTask = request.Handle(requestMessage, CancellationToken.None);

            responseTask.Wait();

            //assert
            Assert.NotNull(responseTask);
            Assert.NotNull(responseTask.Result);
            Assert.False(responseTask.Result.Success);
        }
        public JsonResult PreviousStateOfBodyPart([FromBody] ChangeStateViewModel changeState)
        {
            var robot   = Robot;
            var request = new RequestPreviousStateOfBodyPartInteractor(robot);

            var requestMessage = new PreviousStateOfBodyPartRequestMessage(changeState.BodyPartCollectionId, changeState.BodyPartId);

            var responseTask = request.Handle(requestMessage, CancellationToken.None);

            responseTask.Wait();
            Robot = robot;

            return(Json(responseTask.Result.Success));
        }