コード例 #1
0
        public void GetTimeSpanTooLarge()
        {
            var queueName = Guid.NewGuid().ToString();
            var queue     = new WindowsAzureQueue <User>(CloudStorageAccount.DevelopmentStorageAccount, queueName);

            queue.Get(12, new TimeSpan(7, 1, 1, 1));
        }
コード例 #2
0
        public void GetMessageCountInvalid()
        {
            var queueName = Guid.NewGuid().ToString();
            var queue     = new WindowsAzureQueue <User>(CloudStorageAccount.DevelopmentStorageAccount, queueName);

            queue.Get(0);
        }
コード例 #3
0
        public void GetTimeSpanZero()
        {
            var queueName = Guid.NewGuid().ToString();
            var queue     = new WindowsAzureQueue <User>(CloudStorageAccount.DevelopmentStorageAccount, queueName);

            queue.Get(12, TimeSpan.Zero);
        }
コード例 #4
0
        public void QueueNull()
        {
            var queueName = Guid.NewGuid().ToString();
            var queue     = new WindowsAzureQueue <User>(CloudStorageAccount.DevelopmentStorageAccount, queueName);

            queue.Queue(null);
        }
コード例 #5
0
        public void ApproximateMessageCountZero()
        {
            var queueName = Guid.NewGuid().ToString();
            var queue     = new WindowsAzureQueue <User>(CloudStorageAccount.DevelopmentStorageAccount, queueName);

            Assert.AreEqual <int>(0, queue.ApproximateMessageCount);
        }
コード例 #6
0
        public void RetrieveApproximateMessageCount()
        {
            var queueName = Guid.NewGuid().ToString();
            var queue     = new WindowsAzureQueue <User>(CloudStorageAccount.DevelopmentStorageAccount, queueName);
            var random    = new Random();
            var count     = random.Next(1, 100);

            for (int i = 0; i < count; i++)
            {
                queue.Queue(new User());
            }
            Assert.AreEqual <int>(count, queue.RetrieveApproximateMessageCount);
        }
コード例 #7
0
        public void Get()
        {
            var queueName = Guid.NewGuid().ToString();
            var queue     = new WindowsAzureQueue <User>(CloudStorageAccount.DevelopmentStorageAccount, queueName);
            var data      = new User()
            {
                Identifier = Guid.NewGuid(),
            };

            queue.Queue(data);
            var peek = queue.Get();

            Assert.AreEqual <Guid>(data.Identifier, peek.Identifier);
        }
コード例 #8
0
        public void GetMany()
        {
            var queueName = Guid.NewGuid().ToString();
            var queue     = new WindowsAzureQueue <User>(CloudStorageAccount.DevelopmentStorageAccount, queueName);
            var random    = new Random();
            var count     = random.Next(2, 32);

            for (int i = 0; i < count; i++)
            {
                queue.Queue(new User());
            }
            var subset = random.Next(1, count - 1);
            var many   = queue.Get(subset);

            Assert.AreEqual <int>(subset, many.Count());
        }
コード例 #9
0
 public void Constructor()
 {
     var queueName = Guid.NewGuid().ToString();
     var queue     = new WindowsAzureQueue <User>(CloudStorageAccount.DevelopmentStorageAccount, queueName);
 }