public void EnumeratorCurrentReturnsExpectedResultWhenStarted(
            IEnumerator sut, SqlNonQueryCommand[] expected)
        {
            sut.MoveNext();

            var result = ((SqlProjectionHandler)sut.Current).Handler(null);

            Assert.That(result, Is.EqualTo(expected));
        }
Esempio n. 2
0
        public async void ProjectAsyncMessagesCausesExecutorToBeCalledWithExpectedCommands(
            SqlProjectionHandlerResolver resolver,
            object[] messages,
            SqlNonQueryCommand[] commands)
        {
            var mock = new ExecutorMock();
            var sut = SutFactory(resolver, mock);

            var result = await sut.ProjectAsync(messages);

            Assert.That(result, Is.EqualTo(commands.Length));
            Assert.That(mock.Commands, Is.EquivalentTo(commands));
        }
Esempio n. 3
0
 public Task ExecuteNonQueryAsync(SqlNonQueryCommand command, CancellationToken cancellationToken)
 {
     return Task.FromResult<object>(null);
 }
Esempio n. 4
0
 public Task ExecuteNonQueryAsync(SqlNonQueryCommand command)
 {
     return Task.FromResult<object>(null);
 }
Esempio n. 5
0
 public Task ExecuteNonQueryAsync(SqlNonQueryCommand command)
 {
     return ExecuteNonQueryAsync(command, CancellationToken.None);
 }
Esempio n. 6
0
 public void ExecuteNonQuery(SqlNonQueryCommand command)
 {
 }
Esempio n. 7
0
 public void ExecuteNonQuery(SqlNonQueryCommand command)
 {
     Commands.Add(command);
 }
 /// <summary>
 ///     Initializes a new instance of the <see cref="SqlNonQueryCommandComposer" /> class.
 /// </summary>
 /// <param name="commands">The commands composed so far.</param>
 /// <exception cref="System.ArgumentNullException">Thrown when the <paramref name="commands" /> are <c>null</c>.</exception>
 public SqlNonQueryCommandComposer(SqlNonQueryCommand[] commands)
 {
     if (commands == null) throw new ArgumentNullException("commands");
     _commands = commands;
 }
 private static SqlProjectionHandler HandlerFactory(SqlNonQueryCommand command)
 {
     return new SqlProjectionHandler(
         typeof(object),
         o => new[] { command });
 }