Exemplo n.º 1
0
        public void Lifecycle_DoubleDispose()
        {
            var disposed = false;

            var session = new RSession(0, _brokerClient, () => disposed = true);

            session.Dispose();

            disposed = false;
            session.MonitorEvents();
            session.Dispose();

            session.ShouldNotRaise("Disposed");
            disposed.Should().BeFalse();
        }
Exemplo n.º 2
0
        public void Lifecycle_DoubleDispose()
        {
            var disposed = false;

            var session = new RSession(0, _testMethod.FileSystemSafeName, _brokerClient, new AsyncReaderWriterLock().CreateExclusiveReaderLock(), () => disposed = true);

            session.Dispose();

            disposed = false;
            session.MonitorEvents();
            session.Dispose();

            session.ShouldNotRaise("Disposed");
            disposed.Should().BeFalse();
        }
Exemplo n.º 3
0
        public void Lifecycle()
        {
            var disposed = false;

            var session = new RSession(0, null, () => disposed = true);

            disposed.Should().BeFalse();

            session.MonitorEvents();

            session.Dispose();
            session.ShouldRaise("Disposed");
            disposed.Should().BeTrue();

            disposed = false;
            session.MonitorEvents();

            session.Dispose();
            session.ShouldNotRaise("Disposed");
            disposed.Should().BeFalse();
        }