Exemple #1
0
        public string GetThingJson()
        {
            GetThingDTO thingDTO = GetThing();
            string      json     = thingDTO.GetObjectJson();

            return(json);
        }
Exemple #2
0
        private List <GetThingDTO> GetThingDTOs(int thingDTOsCount = 1, int subThingDTOsCount = 1)
        {
            var thingDTOs = new List <GetThingDTO>();

            for (int i = 0; i < thingDTOsCount; i++)
            {
                var thingDto = new GetThingDTO();
                thingDto.Id          = Guid.NewGuid();
                thingDto.Name        = $"Name #{i}";
                thingDto.Description = $"TO{new string('O', i)} MUCH LONG DESCRIPTION #{i}.";
                thingDto.Age         = NumberHelper.GetRandomNumber(100);
                thingDto.SubThings   = GetSubThingDTOs(subThingDTOsCount);

                thingDTOs.Add(thingDto);
            }

            return(thingDTOs);
        }
Exemple #3
0
        public static string GetObjectJson(this GetThingDTO thingDTO)
        {
            string jsonObject = JsonConvert.SerializeObject(thingDTO);

            return(jsonObject);
        }