diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-08-02 19:42:50 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-08-02 19:42:50 +0300 |
| commit | 40afcf1c6591abacfa1466dd4d865296bf687aa4 (patch) | |
| tree | 2a0ea83c017a9ce2b25a2c7e1029dc6d9d231e46 /Software/Visual_Studio/Tango.UnitTesting | |
| parent | 6d54a5d28753a675cca9bb57549dbc75986be118 (diff) | |
| download | Tango-40afcf1c6591abacfa1466dd4d865296bf687aa4.tar.gz Tango-40afcf1c6591abacfa1466dd4d865296bf687aa4.zip | |
Working on SQLExaminer lib
Diffstat (limited to 'Software/Visual_Studio/Tango.UnitTesting')
3 files changed, 111 insertions, 2 deletions
diff --git a/Software/Visual_Studio/Tango.UnitTesting/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Tango.UnitTesting/Properties/AssemblyInfo.cs index 98b8a65d3..6cb3427ef 100644 --- a/Software/Visual_Studio/Tango.UnitTesting/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/Tango.UnitTesting/Properties/AssemblyInfo.cs @@ -3,5 +3,5 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyTitle("Tango - Unit Testing")] -[assembly: AssemblyVersion("2.0.*")] +[assembly: AssemblyVersion("2.0.5.1933")] [assembly: ComVisible(false)]
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.UnitTesting/SQLExaminer_TST.cs b/Software/Visual_Studio/Tango.UnitTesting/SQLExaminer_TST.cs new file mode 100644 index 000000000..3dd38c8e9 --- /dev/null +++ b/Software/Visual_Studio/Tango.UnitTesting/SQLExaminer_TST.cs @@ -0,0 +1,104 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.IO; +using Tango.SQLExaminer; + +namespace Tango.UnitTesting +{ + [TestClass] + [TestCategory("SQL Examiner")] + public class SQLExaminer_TST + { + [TestMethod] + public void Generate_Schema_Synchronization_Script() + { + ExaminerConfigurationBuilder builder = new ExaminerConfigurationBuilder(ExaminerConfigurationType.Schema); + + var temp_folder = Helper.GetTempFolderPath(); + + builder. + SetSourceServer("localhost\\SQLEXPRESS", "Tango", false, "Synchronizer", "Aa123456"). + SetTargetServer("twine01\\SQLTWINE", "Tango"). + SetBackupFile(Path.Combine(temp_folder, "db.bak")). + SetReportFile(Path.Combine(temp_folder, "report.xml")); + + var config = builder.Build(); + + String config_path = Path.Combine(temp_folder, "schema.xml"); + + config.ToFile(config_path); + + Helper.ShowInExplorer(config_path); + } + + [TestMethod] + public void Generate_Provisioning_Synchronization_Script() + { + ExaminerConfigurationBuilder builder = new ExaminerConfigurationBuilder(ExaminerConfigurationType.ProvisionMachine); + + var temp_folder = Helper.GetTempFolderPath(); + + builder. + SetSourceServer("localhost\\SQLEXPRESS", "Tango", false, "Synchronizer", "Aa123456"). + SetTargetServer("twine01\\SQLTWINE", "Tango"). + SetReportFile(Path.Combine(temp_folder, "report.xml")). + SetMachineSerialNumber("1111"); + + var config = builder.Build(); + + String config_path = Path.Combine(temp_folder, "provision.xml"); + + config.ToFile(config_path); + + Helper.ShowInExplorer(config_path); + } + + [TestMethod] + public void Generate_Data_Overriding_Script() + { + ExaminerConfigurationBuilder builder = new ExaminerConfigurationBuilder(ExaminerConfigurationType.OverrideData); + + var temp_folder = Helper.GetTempFolderPath(); + + builder. + SetSourceServer("localhost\\SQLEXPRESS", "Tango", false, "Synchronizer", "Aa123456"). + SetTargetServer("twine01\\SQLTWINE", "Tango"). + SetReportFile(Path.Combine(temp_folder, "report.xml")); + + var config = builder.Build(); + + String config_path = Path.Combine(temp_folder, "data.xml"); + + config.ToFile(config_path); + + Helper.ShowInExplorer(config_path); + } + + [TestMethod] + public void Synchronize_Schema() + { + ExaminerConfigurationBuilder builder = new ExaminerConfigurationBuilder(ExaminerConfigurationType.Schema); + + var temp_folder = Helper.GetTempFolderPath(); + + builder. + SetSourceServer("localhost\\SQLEXPRESS", "Tango"). + SetTargetServer("localhost\\SQLEXPRESS", "Test"). + SetBackupFile(Path.Combine(temp_folder, "db.bak")). + SetReportFile(Path.Combine(temp_folder, "report.xml")); + + var config = builder.Build(); + + String config_path = Path.Combine(temp_folder, "schema.xml"); + + config.ToFile(config_path); + + Helper.ShowInExplorer(config_path); + } + } +} diff --git a/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj b/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj index 634b8a230..b5f1663b1 100644 --- a/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj +++ b/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj @@ -95,6 +95,7 @@ <Compile Include="Logging_TST.cs" /> <Compile Include="MachineStudio_TST.cs" /> <Compile Include="RemoteRunner_TST.cs" /> + <Compile Include="SQLExaminer_TST.cs" /> <Compile Include="Temporary_TST.cs" /> <Compile Include="TFS_TST.cs" /> <Compile Include="Outlook_TST.cs" /> @@ -165,6 +166,10 @@ <Project>{d8f1ad85-526a-4f50-b6dc-d437af63d8d8}</Project> <Name>Tango.Settings</Name> </ProjectReference> + <ProjectReference Include="..\Tango.SQLExaminer\Tango.SQLExaminer.csproj"> + <Project>{e1e66ed9-597d-45fa-8048-de90a6930484}</Project> + <Name>Tango.SQLExaminer</Name> + </ProjectReference> <ProjectReference Include="..\Tango.Synchronization\Tango.Synchronization.csproj"> <Project>{7ada4e86-cad7-4968-a210-3a8a9e5153ab}</Project> <Name>Tango.Synchronization</Name> @@ -196,7 +201,7 @@ <Import Project="..\packages\System.Data.SQLite.Core.1.0.108.0\build\net46\System.Data.SQLite.Core.targets" Condition="Exists('..\packages\System.Data.SQLite.Core.1.0.108.0\build\net46\System.Data.SQLite.Core.targets')" /> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> + <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> </VisualStudio> </ProjectExtensions> </Project>
\ No newline at end of file |
