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);
        }
コード例 #3
0
 public GetDailyTaskResponse Any(GetDailyTask request)
 {
     var req = new DailyTaskRequest { Id = request.Id };
     var result = taskHandler.Get(req);
     return new GetDailyTaskResponse { DailyTaskRequest = result };
 }