public virtual ApiMachineServerRequestModel MapServerResponseToRequest(
            ApiMachineServerResponseModel response)
        {
            var request = new ApiMachineServerRequestModel();

            request.SetProperties(
                response.Description,
                response.JwtKey,
                response.LastIpAddress,
                response.MachineGuid,
                response.Name);
            return(request);
        }
Ejemplo n.º 2
0
        public void MapModelToEntity()
        {
            var mapper = new DALMachineMapper();
            ApiMachineServerRequestModel model = new ApiMachineServerRequestModel();

            model.SetProperties("A", "A", "A", Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"), "A");
            Machine response = mapper.MapModelToEntity(1, model);

            response.Description.Should().Be("A");
            response.JwtKey.Should().Be("A");
            response.LastIpAddress.Should().Be("A");
            response.MachineGuid.Should().Be(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"));
            response.Name.Should().Be("A");
        }