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); }
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); }
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); }
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(); }
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(); }
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(); }
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(); }
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(); }