Exemple #1
0
        public void ExchangeDelete_ExchangeDoesNotExists_DoesNothing()
        {
            // Arrange
            var node = new RabbitServer();

            using (var model = new FakeModel(node))
            {
                const string exchangeName = "someExchange";
                model.ExchangeDeclare(exchangeName, "someType");

                // Act
                model.ExchangeDelete(exchange: "someOtherExchange");

                // Assert
                Assert.Single(node.Exchanges);
            }
        }
Exemple #2
0
        public void ExchangeDelete_ExchangeExists_RemovesTheExchange(bool ifUnused)
        {
            // Arrange
            var node = new RabbitServer();

            using (var model = new FakeModel(node))
            {
                const string exchangeName = "someExchange";
                model.ExchangeDeclare(exchangeName, "someType");

                // Act
                model.ExchangeDelete(exchange: exchangeName, ifUnused: ifUnused);

                // Assert
                Assert.Empty(node.Exchanges);
            }
        }