public void NoAnswerToCallTest() { var callEventArgs = new RingEventArgs(firstClient.Phone, secondClient.Phone); exchangeBilling.AbonentsConnectedEventHandler(null, callEventArgs); Task.Delay((int)callWaitingSpan.TotalMilliseconds - 6000).Wait(); exchangeBilling.AbonentsDisconnectedEventHandler(null, callEventArgs); Task.Delay(5000).Wait(); Assert.That(unitOfWork.Billing.Count == 1); Assert.That(unitOfWork.Billing.GetEntities(e => e.Checked).Count() == 1); Task.Delay(5000).Wait(); Assert.That(firstClient.Balance == 0); Assert.That(secondClient.Balance == 0); }
public void StandartCallHandlingTest() { var callEventArgs = new RingEventArgs(firstClient.Phone, secondClient.Phone); exchangeBilling.AbonentsConnectedEventHandler(null, callEventArgs); Task.Delay(20000).Wait(); exchangeBilling.AbonentsDisconnectedEventHandler(null, callEventArgs); Task.Delay(21000).Wait(); Assert.That(unitOfWork.Billing.Count > 0); Assert.That(unitOfWork.Billing.GetEntities(b => b.Checked).Count() > 0); Task.Delay(5000).Wait(); Assert.That(firstClient.Balance < 0); Task.Delay(3000).Wait(); Assert.That(secondClient.Balance == 0); }