Ejemplo n.º 1
0
        public async Task DisposeClosesTheClient()
        {
            var client = new AmqpClient("my.eventhub.com", "somePath", Mock.Of <TokenCredential>(), new EventHubConnectionOptions());

            Assert.That(client.Closed, Is.False, "The client should not be closed on creation");

            await client.DisposeAsync();

            Assert.That(client.Closed, Is.True, "The client should be closed after disposal");
        }
        public async Task DisposeClosesTheClient()
        {
            var credential = new Mock <EventHubTokenCredential>(Mock.Of <TokenCredential>(), "{namespace}.servicebus.windows.net");
            var client     = new AmqpClient("my.eventhub.com", "somePath", credential.Object, new EventHubConnectionOptions());

            Assert.That(client.IsClosed, Is.False, "The client should not be closed on creation");

            await client.DisposeAsync();

            Assert.That(client.IsClosed, Is.True, "The client should be closed after disposal");
        }