public PostWeeklyTaskResponse Any(PostWeeklyTask request)
 {
     return new PostWeeklyTaskResponse
     {
         TaskResponse = taskHandler.Create(request.WeeklyTaskRequest)
     };
 }
        public void PostGetDeleteGetWeeklyTask_Standard_TaskDoesNotExistAnymore(
            [ValueSource("GetDifferentSaopClients")] ISyncReplyClient client)
        {
            var id = 1;

            var postRequest =new PostWeeklyTask{WeeklyTaskRequest=TaskHelper.CreateWeaklyTaskRequest()};
            var resultId = client.PostWeeklyTask(postRequest);
            var getRequest = new GetWeeklyTask { Id = resultId.TaskResponse.Id };
            var result = client.GetWeeklyTask(getRequest);

            Assert.That(resultId.TaskResponse.Id, Is.EqualTo(id));
            AssertSame.WeeklyTaskRequest(result.WeeklyTaskRequest, postRequest.WeeklyTaskRequest);

            client.DeleteWeeklyTask(new DeleteWeeklyTask { Id = resultId.TaskResponse.Id });
            result = client.GetWeeklyTask(getRequest);

            Assert.That(result.ResponseStatus.ErrorCode, Is.EqualTo("ArgumentNullException"));
        }
        public void PostWeeklyTask_NothingDefined_ReturnId1(
            [ValueSource("GetDifferentSaopClients")] ISyncReplyClient client)
        {
            var id = 1;
            var request = new PostWeeklyTask{WeeklyTaskRequest = TaskHelper.CreateWeaklyTaskRequest()};

            var response = client.PostWeeklyTask(request);

            Assert.That(response.ResponseStatus.ErrorCode, Is.Null);
            Assert.That(response.ResponseStatus.Message, Is.Null);
            Assert.That(response.TaskResponse.Id, Is.EqualTo(id));
        }
        public void PostGetPutGetWeeklyTask_Standard_ReturnTwiceTheSameIdAndObject(
            [ValueSource("GetDifferentSaopClients")] ISyncReplyClient client)
        {
            var id = 1;

            var postRequest = new PostWeeklyTask{WeeklyTaskRequest = TaskHelper.CreateWeaklyTaskRequest()};
            var resultId = client.PostWeeklyTask(postRequest);
            var getRequest = new GetWeeklyTask { Id = resultId.TaskResponse.Id };
            var result = client.GetWeeklyTask(getRequest);

            Assert.That(resultId.TaskResponse.Id, Is.EqualTo(id));
            AssertSame.WeeklyTaskRequest(result.WeeklyTaskRequest, postRequest.WeeklyTaskRequest);

            var putRequest = new PutWeeklyTask{WeeklyTaskRequest = postRequest.WeeklyTaskRequest};
            putRequest.WeeklyTaskRequest.Id = resultId.TaskResponse.Id;
            putRequest.WeeklyTaskRequest.Name = "dummy";
            putRequest.WeeklyTaskRequest.Description = "hm..";
            putRequest.WeeklyTaskRequest.RecursEveryXWeeks = 784;
            var responsePut = client.PutWeeklyTask(putRequest);
            result = client.GetWeeklyTask(getRequest);

            Assert.That(resultId.TaskResponse.Id, Is.EqualTo(id));
            AssertSame.WeeklyTaskRequest(result.WeeklyTaskRequest, putRequest.WeeklyTaskRequest);
        }