Пример #1
0
        public async Task ExecuteAsync_JsonFileHasValidContent_ReturnSuccess()
        {
            // Arrange
            var correctCreateTableStatement = "create table SQL";
            var correctInsertStatement      = "insert to SQL table";

            _sqlBuilder.BuildCreateTable().Returns(correctCreateTableStatement);
            _sqlBuilder.BuildInsert(_validJsonContent).Returns(correctInsertStatement);
            // Act
            var transformResult = await _testModule.ExecuteAsync(_transformOptions);

            // Assert
            Assert.True(transformResult.Success);
        }
Пример #2
0
        private Task CreateFileWithCreateTableSqlStatement(Json2SqlTransformOptions transformOptions)
        {
            var sqlTablePath      = $"{transformOptions.TableSchema}_{transformOptions.TableName}";
            var targetSqlFileName = $"001-create-table-{sqlTablePath}.sql";
            var targetSqlFilePath = Path.Combine(GenerateSqlDirectoryPath(transformOptions), targetSqlFileName);

            var createTableStatement = _sqlBuilder.BuildCreateTable();

            return(_fileWriter.WriteAllTextAsync(targetSqlFilePath, createTableStatement));
        }