src/Cassandra.Tests/Mapping/BatchTests.cs
/// <summary>
/// Gets the mapper for batch statements
/// </summary>
Gets the mapper for batch statements
Gets the mapper for batch statements
private IMapper GetMapper(Func<Task<RowSet>> getRowSetFunc, Action<BatchStatement> statementCallback = null)
        {
            if (statementCallback == null)
            {
                statementCallback = _ => { };
            }
            var sessionMock = new Mock<ISession>(MockBehavior.Strict);
            sessionMock.Setup(s => s.Keyspace).Returns<string>(null);
            sessionMock
                .Setup(s => s.ExecuteAsync(It.IsAny<BatchStatement>()))
                .Returns(getRowSetFunc)
                .Callback(statementCallback)
                .Verifiable();
            sessionMock
                .Setup(s => s.PrepareAsync(It.IsAny<string>()))
                .Returns(TaskHelper.ToTask(GetPrepared()))
                .Verifiable();
            return GetMappingClient(sessionMock);
        }
private IMapper GetMapper ( Func < Task < RowSet > > getRowSetFunc , Action < BatchStatement > statementCallback = null ) { if ( statementCallback == null ) { statementCallback = _ => { } ; } var sessionMock = new Mock < ISession > ( MockBehavior . Strict ) ; sessionMock . Setup ( s => s . Keyspace ) . Returns < string > ( null ) ; sessionMock . Setup ( s => s . ExecuteAsync ( It . IsAny < BatchStatement > ( ) ) ) . Returns ( getRowSetFunc ) . Callback ( statementCallback ) . Verifiable ( ) ; sessionMock . Setup ( s => s . PrepareAsync ( It . IsAny < string > ( ) ) ) . Returns ( TaskHelper . ToTask ( GetPrepared ( ) ) ) . Verifiable ( ) ; return GetMappingClient ( sessionMock ) ; }
Gets the mapper for batch statements
Gets the mapper for batch statements
getRowSetFunc
Func<Task<RowSet>>
statementCallback
Action<BatchStatement>