예제 #1
0
파일: WebQTests.cs 프로젝트: brigs/ConDep
 public void TestThatQueueTimesOutCorrectly()
 {
     const int startPosition = 5;
     var client = new WebQMockClient(startPosition);
     var queue = new WebQueue(client, "test", TimeSpan.FromMilliseconds(10));
     queue.WaitInQueue(TimeSpan.FromMilliseconds(1));
 }
예제 #2
0
파일: WebQTests.cs 프로젝트: brigs/ConDep
 public void TestThatTimeOutAlertsGetsCalled()
 {
     const int startPosition = 5;
     var client = new WebQMockClient(startPosition);
     var queue = new WebQueue(client, "test", TimeSpan.FromMilliseconds(10));
     queue.WebQueueTimeoutUpdate += (sender, args) => Assert.That(args.Message, Is.Not.Null.Or.Empty);
     queue.WaitInQueue(TimeSpan.FromMinutes(1));
 }
예제 #3
0
파일: WebQTests.cs 프로젝트: brigs/ConDep
        public void TestThatQueueTimesOutCorrectly()
        {
            const int startPosition = 5;
            var       client        = new WebQMockClient(startPosition);
            var       queue         = new WebQueue(client, "test", TimeSpan.FromMilliseconds(10));

            queue.WaitInQueue(TimeSpan.FromMilliseconds(1));
        }
예제 #4
0
파일: WebQTests.cs 프로젝트: brigs/ConDep
 public void TestThatQueueReturnsImmidiatlyWhenAddedToEmptyQueue()
 {
     const int startPosition = 0;
     var client = new WebQMockClient(startPosition);
     var queue = new WebQueue(client, "test", TimeSpan.FromMilliseconds(10));
     queue.WebQueuePositionUpdate += (sender, args) => Assert.That(args.Item.Position, Is.EqualTo(0));
     queue.WaitInQueue(TimeSpan.FromMilliseconds(1));
 }
예제 #5
0
파일: WebQTests.cs 프로젝트: brigs/ConDep
 public void TestThatQueueIsCorrectlyProcessed()
 {
     const int startPosition = 5;
     var currentPosition = startPosition;
     var client = new WebQMockClient(startPosition);
     var queue = new WebQueue(client, "test", TimeSpan.FromMilliseconds(10));
     queue.WebQueuePositionUpdate += (sender, args) => Assert.That(currentPosition--, Is.EqualTo(args.Item.Position));
     queue.WaitInQueue(TimeSpan.FromMinutes(1));
 }
예제 #6
0
파일: WebQTests.cs 프로젝트: brigs/ConDep
        public void TestThatTimeOutAlertsGetsCalled()
        {
            const int startPosition = 5;
            var       client        = new WebQMockClient(startPosition);
            var       queue         = new WebQueue(client, "test", TimeSpan.FromMilliseconds(10));

            queue.WebQueueTimeoutUpdate += (sender, args) => Assert.That(args.Message, Is.Not.Null.Or.Empty);
            queue.WaitInQueue(TimeSpan.FromMinutes(1));
        }
예제 #7
0
파일: WebQTests.cs 프로젝트: brigs/ConDep
        public void TestThatQueueReturnsImmidiatlyWhenAddedToEmptyQueue()
        {
            const int startPosition = 0;
            var       client        = new WebQMockClient(startPosition);
            var       queue         = new WebQueue(client, "test", TimeSpan.FromMilliseconds(10));

            queue.WebQueuePositionUpdate += (sender, args) => Assert.That(args.Item.Position, Is.EqualTo(0));
            queue.WaitInQueue(TimeSpan.FromMilliseconds(1));
        }
예제 #8
0
파일: WebQTests.cs 프로젝트: brigs/ConDep
        public void TestThatQueueIsCorrectlyProcessed()
        {
            const int startPosition   = 5;
            var       currentPosition = startPosition;
            var       client          = new WebQMockClient(startPosition);
            var       queue           = new WebQueue(client, "test", TimeSpan.FromMilliseconds(10));

            queue.WebQueuePositionUpdate += (sender, args) => Assert.That(currentPosition--, Is.EqualTo(args.Item.Position));
            queue.WaitInQueue(TimeSpan.FromMinutes(1));
        }
예제 #9
0
        public void TestThatQueueTimesOutCorrectly()
        {
            const int startPosition = 5;
            var       client        = new WebQMockClient(startPosition);
            var       queue         = new WebQueue(client, "test", TimeSpan.FromMilliseconds(10));

            Assert.Throws <TimeoutException>(() =>
            {
                queue.WaitInQueue(TimeSpan.FromMilliseconds(1));
            });
        }