Beispiel #1
0
        public void Test_ServiceBusConnector_ServiceDispose()
        {
            // Assert
            var messenger = new ServiceBusMessenger(new ConnectionConfig {
                ConnectionString = "test.test"
            });
            var connector = new ServiceBusConnector <object>(new ServiceBusManager("", new ConnectionConfig()), new Subject <object>(), null);

            // Act - call dispose.
            messenger.Dispose();
            connector.Dispose();

            // Called a second time to test branch.
            messenger.Dispose();
            connector.Dispose();

            // Assert - disposed as expected.
            messenger.Disposed.Should().BeTrue();
            connector.Disposed.Should().BeTrue();
        }