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); }
public static void Dispose(this CoreSessionHandle obj, bool disposing) { var methodInfo = typeof(CoreSessionHandle).GetMethod("Dispose", BindingFlags.NonPublic | BindingFlags.Instance); methodInfo.Invoke(obj, new object[] { disposing }); }