public async Task PublisherSimplySendsWithoutQueueReturnsFailure() { IBunny bunny = Bunny.ConnectSingle(ConnectSimple.BasicAmqp); IPublish <TestMessage> publisher = bunny.Publisher <TestMessage>(Exchange); OperationResult <TestMessage> result = await publisher.SendAsync(new TestMessage()); Assert.True(result.IsSuccess); bunny.Dispose(); }
public async Task ForceCreatesTheExchangeIfNotExists() { IBunny bunny = Bunny.ConnectSingle(ConnectSimple.BasicAmqp); IPublish <TestMessage> publisher = bunny.Publisher <TestMessage>("test-exchange"); OperationResult <TestMessage> result = await publisher.SendAsync(new TestMessage(), force : true); Assert.True(result.IsSuccess); bool removed_exchange = await bunny.Setup().DeleteExchangeAsync("test-exchange", force: true); Assert.True(removed_exchange); bunny.Dispose(); }