public PostDailyTaskResponse Any(PostDailyTask request)
 {
     return new PostDailyTaskResponse
     {
         TaskResponse = taskHandler.Create(request.DailyTaskRequest)
     };
 }
        public void PostDailyTask_NothingDefined_ReturnId1(
            [ValueSource("GetDifferentSaopClients")] ISyncReplyClient client)
        {
            var id = 1;
            var request = new PostDailyTask{DailyTaskRequest = TaskHelper.CreateDailyTaskRequest()};

            var response = client.PostDailyTask(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 PostGetDeleteGetDailyTask_Standard_TaskDoesNotExistAnymore(
            [ValueSource("GetDifferentSaopClients")] ISyncReplyClient client)
        {
            var id = 1;

            var postRequest = new PostDailyTask{DailyTaskRequest = TaskHelper.CreateDailyTaskRequest()};
            var resultId = client.PostDailyTask(postRequest);
            var getRequest = new GetDailyTask { Id = resultId.TaskResponse.Id };
            var result = client.GetDailyTask(getRequest);

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

            client.DeleteDailyTask(new DeleteDailyTask { Id = resultId.TaskResponse.Id });
            result = client.GetDailyTask(getRequest);

            Assert.That(result.ResponseStatus.ErrorCode, Is.EqualTo("ArgumentNullException"));
        }
        public void PostGetPutGetDailyTask_Standard_ReturnTwiceTheSameIdAndObject(
            [ValueSource("GetDifferentSaopClients")] ISyncReplyClient client)
        {
            var id = 1;

            var postRequest = new PostDailyTask{DailyTaskRequest = TaskHelper.CreateDailyTaskRequest()};
            var resultId = client.PostDailyTask(postRequest);
            var getRequest = new GetDailyTask { Id = resultId.TaskResponse.Id };
            var result = client.GetDailyTask(getRequest);

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

            var putRequest = new PutDailyTask{DailyTaskRequest = postRequest.DailyTaskRequest };
            putRequest.DailyTaskRequest.Id = resultId.TaskResponse.Id;
            putRequest.DailyTaskRequest.Name = "dummy";
            putRequest.DailyTaskRequest.Description = "hm..";
            putRequest.DailyTaskRequest.RecursEveryXDays = 987;
            var responsePut = client.PutDailyTask(putRequest);
            result = client.GetDailyTask(getRequest);

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