Beispiel #1
0
        public async Task Delete()
        {
            var storage = new StorageQueue(QueueName, ConnectionString);

            var msg = new CloudQueueMessage(Guid.NewGuid().ToByteArray());
            await storage.Send(msg);

            var returned = await storage.Get();

            await storage.Delete(returned);
        }
Beispiel #2
0
        public async Task RoundTripMsgAsObj()
        {
            var storage = new StorageQueue(QueueName, ConnectionString);

            var msg = new CloudQueueMessage(Guid.NewGuid().ToByteArray());
            await storage.Send((object)msg);

            var returned = await storage.Get();

            Assert.AreEqual(msg.AsBytes, returned.AsBytes);
        }
Beispiel #3
0
        public async Task RoundTripObject()
        {
            var storage  = new StorageQueue(QueueName, ConnectionString);
            var expected = Guid.NewGuid();
            await storage.Send(expected);

            var returned = await storage.Get();

            var guid = JsonConvert.DeserializeObject <Guid>(returned.AsString);

            Assert.AreEqual(expected, guid);
        }
Beispiel #4
0
        public async Task RoundTripMsgAsObj()
        {
            StorageQueue storage = await QueueSetup();

            var msg = new CloudQueueMessage(Guid.NewGuid().ToByteArray());
            await storage.Send((object)msg);

            var returned = await storage.Get();

            Assert.AreEqual(msg.AsBytes, returned.AsBytes);
            await storage.Delete();
        }
Beispiel #5
0
        public async Task Delete()
        {
            StorageQueue storage = await QueueSetup();

            var msg = new CloudQueueMessage(Guid.NewGuid().ToByteArray());
            await storage.Send(msg);

            var returned = await storage.Get();

            await storage.Delete(returned);

            await storage.Delete();
        }
Beispiel #6
0
        public async Task RoundTripObject()
        {
            StorageQueue storage = await QueueSetup();

            var expected = Guid.NewGuid();
            await storage.Send(expected);

            var returned = await storage.Get();

            var guid = JsonConvert.DeserializeObject <Guid>(returned.AsString);

            Assert.AreEqual(expected, guid);
            await storage.Delete();
        }
Beispiel #7
0
        public async Task Peek()
        {
            StorageQueue storage = await QueueSetup();

            var msg = new CloudQueueMessage(Guid.NewGuid().ToByteArray());
            await storage.Send(msg);

            var peeked = await storage.PeekAsync();

            Assert.AreEqual(msg.AsBytes, peeked.First().AsBytes);

            var returned = await storage.Get();

            Assert.AreEqual(msg.AsBytes, returned.AsBytes);
            await storage.Delete();
        }
Beispiel #8
0
        public async Task RoundTripObject()
        {
            StorageQueue storage = await QueueSetup();

            var expected = new TestCustomObject {
                FooInt = 42, FooString = "The Answer"
            };
            await storage.SendAsync <TestCustomObject>(expected);

            var returned = await storage.Get();

            var deserialized = JsonConvert.DeserializeObject <TestCustomObject>(returned.AsString);

            Assert.AreEqual(expected.FooString, deserialized.FooString);
            Assert.AreEqual(expected.FooInt, deserialized.FooInt);
            await storage.Delete();
        }