Exemple #1
0
        public void MapResponseToRequest()
        {
            var mapper = new ApiServerTaskModelMapper();
            var model  = new ApiServerTaskResponseModel();

            model.SetProperties("A", DateTimeOffset.Parse("1/1/1987 12:00:00 AM"), "A", "A", 1, "A", "A", true, true, "A", "A", "A", DateTimeOffset.Parse("1/1/1987 12:00:00 AM"), "A", DateTimeOffset.Parse("1/1/1987 12:00:00 AM"), "A", "A");
            ApiServerTaskRequestModel response = mapper.MapResponseToRequest(model);

            response.CompletedTime.Should().Be(DateTimeOffset.Parse("1/1/1987 12:00:00 AM"));
            response.ConcurrencyTag.Should().Be("A");
            response.Description.Should().Be("A");
            response.DurationSeconds.Should().Be(1);
            response.EnvironmentId.Should().Be("A");
            response.ErrorMessage.Should().Be("A");
            response.HasPendingInterruptions.Should().Be(true);
            response.HasWarningsOrErrors.Should().Be(true);
            response.JSON.Should().Be("A");
            response.Name.Should().Be("A");
            response.ProjectId.Should().Be("A");
            response.QueueTime.Should().Be(DateTimeOffset.Parse("1/1/1987 12:00:00 AM"));
            response.ServerNodeId.Should().Be("A");
            response.StartTime.Should().Be(DateTimeOffset.Parse("1/1/1987 12:00:00 AM"));
            response.State.Should().Be("A");
            response.TenantId.Should().Be("A");
        }
Exemple #2
0
        public virtual ApiServerTaskResponseModel MapBOToModel(
            BOServerTask boServerTask)
        {
            var model = new ApiServerTaskResponseModel();

            model.SetProperties(boServerTask.Id, boServerTask.CompletedTime, boServerTask.ConcurrencyTag, boServerTask.Description, boServerTask.DurationSeconds, boServerTask.EnvironmentId, boServerTask.ErrorMessage, boServerTask.HasPendingInterruptions, boServerTask.HasWarningsOrErrors, boServerTask.JSON, boServerTask.Name, boServerTask.ProjectId, boServerTask.QueueTime, boServerTask.ServerNodeId, boServerTask.StartTime, boServerTask.State, boServerTask.TenantId);

            return(model);
        }