public static ArgumentViewModel ToArgumentViewModel(Argument entity)
 {
     return(new ArgumentViewModel
     {
         Id = entity.Id,
         Order = entity.Order,
         Variable = VariableMapper.ToVariableViewModel(entity.Variable)
     });
 }
示例#2
0
 internal static ActionViewModel ToActionViewModel(ActionEntity entity)
 {
     return(new ActionViewModel
     {
         Id = entity.Id,
         Type = entity.Type,
         Order = entity.Order,
         Variable = VariableMapper.ToVariableViewModel(entity.Variable),
         Method = MethodMapper.ToMethodViewModel(entity.Method),
         Assert = AssertMapper.ToAssertViewModel(entity.Assert)
     });
 }
        public static AssertViewModel ToAssertViewModel(Assert entity)
        {
            if (entity == null)
            {
                return(null);
            }

            return(new AssertViewModel
            {
                Id = entity.Id,
                Type = entity.Type,
                ExceptionMessage = entity.ExceptionMessage,
                ValueVariable = VariableMapper.ToVariableViewModel(entity.ValueVariable),
                ExpectedVariable = VariableMapper.ToVariableViewModel(entity.ExpectedVariable),
                DeltaVariable = VariableMapper.ToVariableViewModel(entity.DeltaVariable)
            });
        }
        public static MethodViewModel ToMethodViewModel(Method entity)
        {
            if (entity == null)
            {
                return(null);
            }

            return(new MethodViewModel
            {
                Id = entity.Id,
                Name = entity.Name,
                TypeName = entity.TypeName,
                IsStatic = entity.IsStatic,
                IsConstructor = entity.IsConstructor,
                Variable = VariableMapper.ToVariableViewModel(entity.Variable),
                Arguments = entity.Arguments?
                            .Select(ArgumentMapper.ToArgumentViewModel)
                            .ToList()
            });
        }