public void DataQueueTest() { var au = new AutoResetEvent(false); var i = new TestInterface(); var d = new DataQueue(i); d.Error += (a, b) => au.Set(); d.QueueEmpty += (a, b) => au.Set(); d.Run(); for (int x = 0; x < 100; x++) { var z = new TestPw(); d.EnqueData(z); au.WaitOne(); Assert.IsTrue(z.ModuleDataCheckOk); } }
public void DataSenderTest() { var au = new AutoResetEvent(false); ConnectionBase testInterface = new TestInterface(); for (int x = 0; x < 100; x++) { var testData = new TestPw(); var ds = new DataSender(testInterface, testData); ds.Start(); var error = ds.ErrorMessage; var succes = ds.SendComplete; Assert.IsTrue(succes); Assert.IsTrue(testData.ModuleDataCheckOk); } }