Example #1
0
        public AFRangeItem ToEntity()
        {
            AFRangeItem rangeAsEntity = new AFRangeItem()
            {
                Id = this.Id,
                AdditionalField = new AdditionalField()
                {
                    Id = this.AdditionalFieldId
                },
                Value = this.Value
            };

            return(rangeAsEntity);
        }
        public AdditionalField ToEntity()
        {
            AdditionalField afAsEntity = new AdditionalField()
            {
                Id        = this.Id,
                Name      = this.Name,
                FieldType = this.FieldType,
                Range     = new List <AFRangeItem>()
            };

            if (this.RangeDTOs != null)
            {
                foreach (RangeDTO rangeDTO in this.RangeDTOs)
                {
                    AFRangeItem rangeEntity = rangeDTO.ToEntity();
                    rangeEntity.AdditionalField = afAsEntity;
                    afAsEntity.Range.Add(rangeEntity);
                }
            }
            return(afAsEntity);
        }
        public void GetRange_InexistentRange_ShouldReturnNull()
        {
            AFRangeItem rangeById = rangeRepositoryInMemory.Get(oneRangeAddField.Id);

            Assert.IsNull(rangeById);
        }
Example #4
0
 public RangeDTO(AFRangeItem range)
 {
     Id = range.Id;
     AdditionalFieldId = range.AdditionalField.Id;
     Value             = range.Value;
 }