public DeviceServiceSettings Build()
 {
     return(new DeviceServiceSettings(
                baseUrl: _propertiesToBuild.TryGetValue(nameof(DeviceServiceSettings.BaseUrl), out var baseUrl) ? (string)baseUrl : RandomDataGenerator.BaseUrl(),
                accessToken: RandomDataGenerator.AccessToken(),
                httpProxyUrl: RandomDataGenerator.Url("proxy"),
                devices: GenerateDevices()));
 }
        private IEnumerable <Device> GenerateDevices(int count = 0)
        {
            if (count == 0)
            {
                count = RandomDataGenerator.Integer(3, 5);
            }

            var devices = new List <Device>();

            for (int i = 0; i < count; i++)
            {
                devices.Add(new Device(
                                identifier: RandomDataGenerator.AlphaString(12),
                                type: RandomDataGenerator.AlphaString(8),
                                otaKey: RandomDataGenerator.AccessToken()));
            }

            return(devices);
        }
        public static string Url(string subdomain = default)
        {
            var localSubdomain = subdomain ?? "www";

            return($"http://{localSubdomain}.{RandomDataGenerator.AlphaString(10)}.com");
        }