예제 #1
0
        public virtual ApiLinkResponseModel MapBOToModel(
            BOLink boLink)
        {
            var model = new ApiLinkResponseModel();

            model.SetProperties(boLink.Id, boLink.AssignedMachineId, boLink.ChainId, boLink.DateCompleted, boLink.DateStarted, boLink.DynamicParameters, boLink.ExternalId, boLink.LinkStatusId, boLink.Name, boLink.Order, boLink.Response, boLink.StaticParameters, boLink.TimeoutInSeconds);

            return(model);
        }
예제 #2
0
        public void MapResponseToRequest()
        {
            var mapper = new ApiLinkModelMapper();
            var model  = new ApiLinkResponseModel();

            model.SetProperties(1, 1, 1, DateTime.Parse("1/1/1987 12:00:00 AM"), DateTime.Parse("1/1/1987 12:00:00 AM"), "A", Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"), 1, "A", 1, "A", "A", 1);
            ApiLinkRequestModel response = mapper.MapResponseToRequest(model);

            response.AssignedMachineId.Should().Be(1);
            response.ChainId.Should().Be(1);
            response.DateCompleted.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.DateStarted.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.DynamicParameters.Should().Be("A");
            response.ExternalId.Should().Be(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"));
            response.LinkStatusId.Should().Be(1);
            response.Name.Should().Be("A");
            response.Order.Should().Be(1);
            response.Response.Should().Be("A");
            response.StaticParameters.Should().Be("A");
            response.TimeoutInSeconds.Should().Be(1);
        }