public void constructor_should_initialize_instance() { var serverSession = Mock.Of <ICoreServerSession>(); var options = new CoreSessionOptions(); var result = new CoreSession(serverSession, options); result.Options.Should().BeSameAs(options); result.ServerSession.Should().BeSameAs(serverSession); result._disposed().Should().BeFalse(); }
public void constructor_should_initialize_instance() { var cluster = Mock.Of <ICluster>(); var serverSession = Mock.Of <ICoreServerSession>(); var options = new CoreSessionOptions(); var result = new CoreSession(cluster, serverSession, options); result.Cluster.Should().BeSameAs(cluster); result.CurrentTransaction.Should().BeNull(); result.IsInTransaction.Should().BeFalse(); result.Options.Should().BeSameAs(options); result.ServerSession.Should().BeSameAs(serverSession); result._disposed().Should().BeFalse(); }
public void constructor_should_initialize_instance() { var cluster = Mock.Of <ICluster>(); var serverSession = Mock.Of <ICoreServerSession>(); var options = new CoreSessionOptions(); #pragma warning disable CS0618 // Type or member is obsolete var result = new CoreSession(cluster, serverSession, options); #pragma warning restore CS0618 // Type or member is obsolete result.Cluster.Should().BeSameAs(cluster); result.CurrentTransaction.Should().BeNull(); result.IsInTransaction.Should().BeFalse(); result.Options.Should().BeSameAs(options); result.ServerSession.Should().BeSameAs(serverSession); result._disposed().Should().BeFalse(); result._isCommitTransactionInProgress().Should().BeFalse(); }
public static void EnsureTransactionsAreSupported(this CoreSession obj) => Reflector.Invoke(obj, nameof(EnsureTransactionsAreSupported));
public static void _isCommitTransactionInProgress(this CoreSession obj, bool value) { Reflector.SetFieldValue(obj, nameof(_isCommitTransactionInProgress), value); }
public static bool _isCommitTransactionInProgress(this CoreSession obj) => (bool)Reflector.GetFieldValue(obj, nameof(_isCommitTransactionInProgress));
public static bool _disposed(this CoreSession obj) => (bool)Reflector.GetFieldValue(obj, nameof(_disposed));
public static bool _disposed(this CoreSession obj) { var fieldInfo = typeof(CoreSession).GetField("_disposed", BindingFlags.NonPublic | BindingFlags.Instance); return((bool)fieldInfo.GetValue(obj)); }