<commit_before>﻿Join-Path $PSScriptRoot "helper.psm1" | Import-Module -Force;
$context = New-TestEnvironment;
Import-Module $context.ModulePath -Force;

Describe "help" {
	It "[PS] Should have full-detailed help" {
		$menu = help New-MigrationScript | Out-String;
		$menu | Write-Host;
		$menu | Should Not BeNullOrEmpty;
	}
}

Describe "Export-Schema" {
	$outFolder = New-TestFolder $context "export-schema";

	It "[PS] Can generate a '.schema.xml' file from an assembly." {
		try
		{
			Push-Location $PSScriptRoot;
			[string]$projectFolder = "../*.Sample/" | Resolve-Path;
			[string]$targetPath = Join-Path $projectFolder "bin/*/*/*.Sample.dll" | Resolve-Path | Select-Object -First 1;
			$expectedFile = [IO.Path]::ChangeExtension($targetPath, ".schema.xml");
			Pop-Location;

			Split-Path $targetPath -Parent | Push-Location;
			$targetPath | Export-Schema $projectFolder | Should Exist;
		}
		finally { Pop-Location; }
	}
}

Describe "New-MigrationScript" {
	It "[PS] Can generate migration script" {
		$outFolder = New-TestFolder $context "new-script";

		$newSchema = Join-Path $outFolder "lastest.schema.xml";
		$oldSchema = Join-Path $outFolder "snapshot.schema.xml";
		Get-SampleFile $context "music.xml" | Copy-Item -Destination $newSchema;

		$resultFile = New-MigrationScript $oldSchema $newSchema $outFolder "mysql";
		$resultFile.Script | Should Exist;
		$resultFile.Script.Length | Should BeGreaterThan 100;
	}
}

Describe "Sync-Schema" {
	$db = Join-Path $PSScriptRoot "sample.db";
	
	It "[PS] Can apply migration scripts to database." {

	}
}<commit_msg>Remove dead test<commit_after>﻿Join-Path $PSScriptRoot "helper.psm1" | Import-Module -Force;
$context = New-TestEnvironment;
Import-Module $context.ModulePath -Force;

Describe "help" {
	It "[PS] Should have full-detailed help" {
		$menu = help New-MigrationScript | Out-String;
		$menu | Write-Host;
		$menu | Should Not BeNullOrEmpty;
	}
}

Describe "Export-Schema" {
	$outFolder = New-TestFolder $context "export-schema";

	It "[PS] Can generate a '.schema.xml' file from an assembly." {
		try
		{
			Push-Location $PSScriptRoot;
			[string]$projectFolder = "../*.Sample/" | Resolve-Path;
			[string]$targetPath = Join-Path $projectFolder "bin/*/*/*.Sample.dll" | Resolve-Path | Select-Object -First 1;
			$expectedFile = [IO.Path]::ChangeExtension($targetPath, ".schema.xml");
			Pop-Location;

			Split-Path $targetPath -Parent | Push-Location;
			$targetPath | Export-Schema $projectFolder | Should Exist;
		}
		finally { Pop-Location; }
	}
}

Describe "New-MigrationScript" {
	It "[PS] Can generate migration script" {
		$outFolder = New-TestFolder $context "new-script";

		$newSchema = Join-Path $outFolder "lastest.schema.xml";
		$oldSchema = Join-Path $outFolder "snapshot.schema.xml";
		Get-SampleFile $context "music.xml" | Copy-Item -Destination $newSchema;

		$resultFile = New-MigrationScript $oldSchema $newSchema $outFolder "mysql";
		$resultFile.Script | Should Exist;
		$resultFile.Script.Length | Should BeGreaterThan 100;
	}
}

Describe "Sync-Schema" {
	$db = Join-Path $PSScriptRoot "sample.db";
	
	#It "[PS] Can apply migration scripts to database." {

	#}
}
{'fraction_non_alphanumeric': 0.14688192465970243, 'fraction_numerical': 0.0031655587211142765, 'mean_word_length': 4.188834154351396, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 10}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1356960', 'n_tokens_mistral': 1125, 'n_tokens_neox': 1045, 'n_words': 254}