示例#1
0
        // No Serial
        public void NoSerial()
        {
            DeviceSetting dSetting3 = new DeviceSetting(testServer, null);

            Test NoSerial = new Test(dSetting3);

            NoSerial.setTestName("NoSerial");


            List <Test> tests = new List <Test>();

            tests.Add(NoSerial);

            AsyncContext.Run(async() => await Program.buildTests(tests));

            foreach (Test nextTest in Program.getTests())
            {
                Assert.AreEqual(nextTest.getExpectedResult(), nextTest.getActualResult());
            }
        }
        public void NoSerial()
        {
            DeviceSetting dSetting3 = new DeviceSetting(TestGlobals.testServer, null);

            Test deviceSetting = new Test(dSetting3);
            deviceSetting.setTestName("NoSerial");
            deviceSetting.setExpectedResult ("400");

            results.WriteLine (DateTime.Now);
            results.WriteLine ("current test: " + deviceSetting.ToString () + " " + deviceSetting.getTestName ());

            AsyncContext.Run(async () => await new HTTPSCalls().runTest(deviceSetting, HTTPOperation.GET));
            string statusCode = HTTPSCalls.result.Key.Property("StatusCode").Value.ToString();

            results.WriteLine ("Server: " + TestGlobals.testServer);
            results.WriteLine ("Expected result: " + deviceSetting.getActualResult());
            results.WriteLine ("Actual result: " + statusCode);
            results.WriteLine ("Test result: " + deviceSetting.result ());
            results.WriteLine ();

            Assert.AreEqual("400", statusCode);
        }