Ejemplo n.º 1
0
        public void constructor_should_initialize_instance()
        {
            var wrapped = new Mock <ICoreSession>().Object;

            var result = new ReferenceCountedCoreSession(wrapped);

            result.Wrapped.Should().BeSameAs(wrapped);
            result.IsDisposed().Should().BeFalse();
            result._ownsWrapped().Should().BeTrue();
            result._referenceCount().Should().Be(1);
        }
        public void constructor_with_reference_counted_should_intialize_instance()
        {
            var session          = new Mock <ICoreSession>().Object;
            var referenceCounted = new ReferenceCountedCoreSession(session);

            var result = new CoreSessionHandle(referenceCounted);

            result._ownsWrapped().Should().BeFalse();
            result.Wrapped.Should().BeSameAs(referenceCounted);
            referenceCounted._referenceCount().Should().Be(1);
        }