public Device Build() { return(new Device( identifier: GetPropertyValue(nameof(Device.Identifier), RandomDataGenerator.AlphaString(12)), type: GetPropertyValue(nameof(Device.Type), RandomDataGenerator.AlphaString(8)), otaKey: GetPropertyValue(nameof(Device.OtaKey), RandomDataGenerator.AccessToken()))); }
private static IEnumerable <Device> GenerateDevices(int count = 0) { if (count == 0) { count = RandomDataGenerator.Integer(3, 5); } var deviceBuilder = new DeviceBuilder(); var devices = new List <Device>(); for (int i = 0; i < count; i++) { devices.Add(deviceBuilder.Build()); } return(devices); }
public DeviceServiceSettings Build() { return(new DeviceServiceSettings( baseUrl: GetPropertyValue(nameof(DeviceServiceSettings.BaseUrl), RandomDataGenerator.BaseUrl()), accessToken: GetPropertyValue(nameof(DeviceServiceSettings.AccessToken), RandomDataGenerator.AccessToken()), httpProxyUrl: GetPropertyValue(nameof(DeviceServiceSettings.HttpProxyUrl), RandomDataGenerator.Url(subdomain: "proxy")), devices: GetPropertyValue(nameof(DeviceServiceSettings.Devices), GenerateDevices()))); }
public static string Url(string subdomain = default) { var localSubdomain = subdomain ?? "www"; return($"http://{localSubdomain}.{RandomDataGenerator.AlphaString(10)}.com"); }