// Mixed of Valid and Invalid Scans public void ValInvalScansSimDyn() { DeviceScanJSON testJson = new DeviceScanJSON(); testJson.i = validSerial; testJson.d = null; string[] scanData = new string[4]; scanData [0] = "~20/0|"; scanData [1] = "123456789"; scanData [2] = "~20/noendingbar"; scanData [3] = "qwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnm";; testJson.b = scanData; testJson.s = 4; DeviceScan testDScan = new DeviceScan(testServer, testJson); Test scanTest = new Test(testDScan); scanTest.setTestName("ValInvalScansSimDyn"); List <Test> tests = new List <Test> (); tests.Add(scanTest); AsyncContext.Run(async() => await Program.buildTests(tests)); foreach (Test nextTest in Program.getTests()) { Assert.AreEqual(nextTest.getExpectedResult(), nextTest.getActualResult()); } }
// List of Valid Scans public void LOValidScansDyn() { DeviceScanJSON testJson = new DeviceScanJSON(); testJson.i = validSerial; testJson.d = null; string[] scanData = new string[4]; scanData[0] = "~20/0|"; scanData[1] = "~20/1|"; scanData[2] = "~20/2|"; scanData[3] = "~20/3|"; testJson.b = scanData; testJson.s = 4; DeviceScan testDScan = new DeviceScan(testServer, testJson); Test scanTest = new Test(testDScan); scanTest.setTestName("LOValidScansDyn"); List <Test> tests = new List <Test> (); tests.Add(scanTest); AsyncContext.Run(async() => await Program.buildTests(tests)); foreach (Test nextTest in Program.getTests()) { Assert.AreEqual(nextTest.getExpectedResult(), nextTest.getActualResult()); } }
// No Serial (Null) public void NullSerialDyn() { DeviceScanJSON testJson = new DeviceScanJSON(); testJson.i = null; testJson.d = "~20/90210|"; testJson.b = null; testJson.s = 4; DeviceScan testDScan = new DeviceScan(testServer, testJson); Test scanTest = new Test(testDScan); scanTest.setTestName("NullSerialDyn"); List <Test> tests = new List <Test> (); tests.Add(scanTest); AsyncContext.Run(async() => await Program.buildTests(tests)); foreach (Test nextTest in Program.getTests()) { Assert.AreEqual(nextTest.getExpectedResult(), nextTest.getActualResult()); } }
// Bad Serial public void InvalidSerialSimple() { DeviceScanJSON testJson = new DeviceScanJSON(); testJson.i = "BAD SERIAL"; testJson.d = "1289472198573"; testJson.b = null; testJson.s = 4; DeviceScan testDScan = new DeviceScan(testServer, testJson); Test scanTest = new Test(testDScan); scanTest.setTestName("InvalidSerialSimple"); List <Test> tests = new List <Test>(); tests.Add(scanTest); AsyncContext.Run(async() => await Program.buildTests(tests)); foreach (Test nextTest in Program.getTests()) { Assert.AreEqual(nextTest.getExpectedResult(), nextTest.getActualResult()); } }
// Invalid Single Scan public void InvalidSingleScanSimple() { //TODO: Given when then comments // var getThing = appconfig.get(invalidScanData); DeviceScanJSON testJson = new DeviceScanJSON(); testJson.i = validSerial; testJson.d = "qwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnm"; testJson.b = null; testJson.s = 4; DeviceScan testDScan = new DeviceScan(testServer, testJson); Test scanTest = new Test(testDScan); scanTest.setTestName("InvalidSingleScanSimple"); List <Test> tests = new List <Test>(); tests.Add(scanTest); AsyncContext.Run(async() => await Program.buildTests(tests)); foreach (Test nextTest in Program.getTests()) { Assert.AreEqual(nextTest.getExpectedResult(), nextTest.getActualResult()); } }
public DeviceScan(Uri server, DeviceScanJSON scan) { opHost = server; hOp = HTTPOperation.POST; json = scan; }