Change SampleDeviceXXX to CoolingSampleDeviceXXX
This commit is contained in:
Родитель
1664b52d06
Коммит
a148a43420
|
@ -23,31 +23,31 @@ namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Factory
|
|||
private static readonly Random Rand = new Random();
|
||||
|
||||
private static readonly List<string> DefaultDeviceNames = new List<string>{
|
||||
"SampleDevice001",
|
||||
"SampleDevice002",
|
||||
"SampleDevice003",
|
||||
"SampleDevice004",
|
||||
"SampleDevice005",
|
||||
"SampleDevice006",
|
||||
"SampleDevice007",
|
||||
"SampleDevice008",
|
||||
"SampleDevice009",
|
||||
"SampleDevice010",
|
||||
"SampleDevice011",
|
||||
"SampleDevice012",
|
||||
"SampleDevice013",
|
||||
"SampleDevice014",
|
||||
"SampleDevice015",
|
||||
"SampleDevice016",
|
||||
"SampleDevice017",
|
||||
"SampleDevice018",
|
||||
"SampleDevice019",
|
||||
"SampleDevice020",
|
||||
"SampleDevice021",
|
||||
"SampleDevice022",
|
||||
"SampleDevice023",
|
||||
"SampleDevice024",
|
||||
"SampleDevice025"
|
||||
"CoolingSampleDevice001",
|
||||
"CoolingSampleDevice002",
|
||||
"CoolingSampleDevice003",
|
||||
"CoolingSampleDevice004",
|
||||
"CoolingSampleDevice005",
|
||||
"CoolingSampleDevice006",
|
||||
"CoolingSampleDevice007",
|
||||
"CoolingSampleDevice008",
|
||||
"CoolingSampleDevice009",
|
||||
"CoolingSampleDevice010",
|
||||
"CoolingSampleDevice011",
|
||||
"CoolingSampleDevice012",
|
||||
"CoolingSampleDevice013",
|
||||
"CoolingSampleDevice014",
|
||||
"CoolingSampleDevice015",
|
||||
"CoolingSampleDevice016",
|
||||
"CoolingSampleDevice017",
|
||||
"CoolingSampleDevice018",
|
||||
"CoolingSampleDevice019",
|
||||
"CoolingSampleDevice020",
|
||||
"CoolingSampleDevice021",
|
||||
"CoolingSampleDevice022",
|
||||
"CoolingSampleDevice023",
|
||||
"CoolingSampleDevice024",
|
||||
"CoolingSampleDevice025"
|
||||
};
|
||||
|
||||
private class Location
|
||||
|
|
|
@ -153,7 +153,7 @@ namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.DeviceAdmin.Web.
|
|||
while (true)
|
||||
{
|
||||
var random = BitConverter.ToUInt32(Guid.NewGuid().ToByteArray(), 0);
|
||||
string deviceId = $"SampleDevice_{random % 10000:d4}";
|
||||
string deviceId = $"CoolingSampleDevice_{random % 10000:d4}";
|
||||
|
||||
if (!await GetDeviceExistsAsync(deviceId))
|
||||
{
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.UnitTests.Infras
|
|||
public void GetSQLQueryTest()
|
||||
{
|
||||
string sql = BuildFilter().GetSQLQuery();
|
||||
Assert.Equal(sql, "SELECT * FROM devices WHERE tags.x = 'one' AND properties.desired.y < '1' AND properties.reported.z > '1' AND tags.u != 'two' AND properties.desired.v <= '2' AND properties.reported.w >= '2' AND deviceId IN ['SampleDevice001', 'SampleDevice002', 'SampleDevice003']");
|
||||
Assert.Equal(sql, "SELECT * FROM devices WHERE tags.x = 'one' AND properties.desired.y < '1' AND properties.reported.z > '1' AND tags.u != 'two' AND properties.desired.v <= '2' AND properties.reported.w >= '2' AND deviceId IN ['CoolingSampleDevice001', 'CoolingSampleDevice002', 'CoolingSampleDevice003']");
|
||||
|
||||
sql = BuildEmptyFilter().GetSQLQuery();
|
||||
Assert.Equal(sql, "SELECT * FROM devices");
|
||||
|
@ -30,7 +30,7 @@ namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.UnitTests.Infras
|
|||
public void GetSQLCondition()
|
||||
{
|
||||
string condition = BuildFilter().GetSQLCondition();
|
||||
Assert.Equal(condition, "tags.x = 'one' AND properties.desired.y < '1' AND properties.reported.z > '1' AND tags.u != 'two' AND properties.desired.v <= '2' AND properties.reported.w >= '2' AND deviceId IN ['SampleDevice001', 'SampleDevice002', 'SampleDevice003']");
|
||||
Assert.Equal(condition, "tags.x = 'one' AND properties.desired.y < '1' AND properties.reported.z > '1' AND tags.u != 'two' AND properties.desired.v <= '2' AND properties.reported.w >= '2' AND deviceId IN ['CoolingSampleDevice001', 'CoolingSampleDevice002', 'CoolingSampleDevice003']");
|
||||
|
||||
condition = BuildEmptyFilter().GetSQLCondition();
|
||||
Assert.Equal(condition, string.Empty);
|
||||
|
@ -97,7 +97,7 @@ namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.UnitTests.Infras
|
|||
{
|
||||
ColumnName = "deviceId",
|
||||
ClauseType = ClauseType.IN,
|
||||
ClauseValue = "['SampleDevice001', 'SampleDevice002', 'SampleDevice003']"
|
||||
ClauseValue = "['CoolingSampleDevice001', 'CoolingSampleDevice002', 'CoolingSampleDevice003']"
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче