public async Task ExecuteAsync_HappyPath_IsSuccessfulReturnTrue() { var dbCommand = CreateDbCommandForHappyPath(); var command = new CommandInsertRow(_tableNameFixture, _colsFixture); await command.ExecuteAsync(dbCommand); command.IsSuccessful.Should().BeTrue(); }
public async Task ExecuteAsync_VerifyBehavior() { var dbCommand = CreateDbCommandForHappyPath(); var command = new CommandInsertRow(_tableNameFixture, _colsFixture); await command.ExecuteAsync(dbCommand); dbCommand.CountCallCommandText.Should().Be(1); dbCommand.CountCallDbParameterCollection.Should().Be(1); dbCommand.CountCallExecuteScalarAsync.Should().Be(1); }
public async Task ExecuteAsync_HappyPath_CreateIdReturnGeneratedId() { var expectedId = new Fixture().Create <int>(); var dbCommand = CreateDbCommandForHappyPath(expectedId: expectedId); var command = new CommandInsertRow(_tableNameFixture, _colsFixture); await command.ExecuteAsync(dbCommand); command.CreatedId.Should().Be(expectedId); }
public async Task ExecuteAsync_HappyPath_DataReturnGeneratedResponse() { var expectedResponse = new Fixture().Create <string>(); var dbCommand = CreateDbCommandForHappyPath(expectedResponse: expectedResponse); var command = new CommandInsertRow(_tableNameFixture, _colsFixture); await command.ExecuteAsync(dbCommand); command.Data.Should().Be(expectedResponse); }