public void MainLoop() { var hostName = Dns.GetHostName(); _logManager.WriteMessage($"Grabbing hostname...{hostName}"); _queueManager.AddToQueue(QUEUE_TYPE.RECORD_HOST_INFORMATION, hostName); while (_queueManager.IsRunning()) { _queueManager.AddToQueue(QUEUE_TYPE.LISTEN_FOR_CHANGES); _queueManager.ProcessQueue(); Thread.Sleep(1000); } _logManager.FlushLog(); }
public void AddToQueueTestNullEntity() { int maxQueueLength = 10; ProductType pt = new ProductType("Test", 0.1, 0.1); List <ProductType> productTypes = new List <ProductType> { pt }; bool singleQueueLength = false; QueueManager target = new QueueManager(maxQueueLength, productTypes, singleQueueLength); Call entity = null; target.AddToQueue(entity); }
public void AddToQueueTestNoQueueForType() { int maxQueueLength = 10; ProductType pt = new ProductType("Test", 0.1, 0.1); List <ProductType> productTypes = new List <ProductType> { pt }; bool singleQueueLength = false; QueueManager target = new QueueManager(maxQueueLength, productTypes, singleQueueLength); Call entity = new Call((uint)1); entity.ProductType = new ProductType("Cheese", 0.1, 0.1); target.AddToQueue(entity); }
public void AddToQueueTest() { int maxQueueLength = 10; ProductType pt = new ProductType("Test", 0.1, 0.1); List <ProductType> productTypes = new List <ProductType> { pt }; bool singleQueueLength = false; QueueManager target = new QueueManager(maxQueueLength, productTypes, singleQueueLength); Call entity = new Call((uint)1); entity.ProductType = pt; target.AddToQueue(entity); Assert.AreEqual(1, target.GetQueueLength(pt)); }
public void IsQueueTooLongTestNoQueueFound() { int maxQueueLength = 10; ProductType pt = new ProductType("Test", 0.1, 0.1); List <ProductType> productTypes = new List <ProductType> { pt }; bool singleQueueLength = false; QueueManager target = new QueueManager(maxQueueLength, productTypes, singleQueueLength); ProductType productType = new ProductType("Dave", 0.1, 0.1); Call newCall = new Call((uint)1); newCall.ProductType = pt; target.AddToQueue(newCall); bool actual; actual = target.IsQueueTooLong(productType); }
public void GetQueueLengthTestNoQueueFound() { int maxQueueLength = 10; ProductType pt = new ProductType("Test", 0.1, 0.1); List <ProductType> productTypes = new List <ProductType> { pt }; bool singleQueueLength = false; QueueManager target = new QueueManager(maxQueueLength, productTypes, singleQueueLength); ProductType productType = new ProductType("Dave", 0.1, 0.1); target.AddToQueue(new Call((uint)1) { ProductType = pt }); int actual; actual = target.GetQueueLength(productType); }
public void GetCallForRepTypeTestNullRepType() { int maxQueueLength = 10; ProductType pt = new ProductType("Test", 0.1, 0.1); List <ProductType> productTypes = new List <ProductType> { pt }; bool singleQueueLength = false; QueueManager target = new QueueManager(maxQueueLength, productTypes, singleQueueLength); SalesRepType repType = null; Call newCall = new Call((uint)1); newCall.ProductType = pt; target.AddToQueue(newCall); Call expected = newCall; Call actual; actual = target.GetCallForRepType(repType); }
private void addToQueueButton_Click(object sender, EventArgs e) { bool result = queueManager.CheckJobs(this); if (!result) { if (!String.IsNullOrEmpty(queueManager.errorList)) { MessageBox.Show(queueManager.errorList, Properties.Resources.ErrorLabel, MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { queueManager.AddToQueue(this); if (MainForm.optionsData.showQueueWhenAdding) { ShowQueueForm(); } } }
public void IsQueueTooLongTestTrue() { int maxQueueLength = 0; ProductType pt = new ProductType("Test", 0.1, 0.1); List <ProductType> productTypes = new List <ProductType> { pt }; bool singleQueueLength = false; QueueManager target = new QueueManager(maxQueueLength, productTypes, singleQueueLength); ProductType productType = pt; Call newCall = new Call((uint)1); newCall.ProductType = pt; target.AddToQueue(newCall); bool expected = true; bool actual; actual = target.IsQueueTooLong(productType); Assert.AreEqual(expected, actual); }
public void GetQueueLengthTest() { int maxQueueLength = 10; ProductType pt = new ProductType("Test", 0.1, 0.1); List <ProductType> productTypes = new List <ProductType> { pt }; bool singleQueueLength = false; QueueManager target = new QueueManager(maxQueueLength, productTypes, singleQueueLength); ProductType productType = pt; target.AddToQueue(new Call((uint)1) { ProductType = pt }); int expected = 1; int actual; actual = target.GetQueueLength(productType); Assert.AreEqual(expected, actual); }