diff --git a/.editorconfig b/.editorconfig index 5ffee1753..cc4f0dc11 100644 --- a/.editorconfig +++ b/.editorconfig @@ -18,7 +18,7 @@ indent_style = tab tab_width = 4 # Settings Visual Studio uses for the generated files -[*.{csproj,resx,settings,vcxproj*,vdproj,xml}] +[*.{csproj,resx,settings,vcxproj*,vdproj,xml,yml,md}] indent_style = space indent_size = 2 diff --git a/.gitattributes b/.gitattributes index a45e95467..09b2b2344 100644 --- a/.gitattributes +++ b/.gitattributes @@ -18,4 +18,5 @@ *.patch -whitespace *.svg -whitespace *.xml -whitespace -changelog -whitespace +*.yml -whitespace +CHANGELOG.md -whitespace diff --git a/.gitignore b/.gitignore index a5cb47286..965217a97 100644 --- a/.gitignore +++ b/.gitignore @@ -15,8 +15,8 @@ CopyToWeSayDev.bat lib/Palaso.TestUtilities.pdb *~ *.pidb -Mercurial/* -mercurial/* +Mercurial/ +mercurial/ *ReSharper* build/old lib/$(Configuration) @@ -27,9 +27,7 @@ src/Chorus.Tests/bin/* src/ChorusMerge.Tests/bin/* src/SampleApp/bin/* CopyTo Dev WeSay.bat -MercurialExtensions/fixutf8/*.pyc -MercurialExtensions/fixutf8/cpmap.pyo -MercurialExtensions/fixutf8/cpmap.py +MercurialExtensions/ test-results *.mdb src/LibChorusTests/test-results/LibChorus.Tests.csproj.test-cache @@ -39,5 +37,7 @@ L10NSharp.dll lib/Chorus_Help.chm packages/ .idea/ +.vs/ riderModule.iml src/LibChorus/icu4c.readme.txt +*.files \ No newline at end of file diff --git a/.nuget/packages.config b/.nuget/packages.config deleted file mode 100644 index c5e6e6a3d..000000000 --- a/.nuget/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 000000000..e4d1fb8cf --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,29 @@ +# Change Log + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/) +and this project adheres to [Semantic Versioning](http://semver.org/). + + + +## [Unreleased] + +## [4.0.0] - 2021-04-30 + +### Changed + +- Create nuget packages + +## [3.0.0] - non-nuget version + +[Unreleased]: https://github.com/sillsdev/libpalaso/compare/v4.0.0...master + +[4.0.0]: https://github.com/sillsdev/libpalaso/compare/v3.0.0...v4.0.0 diff --git a/Chorus.sln b/Chorus.sln index ce2c3f05d..932014c72 100644 --- a/Chorus.sln +++ b/Chorus.sln @@ -1,292 +1,101 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.31101.0 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30709.132 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibChorus", "src\LibChorus\LibChorus.csproj", "{94245366-8F1E-475C-810D-FE89BB3948E0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LibChorus", "src\LibChorus\LibChorus.csproj", "{94245366-8F1E-475C-810D-FE89BB3948E0}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Chorus.Tests", "src\Chorus.Tests\Chorus.Tests.csproj", "{887A58D6-E5C5-4BA1-9C9B-41C6E8F0B915}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Chorus.Tests", "src\Chorus.Tests\Chorus.Tests.csproj", "{887A58D6-E5C5-4BA1-9C9B-41C6E8F0B915}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ChorusMerge", "src\ChorusMerge\ChorusMerge.csproj", "{1264E294-F719-491C-863A-703CB48385D8}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ChorusMerge", "src\ChorusMerge\ChorusMerge.csproj", "{1264E294-F719-491C-863A-703CB48385D8}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ChorusMerge.Tests", "src\ChorusMerge.Tests\ChorusMerge.Tests.csproj", "{2F4DCA63-3503-4F4E-BEC6-8247F83F3BE4}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ChorusMerge.Tests", "src\ChorusMerge.Tests\ChorusMerge.Tests.csproj", "{2F4DCA63-3503-4F4E-BEC6-8247F83F3BE4}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Chorus", "src\Chorus\Chorus.csproj", "{9DA5A655-1881-4BE1-81BA-256E47CF7537}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Chorus", "src\Chorus\Chorus.csproj", "{9DA5A655-1881-4BE1-81BA-256E47CF7537}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleApp", "src\SampleApp\SampleApp.csproj", "{550854F0-9247-42C5-B41D-08E96CC17F92}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SampleApp", "src\SampleApp\SampleApp.csproj", "{550854F0-9247-42C5-B41D-08E96CC17F92}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests-ChorusPlugin", "src\Tests-ChorusPlugin\Tests-ChorusPlugin.csproj", "{1E6F4881-AA72-4AC7-B411-7B7E00C30C25}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tests-ChorusPlugin", "src\Tests-ChorusPlugin\Tests-ChorusPlugin.csproj", "{1E6F4881-AA72-4AC7-B411-7B7E00C30C25}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibChorus.TestUtilities", "src\LibChorus.TestUtilities\LibChorus.TestUtilities.csproj", "{0681E722-1856-44A1-B585-220E6AEC85CB}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LibChorus.TestUtilities", "src\LibChorus.TestUtilities\LibChorus.TestUtilities.csproj", "{0681E722-1856-44A1-B585-220E6AEC85CB}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibChorus.Tests", "src\LibChorusTests\LibChorus.Tests.csproj", "{F9671F8B-8556-44EA-81A7-C236D871B471}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LibChorus.Tests", "src\LibChorusTests\LibChorus.Tests.csproj", "{F9671F8B-8556-44EA-81A7-C236D871B471}" ProjectSection(ProjectDependencies) = postProject {1E6F4881-AA72-4AC7-B411-7B7E00C30C25} = {1E6F4881-AA72-4AC7-B411-7B7E00C30C25} EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ChorusHubApp", "src\ChorusHubApp\ChorusHubApp.csproj", "{EB8C974D-B1C6-4CE0-BFD4-170EFE18790C}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ChorusHubApp", "src\ChorusHubApp\ChorusHubApp.csproj", "{EB8C974D-B1C6-4CE0-BFD4-170EFE18790C}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ChorusHub", "src\ChorusHub\ChorusHub.csproj", "{4D3ECD8D-431D-4B53-B635-017B36B002C9}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ChorusHub", "src\ChorusHub\ChorusHub.csproj", "{4D3ECD8D-431D-4B53-B635-017B36B002C9}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ChorusHubTests", "src\ChorusHubTests\ChorusHubTests.csproj", "{BE491193-6666-4A1C-A23A-FE962632F07D}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ChorusHubTests", "src\ChorusHubTests\ChorusHubTests.csproj", "{BE491193-6666-4A1C-A23A-FE962632F07D}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{CA324D4F-D0A2-4F20-A53B-E693E3BCA46E}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{164F4259-01F4-4F77-8E29-B768437210C3}" ProjectSection(SolutionItems) = preProject - .nuget\packages.config = .nuget\packages.config + CHANGELOG.md = CHANGELOG.md + GitVersion.yml = GitVersion.yml + README.md = README.md EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU - Debug|Mixed Platforms = Debug|Mixed Platforms - Debug|x86 = Debug|x86 - DebugMono|Any CPU = DebugMono|Any CPU - DebugMono|Mixed Platforms = DebugMono|Mixed Platforms - DebugMono|x86 = DebugMono|x86 Release|Any CPU = Release|Any CPU - Release|Mixed Platforms = Release|Mixed Platforms - Release|x86 = Release|x86 - ReleaseMono|Any CPU = ReleaseMono|Any CPU - ReleaseMono|Mixed Platforms = ReleaseMono|Mixed Platforms - ReleaseMono|x86 = ReleaseMono|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {94245366-8F1E-475C-810D-FE89BB3948E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {94245366-8F1E-475C-810D-FE89BB3948E0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {94245366-8F1E-475C-810D-FE89BB3948E0}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {94245366-8F1E-475C-810D-FE89BB3948E0}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {94245366-8F1E-475C-810D-FE89BB3948E0}.Debug|x86.ActiveCfg = Debug|Any CPU - {94245366-8F1E-475C-810D-FE89BB3948E0}.DebugMono|Any CPU.ActiveCfg = DebugMono|Any CPU - {94245366-8F1E-475C-810D-FE89BB3948E0}.DebugMono|Any CPU.Build.0 = DebugMono|Any CPU - {94245366-8F1E-475C-810D-FE89BB3948E0}.DebugMono|Mixed Platforms.ActiveCfg = DebugMono|Any CPU - {94245366-8F1E-475C-810D-FE89BB3948E0}.DebugMono|Mixed Platforms.Build.0 = DebugMono|Any CPU - {94245366-8F1E-475C-810D-FE89BB3948E0}.DebugMono|x86.ActiveCfg = DebugMono|Any CPU {94245366-8F1E-475C-810D-FE89BB3948E0}.Release|Any CPU.ActiveCfg = Release|Any CPU {94245366-8F1E-475C-810D-FE89BB3948E0}.Release|Any CPU.Build.0 = Release|Any CPU - {94245366-8F1E-475C-810D-FE89BB3948E0}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {94245366-8F1E-475C-810D-FE89BB3948E0}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {94245366-8F1E-475C-810D-FE89BB3948E0}.Release|x86.ActiveCfg = Release|Any CPU - {94245366-8F1E-475C-810D-FE89BB3948E0}.ReleaseMono|Any CPU.ActiveCfg = ReleaseMono|Any CPU - {94245366-8F1E-475C-810D-FE89BB3948E0}.ReleaseMono|Any CPU.Build.0 = ReleaseMono|Any CPU - {94245366-8F1E-475C-810D-FE89BB3948E0}.ReleaseMono|Mixed Platforms.ActiveCfg = ReleaseMono|Any CPU - {94245366-8F1E-475C-810D-FE89BB3948E0}.ReleaseMono|Mixed Platforms.Build.0 = ReleaseMono|Any CPU - {94245366-8F1E-475C-810D-FE89BB3948E0}.ReleaseMono|x86.ActiveCfg = ReleaseMono|Any CPU {887A58D6-E5C5-4BA1-9C9B-41C6E8F0B915}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {887A58D6-E5C5-4BA1-9C9B-41C6E8F0B915}.Debug|Any CPU.Build.0 = Debug|Any CPU - {887A58D6-E5C5-4BA1-9C9B-41C6E8F0B915}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {887A58D6-E5C5-4BA1-9C9B-41C6E8F0B915}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {887A58D6-E5C5-4BA1-9C9B-41C6E8F0B915}.Debug|x86.ActiveCfg = Debug|Any CPU - {887A58D6-E5C5-4BA1-9C9B-41C6E8F0B915}.DebugMono|Any CPU.ActiveCfg = DebugMono|Any CPU - {887A58D6-E5C5-4BA1-9C9B-41C6E8F0B915}.DebugMono|Any CPU.Build.0 = DebugMono|Any CPU - {887A58D6-E5C5-4BA1-9C9B-41C6E8F0B915}.DebugMono|Mixed Platforms.ActiveCfg = DebugMono|Any CPU - {887A58D6-E5C5-4BA1-9C9B-41C6E8F0B915}.DebugMono|Mixed Platforms.Build.0 = DebugMono|Any CPU - {887A58D6-E5C5-4BA1-9C9B-41C6E8F0B915}.DebugMono|x86.ActiveCfg = DebugMono|Any CPU {887A58D6-E5C5-4BA1-9C9B-41C6E8F0B915}.Release|Any CPU.ActiveCfg = Release|Any CPU {887A58D6-E5C5-4BA1-9C9B-41C6E8F0B915}.Release|Any CPU.Build.0 = Release|Any CPU - {887A58D6-E5C5-4BA1-9C9B-41C6E8F0B915}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {887A58D6-E5C5-4BA1-9C9B-41C6E8F0B915}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {887A58D6-E5C5-4BA1-9C9B-41C6E8F0B915}.Release|x86.ActiveCfg = Release|Any CPU - {887A58D6-E5C5-4BA1-9C9B-41C6E8F0B915}.ReleaseMono|Any CPU.ActiveCfg = ReleaseMono|Any CPU - {887A58D6-E5C5-4BA1-9C9B-41C6E8F0B915}.ReleaseMono|Any CPU.Build.0 = ReleaseMono|Any CPU - {887A58D6-E5C5-4BA1-9C9B-41C6E8F0B915}.ReleaseMono|Mixed Platforms.ActiveCfg = ReleaseMono|Any CPU - {887A58D6-E5C5-4BA1-9C9B-41C6E8F0B915}.ReleaseMono|Mixed Platforms.Build.0 = ReleaseMono|Any CPU - {887A58D6-E5C5-4BA1-9C9B-41C6E8F0B915}.ReleaseMono|x86.ActiveCfg = ReleaseMono|Any CPU {1264E294-F719-491C-863A-703CB48385D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {1264E294-F719-491C-863A-703CB48385D8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1264E294-F719-491C-863A-703CB48385D8}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {1264E294-F719-491C-863A-703CB48385D8}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {1264E294-F719-491C-863A-703CB48385D8}.Debug|x86.ActiveCfg = Debug|Any CPU - {1264E294-F719-491C-863A-703CB48385D8}.DebugMono|Any CPU.ActiveCfg = DebugMono|Any CPU - {1264E294-F719-491C-863A-703CB48385D8}.DebugMono|Any CPU.Build.0 = DebugMono|Any CPU - {1264E294-F719-491C-863A-703CB48385D8}.DebugMono|Mixed Platforms.ActiveCfg = DebugMono|Any CPU - {1264E294-F719-491C-863A-703CB48385D8}.DebugMono|Mixed Platforms.Build.0 = DebugMono|Any CPU - {1264E294-F719-491C-863A-703CB48385D8}.DebugMono|x86.ActiveCfg = DebugMono|Any CPU {1264E294-F719-491C-863A-703CB48385D8}.Release|Any CPU.ActiveCfg = Release|Any CPU {1264E294-F719-491C-863A-703CB48385D8}.Release|Any CPU.Build.0 = Release|Any CPU - {1264E294-F719-491C-863A-703CB48385D8}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {1264E294-F719-491C-863A-703CB48385D8}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {1264E294-F719-491C-863A-703CB48385D8}.Release|x86.ActiveCfg = Release|Any CPU - {1264E294-F719-491C-863A-703CB48385D8}.ReleaseMono|Any CPU.ActiveCfg = ReleaseMono|Any CPU - {1264E294-F719-491C-863A-703CB48385D8}.ReleaseMono|Any CPU.Build.0 = ReleaseMono|Any CPU - {1264E294-F719-491C-863A-703CB48385D8}.ReleaseMono|Mixed Platforms.ActiveCfg = ReleaseMono|Any CPU - {1264E294-F719-491C-863A-703CB48385D8}.ReleaseMono|Mixed Platforms.Build.0 = ReleaseMono|Any CPU - {1264E294-F719-491C-863A-703CB48385D8}.ReleaseMono|x86.ActiveCfg = ReleaseMono|Any CPU {2F4DCA63-3503-4F4E-BEC6-8247F83F3BE4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {2F4DCA63-3503-4F4E-BEC6-8247F83F3BE4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2F4DCA63-3503-4F4E-BEC6-8247F83F3BE4}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {2F4DCA63-3503-4F4E-BEC6-8247F83F3BE4}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {2F4DCA63-3503-4F4E-BEC6-8247F83F3BE4}.Debug|x86.ActiveCfg = Debug|Any CPU - {2F4DCA63-3503-4F4E-BEC6-8247F83F3BE4}.DebugMono|Any CPU.ActiveCfg = DebugMono|Any CPU - {2F4DCA63-3503-4F4E-BEC6-8247F83F3BE4}.DebugMono|Any CPU.Build.0 = DebugMono|Any CPU - {2F4DCA63-3503-4F4E-BEC6-8247F83F3BE4}.DebugMono|Mixed Platforms.ActiveCfg = DebugMono|Any CPU - {2F4DCA63-3503-4F4E-BEC6-8247F83F3BE4}.DebugMono|Mixed Platforms.Build.0 = DebugMono|Any CPU - {2F4DCA63-3503-4F4E-BEC6-8247F83F3BE4}.DebugMono|x86.ActiveCfg = DebugMono|Any CPU {2F4DCA63-3503-4F4E-BEC6-8247F83F3BE4}.Release|Any CPU.ActiveCfg = Release|Any CPU {2F4DCA63-3503-4F4E-BEC6-8247F83F3BE4}.Release|Any CPU.Build.0 = Release|Any CPU - {2F4DCA63-3503-4F4E-BEC6-8247F83F3BE4}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {2F4DCA63-3503-4F4E-BEC6-8247F83F3BE4}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {2F4DCA63-3503-4F4E-BEC6-8247F83F3BE4}.Release|x86.ActiveCfg = Release|Any CPU - {2F4DCA63-3503-4F4E-BEC6-8247F83F3BE4}.ReleaseMono|Any CPU.ActiveCfg = ReleaseMono|Any CPU - {2F4DCA63-3503-4F4E-BEC6-8247F83F3BE4}.ReleaseMono|Any CPU.Build.0 = ReleaseMono|Any CPU - {2F4DCA63-3503-4F4E-BEC6-8247F83F3BE4}.ReleaseMono|Mixed Platforms.ActiveCfg = ReleaseMono|Any CPU - {2F4DCA63-3503-4F4E-BEC6-8247F83F3BE4}.ReleaseMono|Mixed Platforms.Build.0 = ReleaseMono|Any CPU - {2F4DCA63-3503-4F4E-BEC6-8247F83F3BE4}.ReleaseMono|x86.ActiveCfg = ReleaseMono|Any CPU {9DA5A655-1881-4BE1-81BA-256E47CF7537}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9DA5A655-1881-4BE1-81BA-256E47CF7537}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9DA5A655-1881-4BE1-81BA-256E47CF7537}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {9DA5A655-1881-4BE1-81BA-256E47CF7537}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {9DA5A655-1881-4BE1-81BA-256E47CF7537}.Debug|x86.ActiveCfg = Debug|Any CPU - {9DA5A655-1881-4BE1-81BA-256E47CF7537}.DebugMono|Any CPU.ActiveCfg = DebugMono|Any CPU - {9DA5A655-1881-4BE1-81BA-256E47CF7537}.DebugMono|Any CPU.Build.0 = DebugMono|Any CPU - {9DA5A655-1881-4BE1-81BA-256E47CF7537}.DebugMono|Mixed Platforms.ActiveCfg = DebugMono|Any CPU - {9DA5A655-1881-4BE1-81BA-256E47CF7537}.DebugMono|Mixed Platforms.Build.0 = DebugMono|Any CPU - {9DA5A655-1881-4BE1-81BA-256E47CF7537}.DebugMono|x86.ActiveCfg = DebugMono|Any CPU {9DA5A655-1881-4BE1-81BA-256E47CF7537}.Release|Any CPU.ActiveCfg = Release|Any CPU {9DA5A655-1881-4BE1-81BA-256E47CF7537}.Release|Any CPU.Build.0 = Release|Any CPU - {9DA5A655-1881-4BE1-81BA-256E47CF7537}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {9DA5A655-1881-4BE1-81BA-256E47CF7537}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {9DA5A655-1881-4BE1-81BA-256E47CF7537}.Release|x86.ActiveCfg = Release|Any CPU - {9DA5A655-1881-4BE1-81BA-256E47CF7537}.ReleaseMono|Any CPU.ActiveCfg = ReleaseMono|Any CPU - {9DA5A655-1881-4BE1-81BA-256E47CF7537}.ReleaseMono|Any CPU.Build.0 = ReleaseMono|Any CPU - {9DA5A655-1881-4BE1-81BA-256E47CF7537}.ReleaseMono|Mixed Platforms.ActiveCfg = ReleaseMono|Any CPU - {9DA5A655-1881-4BE1-81BA-256E47CF7537}.ReleaseMono|Mixed Platforms.Build.0 = ReleaseMono|Any CPU - {9DA5A655-1881-4BE1-81BA-256E47CF7537}.ReleaseMono|x86.ActiveCfg = ReleaseMono|Any CPU - {550854F0-9247-42C5-B41D-08E96CC17F92}.Debug|x86.ActiveCfg = Debug|Any CPU - {550854F0-9247-42C5-B41D-08E96CC17F92}.DebugMono|x86.ActiveCfg = DebugMono|Any CPU - {550854F0-9247-42C5-B41D-08E96CC17F92}.Release|x86.ActiveCfg = Release|Any CPU - {550854F0-9247-42C5-B41D-08E96CC17F92}.ReleaseMono|x86.ActiveCfg = ReleaseMono|Any CPU {550854F0-9247-42C5-B41D-08E96CC17F92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {550854F0-9247-42C5-B41D-08E96CC17F92}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {550854F0-9247-42C5-B41D-08E96CC17F92}.DebugMono|Any CPU.ActiveCfg = DebugMono|Any CPU - {550854F0-9247-42C5-B41D-08E96CC17F92}.DebugMono|Mixed Platforms.ActiveCfg = DebugMono|Any CPU {550854F0-9247-42C5-B41D-08E96CC17F92}.Release|Any CPU.ActiveCfg = Release|Any CPU - {550854F0-9247-42C5-B41D-08E96CC17F92}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {550854F0-9247-42C5-B41D-08E96CC17F92}.ReleaseMono|Any CPU.ActiveCfg = ReleaseMono|Any CPU - {550854F0-9247-42C5-B41D-08E96CC17F92}.ReleaseMono|Mixed Platforms.ActiveCfg = ReleaseMono|Any CPU - {0681E722-1856-44A1-B585-220E6AEC85CB}.DebugMono|x86.ActiveCfg = DebugMono|Any CPU + {1E6F4881-AA72-4AC7-B411-7B7E00C30C25}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1E6F4881-AA72-4AC7-B411-7B7E00C30C25}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1E6F4881-AA72-4AC7-B411-7B7E00C30C25}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1E6F4881-AA72-4AC7-B411-7B7E00C30C25}.Release|Any CPU.Build.0 = Release|Any CPU {0681E722-1856-44A1-B585-220E6AEC85CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0681E722-1856-44A1-B585-220E6AEC85CB}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {0681E722-1856-44A1-B585-220E6AEC85CB}.Debug|x86.ActiveCfg = Debug|Any CPU - {0681E722-1856-44A1-B585-220E6AEC85CB}.DebugMono|Any CPU.ActiveCfg = DebugMono|Any CPU - {0681E722-1856-44A1-B585-220E6AEC85CB}.DebugMono|Mixed Platforms.ActiveCfg = DebugMono|Any CPU - {0681E722-1856-44A1-B585-220E6AEC85CB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0681E722-1856-44A1-B585-220E6AEC85CB}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {0681E722-1856-44A1-B585-220E6AEC85CB}.Release|x86.ActiveCfg = Release|Any CPU - {0681E722-1856-44A1-B585-220E6AEC85CB}.ReleaseMono|Any CPU.ActiveCfg = ReleaseMono|Any CPU - {0681E722-1856-44A1-B585-220E6AEC85CB}.ReleaseMono|Mixed Platforms.ActiveCfg = ReleaseMono|Any CPU - {0681E722-1856-44A1-B585-220E6AEC85CB}.ReleaseMono|x86.ActiveCfg = ReleaseMono|Any CPU {0681E722-1856-44A1-B585-220E6AEC85CB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0681E722-1856-44A1-B585-220E6AEC85CB}.DebugMono|Any CPU.Build.0 = DebugMono|Any CPU + {0681E722-1856-44A1-B585-220E6AEC85CB}.Release|Any CPU.ActiveCfg = Release|Any CPU {0681E722-1856-44A1-B585-220E6AEC85CB}.Release|Any CPU.Build.0 = Release|Any CPU - {0681E722-1856-44A1-B585-220E6AEC85CB}.ReleaseMono|Any CPU.Build.0 = ReleaseMono|Any CPU - {0681E722-1856-44A1-B585-220E6AEC85CB}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {0681E722-1856-44A1-B585-220E6AEC85CB}.DebugMono|Mixed Platforms.Build.0 = DebugMono|Any CPU - {0681E722-1856-44A1-B585-220E6AEC85CB}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {0681E722-1856-44A1-B585-220E6AEC85CB}.ReleaseMono|Mixed Platforms.Build.0 = ReleaseMono|Any CPU {F9671F8B-8556-44EA-81A7-C236D871B471}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F9671F8B-8556-44EA-81A7-C236D871B471}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F9671F8B-8556-44EA-81A7-C236D871B471}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {F9671F8B-8556-44EA-81A7-C236D871B471}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {F9671F8B-8556-44EA-81A7-C236D871B471}.Debug|x86.ActiveCfg = Debug|Any CPU - {F9671F8B-8556-44EA-81A7-C236D871B471}.DebugMono|Any CPU.ActiveCfg = DebugMono|Any CPU - {F9671F8B-8556-44EA-81A7-C236D871B471}.DebugMono|Any CPU.Build.0 = DebugMono|Any CPU - {F9671F8B-8556-44EA-81A7-C236D871B471}.DebugMono|Mixed Platforms.ActiveCfg = DebugMono|Any CPU - {F9671F8B-8556-44EA-81A7-C236D871B471}.DebugMono|Mixed Platforms.Build.0 = DebugMono|Any CPU - {F9671F8B-8556-44EA-81A7-C236D871B471}.DebugMono|x86.ActiveCfg = DebugMono|Any CPU {F9671F8B-8556-44EA-81A7-C236D871B471}.Release|Any CPU.ActiveCfg = Release|Any CPU {F9671F8B-8556-44EA-81A7-C236D871B471}.Release|Any CPU.Build.0 = Release|Any CPU - {F9671F8B-8556-44EA-81A7-C236D871B471}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {F9671F8B-8556-44EA-81A7-C236D871B471}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {F9671F8B-8556-44EA-81A7-C236D871B471}.Release|x86.ActiveCfg = Release|Any CPU - {F9671F8B-8556-44EA-81A7-C236D871B471}.ReleaseMono|Any CPU.ActiveCfg = ReleaseMono|Any CPU - {F9671F8B-8556-44EA-81A7-C236D871B471}.ReleaseMono|Any CPU.Build.0 = ReleaseMono|Any CPU - {F9671F8B-8556-44EA-81A7-C236D871B471}.ReleaseMono|Mixed Platforms.ActiveCfg = ReleaseMono|Any CPU - {F9671F8B-8556-44EA-81A7-C236D871B471}.ReleaseMono|Mixed Platforms.Build.0 = ReleaseMono|Any CPU - {F9671F8B-8556-44EA-81A7-C236D871B471}.ReleaseMono|x86.ActiveCfg = ReleaseMono|Any CPU {EB8C974D-B1C6-4CE0-BFD4-170EFE18790C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {EB8C974D-B1C6-4CE0-BFD4-170EFE18790C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EB8C974D-B1C6-4CE0-BFD4-170EFE18790C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {EB8C974D-B1C6-4CE0-BFD4-170EFE18790C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {EB8C974D-B1C6-4CE0-BFD4-170EFE18790C}.Debug|x86.ActiveCfg = Debug|Any CPU {EB8C974D-B1C6-4CE0-BFD4-170EFE18790C}.Release|Any CPU.ActiveCfg = Release|Any CPU {EB8C974D-B1C6-4CE0-BFD4-170EFE18790C}.Release|Any CPU.Build.0 = Release|Any CPU - {EB8C974D-B1C6-4CE0-BFD4-170EFE18790C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {EB8C974D-B1C6-4CE0-BFD4-170EFE18790C}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {EB8C974D-B1C6-4CE0-BFD4-170EFE18790C}.Release|x86.ActiveCfg = Release|Any CPU - {EB8C974D-B1C6-4CE0-BFD4-170EFE18790C}.DebugMono|Any CPU.ActiveCfg = DebugMono|Any CPU - {EB8C974D-B1C6-4CE0-BFD4-170EFE18790C}.DebugMono|Any CPU.Build.0 = DebugMono|Any CPU - {EB8C974D-B1C6-4CE0-BFD4-170EFE18790C}.DebugMono|Mixed Platforms.ActiveCfg = DebugMono|Any CPU - {EB8C974D-B1C6-4CE0-BFD4-170EFE18790C}.DebugMono|Mixed Platforms.Build.0 = DebugMono|Any CPU - {EB8C974D-B1C6-4CE0-BFD4-170EFE18790C}.DebugMono|x86.ActiveCfg = DebugMono|Any CPU - {EB8C974D-B1C6-4CE0-BFD4-170EFE18790C}.ReleaseMono|Any CPU.ActiveCfg = ReleaseMono|Any CPU - {EB8C974D-B1C6-4CE0-BFD4-170EFE18790C}.ReleaseMono|Any CPU.Build.0 = ReleaseMono|Any CPU - {EB8C974D-B1C6-4CE0-BFD4-170EFE18790C}.ReleaseMono|Mixed Platforms.ActiveCfg = ReleaseMono|Any CPU - {EB8C974D-B1C6-4CE0-BFD4-170EFE18790C}.ReleaseMono|Mixed Platforms.Build.0 = ReleaseMono|Any CPU - {EB8C974D-B1C6-4CE0-BFD4-170EFE18790C}.ReleaseMono|x86.ActiveCfg = ReleaseMono|Any CPU {4D3ECD8D-431D-4B53-B635-017B36B002C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4D3ECD8D-431D-4B53-B635-017B36B002C9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4D3ECD8D-431D-4B53-B635-017B36B002C9}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {4D3ECD8D-431D-4B53-B635-017B36B002C9}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {4D3ECD8D-431D-4B53-B635-017B36B002C9}.Debug|x86.ActiveCfg = Debug|Any CPU - {4D3ECD8D-431D-4B53-B635-017B36B002C9}.DebugMono|Any CPU.ActiveCfg = DebugMono|Any CPU - {4D3ECD8D-431D-4B53-B635-017B36B002C9}.DebugMono|Any CPU.Build.0 = DebugMono|Any CPU - {4D3ECD8D-431D-4B53-B635-017B36B002C9}.DebugMono|Mixed Platforms.ActiveCfg = DebugMono|Any CPU - {4D3ECD8D-431D-4B53-B635-017B36B002C9}.DebugMono|Mixed Platforms.Build.0 = DebugMono|Any CPU - {4D3ECD8D-431D-4B53-B635-017B36B002C9}.DebugMono|x86.ActiveCfg = DebugMono|Any CPU {4D3ECD8D-431D-4B53-B635-017B36B002C9}.Release|Any CPU.ActiveCfg = Release|Any CPU {4D3ECD8D-431D-4B53-B635-017B36B002C9}.Release|Any CPU.Build.0 = Release|Any CPU - {4D3ECD8D-431D-4B53-B635-017B36B002C9}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {4D3ECD8D-431D-4B53-B635-017B36B002C9}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {4D3ECD8D-431D-4B53-B635-017B36B002C9}.Release|x86.ActiveCfg = Release|Any CPU - {4D3ECD8D-431D-4B53-B635-017B36B002C9}.ReleaseMono|Any CPU.ActiveCfg = ReleaseMono|Any CPU - {4D3ECD8D-431D-4B53-B635-017B36B002C9}.ReleaseMono|Any CPU.Build.0 = ReleaseMono|Any CPU - {4D3ECD8D-431D-4B53-B635-017B36B002C9}.ReleaseMono|Mixed Platforms.ActiveCfg = ReleaseMono|Any CPU - {4D3ECD8D-431D-4B53-B635-017B36B002C9}.ReleaseMono|Mixed Platforms.Build.0 = ReleaseMono|Any CPU - {4D3ECD8D-431D-4B53-B635-017B36B002C9}.ReleaseMono|x86.ActiveCfg = ReleaseMono|Any CPU - {BE491193-6666-4A1C-A23A-FE962632F07D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BE491193-6666-4A1C-A23A-FE962632F07D}.Release|Any CPU.Build.0 = Release|Any CPU - {BE491193-6666-4A1C-A23A-FE962632F07D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {BE491193-6666-4A1C-A23A-FE962632F07D}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {BE491193-6666-4A1C-A23A-FE962632F07D}.Release|x86.ActiveCfg = Release|Any CPU - {BE491193-6666-4A1C-A23A-FE962632F07D}.ReleaseMono|Any CPU.ActiveCfg = ReleaseMono|Any CPU - {BE491193-6666-4A1C-A23A-FE962632F07D}.ReleaseMono|Any CPU.Build.0 = ReleaseMono|Any CPU - {BE491193-6666-4A1C-A23A-FE962632F07D}.ReleaseMono|Mixed Platforms.ActiveCfg = ReleaseMono|Any CPU - {BE491193-6666-4A1C-A23A-FE962632F07D}.ReleaseMono|Mixed Platforms.Build.0 = ReleaseMono|Any CPU {BE491193-6666-4A1C-A23A-FE962632F07D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {BE491193-6666-4A1C-A23A-FE962632F07D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BE491193-6666-4A1C-A23A-FE962632F07D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {BE491193-6666-4A1C-A23A-FE962632F07D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {BE491193-6666-4A1C-A23A-FE962632F07D}.Debug|x86.ActiveCfg = Debug|Any CPU - {BE491193-6666-4A1C-A23A-FE962632F07D}.DebugMono|Mixed Platforms.ActiveCfg = DebugMono|Any CPU - {BE491193-6666-4A1C-A23A-FE962632F07D}.DebugMono|Mixed Platforms.Build.0 = DebugMono|Any CPU - {BE491193-6666-4A1C-A23A-FE962632F07D}.DebugMono|x86.ActiveCfg = DebugMono|Any CPU - {BE491193-6666-4A1C-A23A-FE962632F07D}.DebugMono|Any CPU.ActiveCfg = DebugMono|Any CPU - {BE491193-6666-4A1C-A23A-FE962632F07D}.DebugMono|Any CPU.Build.0 = DebugMono|Any CPU - {BE491193-6666-4A1C-A23A-FE962632F07D}.ReleaseMono|x86.ActiveCfg = ReleaseMono|Any CPU - {1E6F4881-AA72-4AC7-B411-7B7E00C30C25}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1E6F4881-AA72-4AC7-B411-7B7E00C30C25}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {1E6F4881-AA72-4AC7-B411-7B7E00C30C25}.Debug|x86.ActiveCfg = Debug|Any CPU - {1E6F4881-AA72-4AC7-B411-7B7E00C30C25}.DebugMono|Any CPU.ActiveCfg = DebugMono|Any CPU - {1E6F4881-AA72-4AC7-B411-7B7E00C30C25}.DebugMono|Mixed Platforms.ActiveCfg = DebugMono|Any CPU - {1E6F4881-AA72-4AC7-B411-7B7E00C30C25}.DebugMono|x86.ActiveCfg = DebugMono|Any CPU - {1E6F4881-AA72-4AC7-B411-7B7E00C30C25}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1E6F4881-AA72-4AC7-B411-7B7E00C30C25}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {1E6F4881-AA72-4AC7-B411-7B7E00C30C25}.Release|x86.ActiveCfg = Release|Any CPU - {1E6F4881-AA72-4AC7-B411-7B7E00C30C25}.ReleaseMono|Any CPU.ActiveCfg = ReleaseMono|Any CPU - {1E6F4881-AA72-4AC7-B411-7B7E00C30C25}.ReleaseMono|Mixed Platforms.ActiveCfg = ReleaseMono|Any CPU - {1E6F4881-AA72-4AC7-B411-7B7E00C30C25}.ReleaseMono|x86.ActiveCfg = ReleaseMono|Any CPU - {1E6F4881-AA72-4AC7-B411-7B7E00C30C25}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1E6F4881-AA72-4AC7-B411-7B7E00C30C25}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {1E6F4881-AA72-4AC7-B411-7B7E00C30C25}.DebugMono|Any CPU.Build.0 = DebugMono|Any CPU - {1E6F4881-AA72-4AC7-B411-7B7E00C30C25}.DebugMono|Mixed Platforms.Build.0 = DebugMono|Any CPU - {1E6F4881-AA72-4AC7-B411-7B7E00C30C25}.Release|Any CPU.Build.0 = Release|Any CPU - {1E6F4881-AA72-4AC7-B411-7B7E00C30C25}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {1E6F4881-AA72-4AC7-B411-7B7E00C30C25}.ReleaseMono|Any CPU.Build.0 = ReleaseMono|Any CPU - {1E6F4881-AA72-4AC7-B411-7B7E00C30C25}.ReleaseMono|Mixed Platforms.Build.0 = ReleaseMono|Any CPU + {BE491193-6666-4A1C-A23A-FE962632F07D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BE491193-6666-4A1C-A23A-FE962632F07D}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {42350D12-26EB-4C72-B65E-F01D4091CBF7} + EndGlobalSection GlobalSection(MonoDevelopProperties) = preSolution StartupItem = src\ChorusHub\ChorusHub.csproj EndGlobalSection diff --git a/Directory.Build.targets b/Directory.Build.targets new file mode 100644 index 000000000..732c76ce2 --- /dev/null +++ b/Directory.Build.targets @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/GitVersion.yml b/GitVersion.yml new file mode 100644 index 000000000..a92fe8405 --- /dev/null +++ b/GitVersion.yml @@ -0,0 +1,22 @@ +assembly-versioning-scheme: MajorMinor +assembly-file-versioning-format: '{Major}.{Minor}.{Patch}.{env:GITVERSION_BUILD_NUMBER ?? 0}' +mode: ContinuousDeployment +branches: + master: + tag: beta + regex: (origin/)?master + hotfix: + tag: beta + regex: (origin/)?hotfix[/-] + increment: Patch + prevent-increment-of-merged-branch-version: false + track-merge-target: false + tracks-release-branches: false + is-release-branch: false + pull-request: + mode: ContinuousDeployment + tag: PR + feature: + regex: feature[/-] + mode: ContinuousDeployment + tag: alpha diff --git a/MercurialExtensions/.guidsForInstaller.xml b/MercurialExtensions/.guidsForInstaller.xml deleted file mode 100644 index bcebc3c93..000000000 --- a/MercurialExtensions/.guidsForInstaller.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/MercurialExtensions/Dummy.txt b/MercurialExtensions/Dummy.txt deleted file mode 100644 index 6bbd362f2..000000000 --- a/MercurialExtensions/Dummy.txt +++ /dev/null @@ -1 +0,0 @@ -This is just here to make team city deliver this whole folder as an artifact, instead of just fixutf8. \ No newline at end of file diff --git a/MercurialExtensions/fixutf8/.gitignore b/MercurialExtensions/fixutf8/.gitignore deleted file mode 100644 index 946e411ea..000000000 --- a/MercurialExtensions/fixutf8/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ - -*.py~ -*.pyc diff --git a/MercurialExtensions/fixutf8/.guidsForInstaller.xml b/MercurialExtensions/fixutf8/.guidsForInstaller.xml deleted file mode 100644 index 565070b50..000000000 --- a/MercurialExtensions/fixutf8/.guidsForInstaller.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/MercurialExtensions/fixutf8/.hg_archival.txt b/MercurialExtensions/fixutf8/.hg_archival.txt deleted file mode 100644 index 40cbcb9d6..000000000 --- a/MercurialExtensions/fixutf8/.hg_archival.txt +++ /dev/null @@ -1,5 +0,0 @@ -repo: d203a65e38016a0c0fe2c3171f857a794d3a265a -node: 0d0e382883472b6b04130c8adbde7e0959269c91 -branch: default -latesttag: null -latesttagdistance: 30 diff --git a/MercurialExtensions/fixutf8/.hgignore b/MercurialExtensions/fixutf8/.hgignore deleted file mode 100644 index f529c0608..000000000 --- a/MercurialExtensions/fixutf8/.hgignore +++ /dev/null @@ -1,3 +0,0 @@ -syntax: glob -*.py~ -*.pyc diff --git a/MercurialExtensions/fixutf8/README b/MercurialExtensions/fixutf8/README deleted file mode 100644 index 509f40b1e..000000000 --- a/MercurialExtensions/fixutf8/README +++ /dev/null @@ -1,49 +0,0 @@ -.. -*-restructuredtext-*- - -================= -FixUtf8 Extension -================= - -This extension is not distributed with Mercurial. - -Author: Stefan Rusek - -Download site: http://bitbucket.org/stefanrusek/hg-fixutf8/changesets/ (Requires Mercurial 1.1 or later and Python 2.5 or later) - -This extension is still in beta, use it at your own risk. - --------- -Overview --------- - -This extension corrects filename encoding problems on Windows. - -Windows internally stores all command line arguments and filenames in Unicode UTF-16 (16-bit character strings), and for backward compatibility with Windows 3.x, provides functions to retrieve them in non-Unicode 8-bit character strings. Python 2.x and Mercurial call the non-Unicode functions. This causes Mercurial to misbehave when used with filenames that contain Unicode characters. This extension resolves this issue, by making sure that the Unicode functions are called. Since Mercurial expects 8-bit character strings, the extension converts the strings to UTF-8 before returning them to Mercurial. - -There is one case where fixutf8 fails to add support for Unicode. Because the repository object for the current working directory is created before extensions are loaded. There is nothing that fixutf8 can do to fix the problem of a repository residing withing a directory with Unicode characters in it. However, fixutf8 does not have a problem with directories with Unicode characters inside of the repository. - -Ideally, you enable the extension before you need international filenames, but if you already have international filenames in your repo, then you need to fix your filenames. - -In order for Unicode characters to display properly, you should change the Windows console font from "Raster Fonts" to "Lucida Console". - -Fixing existing filenames -========================= - -To fix your filenames simply do the following: - ->hg addremove -s 100 ->hg commit -m "Fix filenames" - -Configuration -============= - -Configure your .hgrc to enable the extension by adding following lines: - -[extensions] -fixutf8 = path/to/fixutf8.py - ------------------------------ -Compatibility with TortoiseHg ------------------------------ - -Where TortoiseHg uses python or mercurial filename api calls, it is compatibile with FixUtf8. This means that most of the dialogs work fine. Shell integration does not work perfectly, since the TortoiseHg shell extension converts the filenames to the non-Unicode 8-bit character strings, before calling passing them to mercurial. diff --git a/MercurialExtensions/fixutf8/buildcpmap.py b/MercurialExtensions/fixutf8/buildcpmap.py deleted file mode 100644 index d03e6b417..000000000 --- a/MercurialExtensions/fixutf8/buildcpmap.py +++ /dev/null @@ -1,49 +0,0 @@ - -minchar = 0 -maxchar = 0xffff - -cps = [ 437, # prefer ASCII - 1252, 1250, 1251, 1253, 1254, 1255, 1256, - 1257, 1258, 874, 932, 936, 949, 950, - 1361, 869, 866, 865, 864, 863, 862, - 861, 860, 857, 855, 852, 775, 737, - 850, 437, - 65001] # fallback on utf-8 - -def canencode(c, cp): - if cp == 'cp65001': - return True - try: - c.encode(cp) - return True - except UnicodeError: - return False - -scps = ['cp%d' % cp for cp in cps] -chars = [unichr(i) for i in range(minchar, 1 + maxchar)] - -f = open('cpmap.py', 'w') - -f.write(''' -#################################################### -# -# Do not modify this file, edit buildcpmap.py -# -#################################################### -''') -f.write("cps = %s\n" % repr(scps)) -f.write("cpmap = %s\n" % dict(('cp%d' % cp, cp) for cp in cps)) - -f.write("charmap = [\n") -for c, lcp in ((char, [cp for cp in scps if canencode(char, cp)]) - for char in chars): - f.write(" %s,\n" % repr(lcp)) -f.write('''] - -def reduce(s): - l = list(cps) - for c in s: - l = [cp for cp in charmap[ord(c)] if cp in l] - return (l[0], cpmap[l[0]]) -'''); -f.close() diff --git a/MercurialExtensions/fixutf8/cpmap.pyc b/MercurialExtensions/fixutf8/cpmap.pyc deleted file mode 100644 index 3dd0c3f99..000000000 Binary files a/MercurialExtensions/fixutf8/cpmap.pyc and /dev/null differ diff --git a/MercurialExtensions/fixutf8/fixutf8.py b/MercurialExtensions/fixutf8/fixutf8.py deleted file mode 100644 index 6c1307ec1..000000000 --- a/MercurialExtensions/fixutf8/fixutf8.py +++ /dev/null @@ -1,287 +0,0 @@ -# fixutf8.py - Make Mercurial compatible with non-utf8 locales -# -# Copyright 2009 Stefan Rusek -# Copyright 2015 SIL International -# -# This software may be used and distributed according to the terms -# of the GNU General Public License, incorporated herein by reference. -# -# To load the extension, add it to your .hgrc file: -# -# [extension] -# fixutf8 = -# -# This module needs no special configuration. - -''' -Fix incompatibilities with non-utf8 locales - -No special configuration is needed. -''' - -# -# How it works: -# -# There are 2 ways for strings to get into HG, either -# via that command line or filesystem filename. We want -# to make sure that both of those work. -# -# We use the WIN32 GetCommandLineW() to get the unicode -# version of the command line. And we wrapp all the -# places where we send or get filenames from the os and -# make sure we send UCS-16 to windows and convert back -# to UTF8. -# -# There are bugs in Python that make print() and -# sys.stdout.write() barf on unicode or utf8 when the -# output codepage is set to 65001 (UTF8). So we do all -# outputing via WriteFile() with the code page set to -# 65001. The trick is to save the existing codepage, -# and restore it before we return back to python. -# -# The result is that all of our strings are UTF8 all -# the time, and never explicitly converted to anything -# else. -# -import sys -from mercurial import extensions, scmutil -import mercurial.ui as _ui - -# The version of Mercurial first released with chorus allowed branches to -# be named with just a number. We used branch names to handle non-simultaneous -# upgrades to new model versions. Some chorus clients handled this by using -# the model version as the branch name. Changing the branch name triggers our -# model version upgrade logic. To avoid unnecessarily simulating an upgrade -# we will wrap and disable the check which forbids creating number only branches -# since Mercurial has to support them for backward compatibility in any case. -# This number only branching needs to happen on all platforms so we execute it first. -# The remainder of this plug-in is needed only on windows and is not executed on Linux. -# We can't add an extension without breaking backward compatability so we have added the number branch here. -def allownumberbranches_uisetup(): - extensions.wrapfunction(scmutil, "checknewlabel", checklabelwrapper) - -def checklabelwrapper(orig, repo, lbl, kind): - try: - int(lbl) - pass #let number only branches through without complaint - except ValueError: - orig(repo, lbl, kind) #let Mercurial test all other branch names - -# extsetup is only required on windows -def extsetup(): - if sys.platform == 'win32': - winextsetup() - -# uisetup on linux needs only to enable number only branches -def uisetup(ui): - allownumberbranches_uisetup() - # Handle the actual fixutf8 part of the extension if on windows - if sys.platform == 'win32': - winuisetup(ui) - -if sys.platform == 'win32': - import os, shutil - - from mercurial import demandimport - - demandimport.ignore.extend(["win32helper", "osutil"]) - - try: - import win32helper - import osutil as pureosutil - except ImportError: - sys.path.append(os.path.dirname(__file__)) - import win32helper - import osutil as pureosutil - - stdout = sys.stdout - - from mercurial import windows, util, osutil, dispatch, extensions, i18n, scmutil - import mercurial.ui as _ui - - def mapconvert(convert, canconvert, doc): - ''' - mapconvert(convert, canconvert, doc) -> - (a -> a) - - Returns a function that converts arbitrary arguments - using the specified conversion function. - - convert is a function to do actual convertions. - canconvert returns true if the arg can be converted. - doc is the doc string to attach to created function. - - The resulting function will return a converted list or - tuple if passed a list or tuple. - ''' - - def _convert(arg): - if canconvert(arg): - return convert(arg) - elif isinstance(arg, tuple): - return tuple(map(_convert, arg)) - elif isinstance(arg, list): - return map(_convert, arg) - return arg - - _convert.__doc__ = doc - return _convert - - tounicode1252 = mapconvert( - lambda s: s.decode('cp1252', 'strict'), - lambda s: isinstance(s, str), - "Convert a CP1252 byte string to Unicode") - - tounicode = mapconvert( - lambda s: s.decode('utf-8', 'strict'), - lambda s: isinstance(s, str), - "Convert a UTF-8 byte string to Unicode") - - fromunicode = mapconvert( - lambda s: s.encode('utf-8', 'ignore'), - lambda s: isinstance(s, unicode), - "Convert a Unicode string to a UTF-8 byte string") - - win32helper.fromunicode = fromunicode - -def test(): - if sys.platform != 'win32': - return - print win32helper.getargs() - print sys.argv - - uargs = ['P:\\hg-fixutf8\\fixutf8.py', 'thi\xc5\x9b', 'i\xc5\x9b', - '\xc4\x85', 't\xc4\x99\xc5\x9bt'] - for s in uargs: - win32helper.rawprint(win32helper.hStdOut, s + "\n") - -def utf8wrapper(orig, *args, **kargs): - try: - return fromunicode(orig(*tounicode(args), **kargs)) - except UnicodeDecodeError: - try: - return fromunicode(orig(*tounicode1252(args), **tounicode1252(kargs))) - except Exception, e: - # print "utf8wrapper 1252 decode error: Exception: ", repr(e) - raise - except Exception, e: - # print "utf8wrapper exception while calling %s" % orig.__name__ - raise - -def winuisetup(ui): - if sys.platform != 'win32' or not win32helper.consolehascp(): - return - - win32helper.uisetup(ui) - - try: - from mercurial import encoding - - encoding.encoding = 'utf8' - except ImportError: - util._encoding = "utf-8" - - def localize(h): - if hasattr(ui, '_buffers'): - getbuffers = lambda ui: ui._buffers - else: - getbuffers = lambda ui: ui.buffers - - def f(orig, ui, *args, **kwds): - if not getbuffers(ui): - win32helper.rawprint(h, ''.join(args)) - else: - orig(ui, *args, **kwds) - - return f - - extensions.wrapfunction(_ui.ui, "write", localize(win32helper.hStdOut)) - extensions.wrapfunction(_ui.ui, "write_err", localize(win32helper.hStdErr)) - -def winextsetup(): - oldlistdir = osutil.listdir - - osutil.listdir = pureosutil.listdir # force pure listdir - extensions.wrapfunction(osutil, "listdir", utf8wrapper) - - def normcase_utf8(path): - try: - return fromunicode(tounicode(path)).upper() - except UnicodeDecodeError: - try: - return fromunicode(tounicode1252(path)).upper() - except Exception, e: - print "utf8wrapper 1252 decode error: Exception: ", repr(e) - raise - except Exception, e: - print "utf8wrapper exception while calling %s" % orig.__name__ - raise - - windows.normcase = normcase_utf8 - util.normcase = normcase_utf8 - - # only get the real command line args if we are passed a real ui object - def disp_parse(orig, ui, args): - if type(ui) == _ui.ui: - args = win32helper.getUtf8NonConfigArgs()[-len(args):] - return orig(ui, args) - - extensions.wrapfunction(dispatch, "_parse", disp_parse) - - class posixfile_utf8(file): - def __init__(self, name, mode='rb'): - super(posixfile_utf8, self).__init__(tounicode(name), mode) - - util.posixfile = posixfile_utf8 - - if util.atomictempfile: - class atomictempfile_utf8(posixfile_utf8): - """file-like object that atomically updates a file - - All writes will be redirected to a temporary copy of the original - file. When rename is called, the copy is renamed to the original - name, making the changes visible. - """ - - def __init__(self, name, mode, createmode=None): - self.__name = name - self.temp = util.mktempcopy(name, emptyok=('w' in mode), - createmode=createmode) - posixfile_utf8.__init__(self, self.temp, mode) - - def close(self): - if not self.closed: - posixfile_utf8.close(self) - util.rename(self.temp, util.localpath(self.__name)) - - def __del__(self): - if not self.closed: - try: - os.unlink(self.temp) - except: pass - posixfile_utf8.close(self) - - util.atomictempfile = atomictempfile_utf8 - - # wrap the os and path functions - def wrapnames(mod, *names): - for name in names: - if hasattr(mod, name): - extensions.wrapfunction(mod, name, utf8wrapper) - - wrapnames(os.path, 'normpath', 'normcase', 'islink', 'dirname', - 'isdir', 'isfile', 'exists', 'abspath', 'realpath', 'split') - wrapnames(os, 'makedirs', 'lstat', 'unlink', 'chmod', 'stat', - 'mkdir', 'rename', 'removedirs', 'setcwd', 'open', - 'listdir', 'chdir', 'remove', 'access', 'rmdir', 'tempnam', 'utime' ) - wrapnames(shutil, 'copyfile', 'copymode', 'copystat') - extensions.wrapfunction(os, 'getcwd', win32helper.getcwdwrapper) - wrapnames(sys.modules['__builtin__'], 'open') - - def system_call(orig, cmd, environ={}, cwd=None, onerr=None, errprefix=None, out=None): - return win32helper.system(cmd) - - extensions.wrapfunction(util, 'system', system_call) - -if __name__ == "__main__": - test() diff --git a/MercurialExtensions/fixutf8/fixutf8.pyc b/MercurialExtensions/fixutf8/fixutf8.pyc deleted file mode 100644 index 083069c7f..000000000 Binary files a/MercurialExtensions/fixutf8/fixutf8.pyc and /dev/null differ diff --git a/MercurialExtensions/fixutf8/fixutf8.pyo b/MercurialExtensions/fixutf8/fixutf8.pyo deleted file mode 100644 index e6ddfd0d3..000000000 Binary files a/MercurialExtensions/fixutf8/fixutf8.pyo and /dev/null differ diff --git a/MercurialExtensions/fixutf8/osutil.py b/MercurialExtensions/fixutf8/osutil.py deleted file mode 100644 index 50da37ecd..000000000 --- a/MercurialExtensions/fixutf8/osutil.py +++ /dev/null @@ -1,42 +0,0 @@ -import os, sys -import stat as _stat - -def _mode_to_kind(mode): - if _stat.S_ISREG(mode): return _stat.S_IFREG - if _stat.S_ISDIR(mode): return _stat.S_IFDIR - if _stat.S_ISLNK(mode): return _stat.S_IFLNK - if _stat.S_ISBLK(mode): return _stat.S_IFBLK - if _stat.S_ISCHR(mode): return _stat.S_IFCHR - if _stat.S_ISFIFO(mode): return _stat.S_IFIFO - if _stat.S_ISSOCK(mode): return _stat.S_IFSOCK - return mode - -def listdir(path, stat=False, skip=None): - '''listdir(path, stat=False) -> list_of_tuples - - Return a sorted list containing information about the entries - in the directory. - - If stat is True, each element is a 3-tuple: - - (name, type, stat object) - - Otherwise, each element is a 2-tuple: - - (name, type) - ''' - result = [] - prefix = path - if not prefix.endswith(os.sep): - prefix += os.sep - names = [name.decode('utf-8') for name in os.listdir(path)] - names.sort() - for fn in names: - st = os.lstat(prefix + fn) - if fn == skip and _stat.S_ISDIR(st.st_mode): - return [] - if stat: - result.append((fn, _mode_to_kind(st.st_mode), st)) - else: - result.append((fn, _mode_to_kind(st.st_mode))) - return result diff --git a/MercurialExtensions/fixutf8/osutil.pyc b/MercurialExtensions/fixutf8/osutil.pyc deleted file mode 100644 index 704bb9fd7..000000000 Binary files a/MercurialExtensions/fixutf8/osutil.pyc and /dev/null differ diff --git a/MercurialExtensions/fixutf8/osutil.pyo b/MercurialExtensions/fixutf8/osutil.pyo deleted file mode 100644 index 53e18f7b6..000000000 Binary files a/MercurialExtensions/fixutf8/osutil.pyo and /dev/null differ diff --git a/MercurialExtensions/fixutf8/win32helper.py b/MercurialExtensions/fixutf8/win32helper.py deleted file mode 100644 index f442a5808..000000000 --- a/MercurialExtensions/fixutf8/win32helper.py +++ /dev/null @@ -1,473 +0,0 @@ -# -# Unicode WIN32 api calls -# -# Copyright 2015 Jason Naylor -# -# This software may be used and distributed according to the terms -# of the GNU General Public License, incorporated herein by reference. -# -# Portions of this file were originally licensed as follows: -# -# Copyright (C) 2010-2011 The IPython Development Team -# -# Distributed under the terms of the 3-Clause BSD -# - -import sys -from ctypes import * -from ctypes.wintypes import * - -# stdlib -import os, sys, threading -import ctypes, msvcrt - -usecpmap = True -mapcp = None - -# Using ctypes we can call the unicode versions of win32 api calls that -# python does not call. -if sys.platform == "win32" and windll: - LPDWORD = POINTER(DWORD) - LPHANDLE = POINTER(HANDLE) - ULONG_PTR = POINTER(ULONG) - - class SECURITY_ATTRIBUTES(ctypes.Structure): - _fields_ = [("nLength", DWORD), - ("lpSecurityDescriptor", LPVOID), - ("bInheritHandle", BOOL)] - - LPSECURITY_ATTRIBUTES = POINTER(SECURITY_ATTRIBUTES) - - class STARTUPINFO(ctypes.Structure): - _fields_ = [("cb", DWORD), - ("lpReserved", LPCWSTR), - ("lpDesktop", LPCWSTR), - ("lpTitle", LPCWSTR), - ("dwX", DWORD), - ("dwY", DWORD), - ("dwXSize", DWORD), - ("dwYSize", DWORD), - ("dwXCountChars", DWORD), - ("dwYCountChars", DWORD), - ("dwFillAttribute", DWORD), - ("dwFlags", DWORD), - ("wShowWindow", WORD), - ("cbReserved2", WORD), - ("lpReserved2", LPVOID), - ("hStdInput", HANDLE), - ("hStdOutput", HANDLE), - ("hStdError", HANDLE)] - - LPSTARTUPINFO = POINTER(STARTUPINFO) - - class PROCESS_INFORMATION(ctypes.Structure): - _fields_ = [("hProcess", HANDLE), - ("hThread", HANDLE), - ("dwProcessId", DWORD), - ("dwThreadId", DWORD)] - - LPPROCESS_INFORMATION = POINTER(PROCESS_INFORMATION) - - LPWSTR = c_wchar_p - LPCWSTR = c_wchar_p - LPCSTR = c_char_p - INT = c_int - UINT = c_uint - BOOL = INT - DWORD = UINT - HANDLE = c_void_p - - # Win32 API constants needed - ERROR_HANDLE_EOF = 38 - ERROR_BROKEN_PIPE = 109 - ERROR_NO_DATA = 232 - HANDLE_FLAG_INHERIT = 0x0001 - STARTF_USESTDHANDLES = 0x0100 - CREATE_SUSPENDED = 0x0004 - CREATE_NEW_CONSOLE = 0x0010 - CREATE_NO_WINDOW = 0x08000000 - STILL_ACTIVE = 259 - WAIT_TIMEOUT = 0x0102 - WAIT_FAILED = 0xFFFFFFFF - INFINITE = 0xFFFFFFFF - DUPLICATE_SAME_ACCESS = 0x00000002 - ENABLE_ECHO_INPUT = 0x0004 - ENABLE_LINE_INPUT = 0x0002 - ENABLE_PROCESSED_INPUT = 0x0001 - - # Win32 API functions needed - GetLastError = ctypes.windll.kernel32.GetLastError - GetLastError.argtypes = [] - GetLastError.restype = DWORD - - CreateFile = ctypes.windll.kernel32.CreateFileW - CreateFile.argtypes = [LPCWSTR, DWORD, DWORD, LPVOID, DWORD, DWORD, HANDLE] - CreateFile.restype = HANDLE - - CreatePipe = ctypes.windll.kernel32.CreatePipe - CreatePipe.argtypes = [POINTER(HANDLE), POINTER(HANDLE), - LPSECURITY_ATTRIBUTES, DWORD] - CreatePipe.restype = BOOL - - CreateProcess = ctypes.windll.kernel32.CreateProcessW - CreateProcess.argtypes = [LPCWSTR, LPCWSTR, LPSECURITY_ATTRIBUTES, - LPSECURITY_ATTRIBUTES, BOOL, DWORD, LPVOID, LPCWSTR, LPSTARTUPINFO, - LPPROCESS_INFORMATION] - CreateProcess.restype = BOOL - - GetExitCodeProcess = ctypes.windll.kernel32.GetExitCodeProcess - GetExitCodeProcess.argtypes = [HANDLE, LPDWORD] - GetExitCodeProcess.restype = BOOL - - GetCurrentProcess = ctypes.windll.kernel32.GetCurrentProcess - GetCurrentProcess.argtypes = [] - GetCurrentProcess.restype = HANDLE - - ResumeThread = ctypes.windll.kernel32.ResumeThread - ResumeThread.argtypes = [HANDLE] - ResumeThread.restype = DWORD - - ReadFile = ctypes.windll.kernel32.ReadFile - ReadFile.argtypes = [HANDLE, LPVOID, DWORD, LPDWORD, LPVOID] - ReadFile.restype = BOOL - - WriteFile = ctypes.windll.kernel32.WriteFile - WriteFile.argtypes = [HANDLE, LPVOID, DWORD, LPDWORD, LPVOID] - WriteFile.restype = BOOL - - GetConsoleMode = ctypes.windll.kernel32.GetConsoleMode - GetConsoleMode.argtypes = [HANDLE, LPDWORD] - GetConsoleMode.restype = BOOL - - SetConsoleMode = ctypes.windll.kernel32.SetConsoleMode - SetConsoleMode.argtypes = [HANDLE, DWORD] - SetConsoleMode.restype = BOOL - - FlushConsoleInputBuffer = ctypes.windll.kernel32.FlushConsoleInputBuffer - FlushConsoleInputBuffer.argtypes = [HANDLE] - FlushConsoleInputBuffer.restype = BOOL - - WaitForSingleObject = ctypes.windll.kernel32.WaitForSingleObject - WaitForSingleObject.argtypes = [HANDLE, DWORD] - WaitForSingleObject.restype = DWORD - - DuplicateHandle = ctypes.windll.kernel32.DuplicateHandle - DuplicateHandle.argtypes = [HANDLE, HANDLE, HANDLE, LPHANDLE, - DWORD, BOOL, DWORD] - DuplicateHandle.restype = BOOL - - SetHandleInformation = ctypes.windll.kernel32.SetHandleInformation - SetHandleInformation.argtypes = [HANDLE, DWORD, DWORD] - SetHandleInformation.restype = BOOL - - CloseHandle = ctypes.windll.kernel32.CloseHandle - CloseHandle.argtypes = [HANDLE] - CloseHandle.restype = BOOL - - CommandLineToArgvW = ctypes.windll.shell32.CommandLineToArgvW - CommandLineToArgvW.argtypes = [LPCWSTR, POINTER(ctypes.c_int)] - CommandLineToArgvW.restype = POINTER(LPCWSTR) - - LocalFree = ctypes.windll.kernel32.LocalFree - LocalFree.argtypes = [HLOCAL] - LocalFree.restype = HLOCAL - - prototype = WINFUNCTYPE(LPCWSTR) - GetCommandLine = prototype(("GetCommandLineW", windll.kernel32)) - - prototype = WINFUNCTYPE(POINTER(LPCWSTR), LPCWSTR, POINTER(INT)) - CommandLineToArgv = prototype(("CommandLineToArgvW", windll.shell32)) - - prototype = WINFUNCTYPE(BOOL, UINT) - SetConsoleOutputCP = prototype(("SetConsoleOutputCP", windll.kernel32)) - - prototype = WINFUNCTYPE(UINT) - GetConsoleOutputCP = prototype(("GetConsoleOutputCP", windll.kernel32)) - - prototype = WINFUNCTYPE(INT) - GetLastError = prototype(("GetLastError", windll.kernel32)) - - prototype = WINFUNCTYPE(HANDLE, DWORD) - GetStdHandle = prototype(("GetStdHandle", windll.kernel32)) - - prototype = WINFUNCTYPE(BOOL, HANDLE, LPCSTR, DWORD, - POINTER(DWORD), DWORD) - WriteFile = prototype(("WriteFile", windll.kernel32)) - - prototype = WINFUNCTYPE(DWORD, DWORD, LPWSTR) - GetCurrentDirectory = prototype(("GetCurrentDirectoryW", windll.kernel32)) - - hStdOut = GetStdHandle(0xFFFFfff5) - hStdErr = GetStdHandle(0xFFFFfff4) - - def getcwdwrapper(orig): - chars = GetCurrentDirectory(0, None) + 1 - p = create_unicode_buffer(chars) - if 0 == GetCurrentDirectory(chars, p): - err = GetLastError() - if err < 0: - raise pywintypes.error(err, "GetCurrentDirectory", - win32api.FormatMessage(err)) - return fromunicode(p.value) - - def InternalWriteFile(h, s): - limit = 0x4000 - l = len(s) - start = 0 - while start < l: - end = start + limit - buffer = s[start:end] - c = DWORD(0) - if not WriteFile(h, buffer, len(buffer), byref(c), 0): - err = GetLastError() - if err < 0: - raise pywintypes.error(err, "WriteFile", - win32api.FormatMessage(err)) - start = start + c.value + 1 - else: - start = start + len(buffer) - - def consolehascp(): - return 0 != GetConsoleOutputCP() - - def rawprint(h, s): - InternalWriteFile(h, s) - - def getUtf8NonConfigArgs(): - ''' - getargs() -> [args] - - Returns an array of utf8 encoded arguments passed on the command line. - - Skips any --config argument pairs since this is used in a method where - those arguments are already removed - ''' - c = INT(0) - pargv = CommandLineToArgv(GetCommandLine(), byref(c)) - cleanArguments = [] - iterator = iter(xrange(1, c.value)) - for i in iterator: - if pargv[i] != "--config": - cleanArguments.append(fromunicode(pargv[i])) - else: - iterator.next() # skip appending the --config and whatever argument followed it - return cleanArguments - - def system_call(orig, cmd, environ={}, cwd=None, onerr=None, errprefix=None, out=None): - # Overridden to handle the call out to the system merge program, all other parameters - # are irrelevant - system(cmd) - - # This class handles all the ugly win32 api required to make a system call with non-ascii args - class Win32ShellCommandController(object): - #Runs a shell command in a 'with' context. - - def __init__(self, cmd, mergeout=False): - """Initializes the shell command controller. - The cmd is the program to execute, and mergeout is - whether to blend stdout and stderr into one output - in stdout. Merging them together in this fashion more - reliably keeps stdout and stderr in the correct order - especially for interactive shell usage. - """ - self.cmd = cmd - self.mergeout = mergeout - - def __enter__(self): - cmd = self.cmd - mergeout = self.mergeout - - self.hstdout, self.hstderr = None, None - self.piProcInfo = None - try: - p_hstdout, c_hstdout, p_hstderr, \ - c_hstderr = [None] * 4 - - # SECURITY_ATTRIBUTES with inherit handle set to True - saAttr = SECURITY_ATTRIBUTES() - saAttr.nLength = ctypes.sizeof(saAttr) - saAttr.bInheritHandle = True - saAttr.lpSecurityDescriptor = None - - def create_pipe(uninherit): - """Creates a Windows pipe, which consists of two handles. - The 'uninherit' parameter controls which handle is not - inherited by the child process. - """ - handles = HANDLE(), HANDLE() - if not CreatePipe(ctypes.byref(handles[0]), - ctypes.byref(handles[1]), ctypes.byref(saAttr), 0): - raise ctypes.WinError() - if not SetHandleInformation(handles[uninherit], - HANDLE_FLAG_INHERIT, 0): - raise ctypes.WinError() - return handles[0].value, handles[1].value - - p_hstdout, c_hstdout = create_pipe(uninherit=0) - # 'mergeout' signals that stdout and stderr should be merged. - # We do that by using one pipe for both of them. - if mergeout: - c_hstderr = HANDLE() - if not DuplicateHandle(GetCurrentProcess(), c_hstdout, - GetCurrentProcess(), ctypes.byref(c_hstderr), - 0, True, DUPLICATE_SAME_ACCESS): - raise ctypes.WinError() - else: - p_hstderr, c_hstderr = create_pipe(uninherit=0) - - # Create the process object - piProcInfo = PROCESS_INFORMATION() - siStartInfo = STARTUPINFO() - siStartInfo.cb = ctypes.sizeof(siStartInfo) - siStartInfo.hStdOutput = c_hstdout - siStartInfo.hStdError = c_hstderr - siStartInfo.dwFlags = STARTF_USESTDHANDLES - dwCreationFlags = CREATE_SUSPENDED | CREATE_NO_WINDOW # | CREATE_NEW_CONSOLE - - if not CreateProcess(None, - cmd, - None, None, True, dwCreationFlags, - None, None, ctypes.byref(siStartInfo), - ctypes.byref(piProcInfo)): - raise ctypes.WinError() - - # Close this process's versions of the child handles - CloseHandle(c_hstdout) - c_hstdout = None - if c_hstderr is not None: - CloseHandle(c_hstderr) - c_hstderr = None - - # Transfer ownership of the parent handles to the object - self.hstdout = p_hstdout - p_hstdout = None - if not mergeout: - self.hstderr = p_hstderr - p_hstderr = None - self.piProcInfo = piProcInfo - - finally: - if p_hstdout: - CloseHandle(p_hstdout) - if c_hstdout: - CloseHandle(c_hstdout) - if p_hstderr: - CloseHandle(p_hstderr) - if c_hstderr: - CloseHandle(c_hstderr) - - return self - - - def _stdout_thread(self, handle, func): - # Allocate the output buffer - data = ctypes.create_string_buffer(4096) - while True: - bytesRead = DWORD(0) - if not ReadFile(handle, data, 4096, - ctypes.byref(bytesRead), None): - le = GetLastError() - if le == ERROR_BROKEN_PIPE: - return - else: - raise ctypes.WinError() - # FIXME: Python3 - s = data.value[0:bytesRead.value] - # print("\nv: %s" % repr(s), file=sys.stderr) - func(fromunicode(s)) - - def run(self, stdout_func=None, stderr_func=None): - """Runs the process, using the provided functions for I/O. - The functions stdout_func and stderr_func are called whenever - something is printed to stdout or stderr, respectively. - These functions are called from different threads but because - they contain code that must be interpreted they will not run - concurrently because of the GIL. - """ - if stdout_func is None and stderr_func is None: - return self._run_stdio() - - if stderr_func is not None and self.mergeout: - raise RuntimeError("Shell command was initiated with " - "merged stdout, but a separate stderr_func " - "was provided to the run() method") - - # Create a thread for each input/output handle - threads = [] - threads.append(threading.Thread(target=self._stdout_thread, - args=(self.hstdout, stdout_func))) - if not self.mergeout: - if stderr_func is None: - stderr_func = stdout_func - threads.append(threading.Thread(target=self._stdout_thread, - args=(self.hstderr, stderr_func))) - # Start the I/O threads and the process - if ResumeThread(self.piProcInfo.hThread) == 0xFFFFFFFF: - raise ctypes.WinError() - for thread in threads: - thread.start() - # Wait for the process to complete - if WaitForSingleObject(self.piProcInfo.hProcess, INFINITE) == \ - WAIT_FAILED: - raise ctypes.WinError() - # Wait for the I/O threads to complete - for thread in threads: - thread.join() - - exitCode = DWORD() - GetExitCodeProcess(self.piProcInfo.hProcess, ctypes.byref(exitCode)) - return exitCode - - def _stdout_raw(self, s): - """Writes the string to stdout""" - print s - sys.stdout.flush() - - def _stderr_raw(self, s): - """Writes the string to stdout""" - sys.stderr.write(s) - sys.stderr.flush() - - def _run_stdio(self): - """Runs the process using the system standard I/O. - IMPORTANT: stdin needs to be asynchronous, so the Python - sys.stdin object is not used. Instead, - msvcrt.kbhit/getwch are used asynchronously. - """ - - if self.mergeout: - return self.run(stdout_func=self._stdout_raw) - else: - return self.run(stdout_func=self._stdout_raw, - stderr_func=self._stderr_raw) - - - def __exit__(self, exc_type, exc_value, traceback): - if self.hstdout: - CloseHandle(self.hstdout) - self.hstdout = None - if self.hstderr: - CloseHandle(self.hstderr) - self.hstderr = None - if self.piProcInfo is not None: - CloseHandle(self.piProcInfo.hProcess) - CloseHandle(self.piProcInfo.hThread) - self.piProcInfo = None - - - def system(cmd): - with Win32ShellCommandController(cmd) as scc: - retval = scc.run() - return retval.value -else: - win32rawprint = False - win32getargs = False - hStdOut = 0 - hStdErr = 0 - -def uisetup(ui): - global usecpmap, mapcp - usecpmap = ui.config('fixutf8', 'usecpmap', usecpmap) - if usecpmap: - import cpmap - mapcp = cpmap.reduce diff --git a/MercurialExtensions/fixutf8/win32helper.pyc b/MercurialExtensions/fixutf8/win32helper.pyc deleted file mode 100644 index 9ffe280d7..000000000 Binary files a/MercurialExtensions/fixutf8/win32helper.pyc and /dev/null differ diff --git a/MercurialExtensions/fixutf8/win32helper.pyo b/MercurialExtensions/fixutf8/win32helper.pyo deleted file mode 100644 index dc8ea9bfb..000000000 Binary files a/MercurialExtensions/fixutf8/win32helper.pyo and /dev/null differ diff --git a/README.md b/README.md index 9dd2731cc..9868173f8 100644 --- a/README.md +++ b/README.md @@ -85,13 +85,9 @@ To send and receive with the test server over the Internet, set the following en ## Developers -### Mailing List - -Sign up here: https://groups.google.com/forum/#!forum/chorusdev - ### Road Map & Workflow -https://trello.com/board/chorus/4f3a90277ae2b69b010988ac +https://github.com/sillsdev/chorus/issues ### Coding Standards @@ -103,50 +99,18 @@ Chorus is written in C#. The UI widgets use Windows Forms, but you could make yo different platform and just use the engine. After cloning the project you should now have a solution that you can build using any edition -of Visual Studio 2010, including the free Express version. We could help you do it in VS 2008, -if necessary. +of Visual Studio 2019, including the free Express version, or Visual Studio Code. On Linux you can open and build the solution in MonoDevelop, or run the `build/TestBuild.sh` script. -### Getting up-to-date libraries - -The source tree contains a script that downloads all necessary dependencies. - -#### Windows - -Download "git bash" from "https://git-scm.com/download/win" and open a "git bash" window, then change into the build directory and run the `buildupdate.win.sh` script: - - cd /c/dev/chorus/build - ./buildupdate.win.sh - -Alternately, if you are working on libpalaso or another dependency, you can update to your local -build using `UpdateDependencies.bat`, which is run automatically when you run `GetAndBuildThis.bat`: - - cd c:\dev\chorus - UpdateDependencies.bat +### Building client projects against locally-built artifacts -##### Mercurial + * Set an enviroment variable `LOCAL_NUGET_REPO` with the path to a folder on your computer (or local network) to publish locally-built packages + * See [these instructions](https://docs.microsoft.com/en-us/nuget/hosting-packages/local-feeds) to enable local package sources + * `build /t:pack` will pack nuget packages and publish them to `LOCAL_NUGET_REPO` -If developing on windows, unzip the file `lib/common/mercurial.zip` into `output/Debug` (or `output/Release`), so that you'll end up with a subdirectory `output/Debug/Mercurial`. That way, you know the tests are running against the approved version of Mercurial, not whatever you happen to have on your machine. Then, open C:\dev\chorus\Mercurial\default.d\cacerts.rc and change the path to C:\dev\chorus\Mercurial\cacert.pem (required to send and receive to the Internet using the High bandwidth option). +Further instructions at https://github.com/sillsdev/libpalaso/wiki/Developing-with-locally-modified-nuget-packages -#### Linux - -In order to build and run all the tests on Linux the SIL mono package will need to be installed. -It can be found at http://packages.sil.org/ -That version of mono will be used when you run `build/TestBuild.sh` - -Open a terminal window, change into the build directory and run the `buildupdate.mono.sh` script: - - cd chorus/build - ./buildupdate.mono.sh - -Alternately, if you are working on libpalaso or another dependency, you can update to your local -build using `UpdateDependencies.sh`: - - cd chorus - ./UpdateDependencies.sh - -##### Python +### Python Beginning with Ubuntu 20.04 (Focal), you will need to `sudo apt install python-is-python2` so that Mercurial can run. - diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 000000000..7035775f0 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,34 @@ +version: '{build}' +branches: + only: + - master +image: Visual Studio 2019 +init: + - cmd: >- + set GITVERSION_BUILD_NUMBER=%APPVEYOR_BUILD_NUMBER% + + if defined APPVEYOR_PULL_REQUEST_NUMBER set GitVersion_NoNormalizeEnabled=true +nuget: + disable_publish_on_pr: true + disable_publish_octopus: true +before_build: + - cmd: >- + if defined APPVEYOR_PULL_REQUEST_NUMBER git checkout -b PR-%APPVEYOR_PULL_REQUEST_NUMBER% +build: + project: build/Chorus.proj + publish_nuget: true + publish_nuget_symbols: true + use_snupkg_format: true + verbosity: minimal +test: off +artifacts: +- path: output/*nupkg + name: nuget +deploy: +- provider: Environment + name: sil-lsdev nuget +notifications: +- provider: GitHubPullRequest + on_build_success: false + on_build_failure: false + on_build_status_changed: false diff --git a/build/Chorus.dep b/build/Chorus.dep new file mode 100644 index 000000000..ccad7fd4c --- /dev/null +++ b/build/Chorus.dep @@ -0,0 +1,16 @@ +# This file lists dependencies +# It can be edited with the BuildDependencyManager application. +# See https://github.com/ermshiperete/BuildDependency for more information. +# Edited with version 0.4.3 (6cb2078) + +[[TC]] +Type=TeamCity +Url=https://build.palaso.org + +[TC::bt216] +Name=Chorus-Documentation +RevisionName=lastSuccessful +RevisionValue=latest.lastSuccessful +Condition=Windows +Path=*.chm => lib + diff --git a/build/Chorus.proj b/build/Chorus.proj index 441a7fd68..12cfbbb3e 100644 --- a/build/Chorus.proj +++ b/build/Chorus.proj @@ -1,73 +1,57 @@ - + $(MSBuildProjectDirectory)/.. $(teamcity_build_checkoutDir) - 1.2.3.4 - - 3.0 - - - - - - - - - - - - - - - Chorus.sln $(RootDir)/$(Solution) ChorusLibrary Chorus chorus - DebugMono - Release + Release KnownMonoIssue, SkipOnTeamCity,SkipOnBuildServer,SkipOnTeamCityRandomTestFailure,$(ExtraExcludeCategories) true false - - - - - - - - + $(RootDir)/output/$(Configuration) + true + false - + true + false + - - - + - + + + + + - - - + + + + + - - + + - - $(RootDir)/output/$(Configuration) - - + + + + + + - @@ -81,9 +65,9 @@ - - + @@ -100,7 +84,7 @@ - + - + + - - 2.6.4 - $(RootDir)/packages/NUnit.Runners.Net4.$(NUnitVersion) - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - + UseNUnit3Xml="false" + OutputXmlFile="$(RootDir)/output/$(Configuration)/net461/TestResults.xml" + TeamCity="$(TeamCity)" + Verbose="true" /> - + - + ReplacementText ="Property_ProductVersion = "$(GitVersion_AssemblySemFileVer)"" /> + - + + ReplacementText="Property_ProductVersion = "$(GitVersion_AssemblySemFileVer)"" /> - + @@ -193,13 +150,14 @@ - + @@ -209,6 +167,7 @@ ComponentGroupId="MercurialExtensions" RootDirectory="$(RootDir)\MercurialExtensions" OutputFilePath="$(RootDir)\src\Installer\GeneratedMercurialExtensions.wxs" + IgnoreRegExPattern="IGNOREME|\.gitignore" MatchRegExPattern=".*"> @@ -231,9 +190,6 @@ - - - @@ -248,10 +204,10 @@ - + - + @@ -269,9 +225,16 @@ WorkingDirectory="$(TarBaseDir)" /> + + + + diff --git a/build/NuGet.targets b/build/NuGet.targets index 65395b2c7..c122dc6ca 100644 --- a/build/NuGet.targets +++ b/build/NuGet.targets @@ -1,5 +1,5 @@ - + $(MSBuildProjectDirectory)/../ @@ -13,13 +13,6 @@ true - - - - - - - $(MSBuildThisFileDirectory) $(ProjectDir)packages.config @@ -27,10 +20,8 @@ $(NuGetToolsPath)/nuget.exe - @(PackageSource) - "$(NuGetExePath)" - mono --runtime=v4.0.30319 $(NuGetExePath) + mono $(NuGetExePath) https://dist.nuget.org/win-x86-commandline/latest/nuget.exe @@ -55,10 +46,14 @@ Condition="'$(OS)' != 'Windows_NT'" /> + + + + - - diff --git a/build/SIL.BuildTasks.dll b/build/SIL.BuildTasks.dll deleted file mode 100644 index 356318655..000000000 Binary files a/build/SIL.BuildTasks.dll and /dev/null differ diff --git a/build/TestBuild.sh b/build/TestBuild.sh index 86de0d6bc..3f4d29cd6 100755 --- a/build/TestBuild.sh +++ b/build/TestBuild.sh @@ -1,9 +1,7 @@ #!/bin/bash cd "$(dirname "$0")/.." -build/buildupdate.mono.sh -export MONO_PREFIX=/usr -. environ -# root=$PWD -# cd build -# xbuild "/target:${2:-Clean;Compile}" /property:Configuration="${1:-Debug}Mono" /property:RootDir=$root /property:BUILD_NUMBER="1.5.1.abcd" Chorus.proj -xbuild /t:Compile /property:Configuration=DebugMono /property:BUILD_NUMBER="1.5.1.abcd" build/Chorus.proj +if [[ $(mono --version 2>/dev/null | head -1 | cut -f 5 -d ' ') < 6 ]]; then + . environ +fi +cd build +msbuild "/target:${2:-Clean;Build}" /property:Configuration="${1:-Debug}" Chorus.proj diff --git a/build/buildupdate.mono.sh b/build/buildupdate.mono.sh deleted file mode 100755 index c9528a3c1..000000000 --- a/build/buildupdate.mono.sh +++ /dev/null @@ -1,135 +0,0 @@ -#!/bin/bash -# server=build.palaso.org -# build_type=Chorus_Linux64masterContinuous -# root_dir=.. -# Auto-generated by https://github.com/chrisvire/BuildUpdate. -# Do not edit this file by hand! - -cd "$(dirname "$0")" - -# *** Functions *** -force=0 -clean=0 - -while getopts fc opt; do -case $opt in -f) force=1 ;; -c) clean=1 ;; -esac -done - -shift $((OPTIND - 1)) - -copy_auto() { -if [ "$clean" == "1" ] -then -echo cleaning $2 -rm -f ""$2"" -else -where_curl=$(type -P curl) -where_wget=$(type -P wget) -if [ "$where_curl" != "" ] -then -copy_curl "$1" "$2" -elif [ "$where_wget" != "" ] -then -copy_wget "$1" "$2" -else -echo "Missing curl or wget" -exit 1 -fi -fi -} - -copy_curl() { -echo "curl: $2 <= $1" -if [ -e "$2" ] && [ "$force" != "1" ] -then -curl -# -L -z "$2" -o "$2" "$1" -else -curl -# -L -o "$2" "$1" -fi -} - -copy_wget() { -echo "wget: $2 <= $1" -f1=$(basename $1) -f2=$(basename $2) -cd $(dirname $2) -wget -q -L -N "$1" -# wget has no true equivalent of curl's -o option. -# Different versions of wget handle (or not) % escaping differently. -# A URL query is the only reason why $f1 and $f2 should differ. -if [ "$f1" != "$f2" ]; then mv $f2\?* $f2; fi -cd - -} - - -# *** Results *** -# build: chorus-linux64-master Continuous (Chorus_Linux64masterContinuous) -# project: Chorus -# URL: https://build.palaso.org/viewType.html?buildTypeId=Chorus_Linux64masterContinuous -# VCS: https://github.com/sillsdev/chorus.git [master] -# dependencies: -# [0] build: icucil-linux64-Continuous (bt281) -# project: Libraries -# URL: https://build.palaso.org/viewType.html?buildTypeId=bt281 -# clean: false -# revision: latest.lastSuccessful -# paths: {"*.dll"=>"lib/ReleaseMono", "*.config"=>"lib/ReleaseMono"} -# VCS: https://github.com/sillsdev/icu-dotnet [master] -# [1] build: icucil-linux64-Continuous (bt281) -# project: Libraries -# URL: https://build.palaso.org/viewType.html?buildTypeId=bt281 -# clean: false -# revision: latest.lastSuccessful -# paths: {"*.dll"=>"lib/DebugMono", "*.config"=>"lib/DebugMono"} -# VCS: https://github.com/sillsdev/icu-dotnet [master] -# [2] build: palaso-linux64-master Continuous (Libpalaso_PalasoLinux64masterContinuous) -# project: libpalaso -# URL: https://build.palaso.org/viewType.html?buildTypeId=Libpalaso_PalasoLinux64masterContinuous -# clean: false -# revision: fw-9.1.1.tcbuildtag -# paths: {"NDesk.DBus.dll*"=>"lib/ReleaseMono", "SIL.Core.dll"=>"lib/ReleaseMono", "SIL.Core.Desktop.dll"=>"lib/ReleaseMono", "SIL.TestUtilities.dll"=>"lib/ReleaseMono", "SIL.Windows.Forms.dll"=>"lib/ReleaseMono", "SIL.Windows.Forms.GeckoBrowserAdapter.dll"=>"lib/ReleaseMono", "SIL.Lift.dll"=>"lib/ReleaseMono", "SIL.WritingSystems.dll"=>"lib/ReleaseMono", "SIL.WritingSystems.Tests.dll"=>"lib/ReleaseMono", "L10NSharp.dll"=>"lib/ReleaseMono", "debug/NDesk.DBus.dll*"=>"lib/DebugMono", "debug/SIL.Core.dll"=>"lib/DebugMono", "debug/SIL.Core.pdb"=>"lib/DebugMono", "debug/SIL.Core.Desktop.dll"=>"lib/DebugMono", "debug/SIL.Core.Desktop.pdb"=>"lib/DebugMono", "debug/SIL.TestUtilities.dll"=>"lib/DebugMono", "debug/SIL.TestUtilities.pdb"=>"lib/DebugMono", "debug/SIL.Windows.Forms.dll"=>"lib/DebugMono", "debug/SIL.Windows.Forms.pdb"=>"lib/DebugMono", "debug/SIL.Windows.Forms.GeckoBrowserAdapter.dll"=>"lib/DebugMono", "debug/SIL.Windows.Forms.GeckoBrowserAdapter.pdb"=>"lib/DebugMono", "debug/SIL.Lift.dll"=>"lib/DebugMono", "debug/SIL.Lift.pdb"=>"lib/DebugMono", "debug/SIL.WritingSystems.dll"=>"lib/DebugMono", "debug/SIL.WritingSystems.pdb"=>"lib/DebugMono", "debug/SIL.WritingSystems.Tests.dll"=>"lib/DebugMono", "debug/SIL.WritingSystems.Tests.pdb"=>"lib/DebugMono", "debug/L10NSharp.dll"=>"lib/DebugMono"} -# VCS: https://github.com/sillsdev/libpalaso.git [refs/heads/master] - -# make sure output directories exist -mkdir -p ../lib/DebugMono -mkdir -p ../lib/ReleaseMono - -# download artifact dependencies -copy_auto http://build.palaso.org/guestAuth/repository/download/bt281/latest.lastSuccessful/icu.net.dll ../lib/ReleaseMono/icu.net.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/bt281/latest.lastSuccessful/icu.net.dll.config ../lib/ReleaseMono/icu.net.dll.config -copy_auto http://build.palaso.org/guestAuth/repository/download/bt281/latest.lastSuccessful/icu.net.dll ../lib/DebugMono/icu.net.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/bt281/latest.lastSuccessful/icu.net.dll.config ../lib/DebugMono/icu.net.dll.config -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoLinux64masterContinuous/fw-9.1.1.tcbuildtag/NDesk.DBus.dll ../lib/ReleaseMono/NDesk.DBus.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoLinux64masterContinuous/fw-9.1.1.tcbuildtag/NDesk.DBus.dll.config ../lib/ReleaseMono/NDesk.DBus.dll.config -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoLinux64masterContinuous/fw-9.1.1.tcbuildtag/SIL.Core.dll ../lib/ReleaseMono/SIL.Core.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoLinux64masterContinuous/fw-9.1.1.tcbuildtag/SIL.Core.Desktop.dll ../lib/ReleaseMono/SIL.Core.Desktop.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoLinux64masterContinuous/fw-9.1.1.tcbuildtag/SIL.TestUtilities.dll ../lib/ReleaseMono/SIL.TestUtilities.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoLinux64masterContinuous/fw-9.1.1.tcbuildtag/SIL.Windows.Forms.dll ../lib/ReleaseMono/SIL.Windows.Forms.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoLinux64masterContinuous/fw-9.1.1.tcbuildtag/SIL.Windows.Forms.GeckoBrowserAdapter.dll ../lib/ReleaseMono/SIL.Windows.Forms.GeckoBrowserAdapter.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoLinux64masterContinuous/fw-9.1.1.tcbuildtag/SIL.Lift.dll ../lib/ReleaseMono/SIL.Lift.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoLinux64masterContinuous/fw-9.1.1.tcbuildtag/SIL.WritingSystems.dll ../lib/ReleaseMono/SIL.WritingSystems.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoLinux64masterContinuous/fw-9.1.1.tcbuildtag/SIL.WritingSystems.Tests.dll ../lib/ReleaseMono/SIL.WritingSystems.Tests.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoLinux64masterContinuous/fw-9.1.1.tcbuildtag/L10NSharp.dll ../lib/ReleaseMono/L10NSharp.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoLinux64masterContinuous/fw-9.1.1.tcbuildtag/debug/NDesk.DBus.dll ../lib/DebugMono/NDesk.DBus.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoLinux64masterContinuous/fw-9.1.1.tcbuildtag/debug/NDesk.DBus.dll.config ../lib/DebugMono/NDesk.DBus.dll.config -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoLinux64masterContinuous/fw-9.1.1.tcbuildtag/debug/SIL.Core.dll ../lib/DebugMono/SIL.Core.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoLinux64masterContinuous/fw-9.1.1.tcbuildtag/debug/SIL.Core.pdb ../lib/DebugMono/SIL.Core.pdb -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoLinux64masterContinuous/fw-9.1.1.tcbuildtag/debug/SIL.Core.Desktop.dll ../lib/DebugMono/SIL.Core.Desktop.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoLinux64masterContinuous/fw-9.1.1.tcbuildtag/debug/SIL.Core.Desktop.pdb ../lib/DebugMono/SIL.Core.Desktop.pdb -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoLinux64masterContinuous/fw-9.1.1.tcbuildtag/debug/SIL.TestUtilities.dll ../lib/DebugMono/SIL.TestUtilities.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoLinux64masterContinuous/fw-9.1.1.tcbuildtag/debug/SIL.TestUtilities.pdb ../lib/DebugMono/SIL.TestUtilities.pdb -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoLinux64masterContinuous/fw-9.1.1.tcbuildtag/debug/SIL.Windows.Forms.dll ../lib/DebugMono/SIL.Windows.Forms.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoLinux64masterContinuous/fw-9.1.1.tcbuildtag/debug/SIL.Windows.Forms.pdb ../lib/DebugMono/SIL.Windows.Forms.pdb -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoLinux64masterContinuous/fw-9.1.1.tcbuildtag/debug/SIL.Windows.Forms.GeckoBrowserAdapter.dll ../lib/DebugMono/SIL.Windows.Forms.GeckoBrowserAdapter.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoLinux64masterContinuous/fw-9.1.1.tcbuildtag/debug/SIL.Windows.Forms.GeckoBrowserAdapter.pdb ../lib/DebugMono/SIL.Windows.Forms.GeckoBrowserAdapter.pdb -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoLinux64masterContinuous/fw-9.1.1.tcbuildtag/debug/SIL.Lift.dll ../lib/DebugMono/SIL.Lift.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoLinux64masterContinuous/fw-9.1.1.tcbuildtag/debug/SIL.Lift.pdb ../lib/DebugMono/SIL.Lift.pdb -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoLinux64masterContinuous/fw-9.1.1.tcbuildtag/debug/SIL.WritingSystems.dll ../lib/DebugMono/SIL.WritingSystems.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoLinux64masterContinuous/fw-9.1.1.tcbuildtag/debug/SIL.WritingSystems.pdb ../lib/DebugMono/SIL.WritingSystems.pdb -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoLinux64masterContinuous/fw-9.1.1.tcbuildtag/debug/SIL.WritingSystems.Tests.dll ../lib/DebugMono/SIL.WritingSystems.Tests.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoLinux64masterContinuous/fw-9.1.1.tcbuildtag/debug/SIL.WritingSystems.Tests.pdb ../lib/DebugMono/SIL.WritingSystems.Tests.pdb -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoLinux64masterContinuous/fw-9.1.1.tcbuildtag/debug/L10NSharp.dll ../lib/DebugMono/L10NSharp.dll -# End of script diff --git a/build/buildupdate.win.sh b/build/buildupdate.win.sh deleted file mode 100644 index f7edf8775..000000000 --- a/build/buildupdate.win.sh +++ /dev/null @@ -1,163 +0,0 @@ -#!/bin/bash -# server=build.palaso.org -# build_type=Chorus_Win32masterContinuous -# root_dir=.. -# Auto-generated by https://github.com/chrisvire/BuildUpdate. -# Do not edit this file by hand! - -cd "$(dirname "$0")" - -# *** Functions *** -force=0 -clean=0 - -while getopts fc opt; do -case $opt in -f) force=1 ;; -c) clean=1 ;; -esac -done - -shift $((OPTIND - 1)) - -copy_auto() { -if [ "$clean" == "1" ] -then -echo cleaning $2 -rm -f ""$2"" -else -where_curl=$(type -P curl) -where_wget=$(type -P wget) -if [ "$where_curl" != "" ] -then -copy_curl "$1" "$2" -elif [ "$where_wget" != "" ] -then -copy_wget "$1" "$2" -else -echo "Missing curl or wget" -exit 1 -fi -fi -} - -copy_curl() { -echo "curl: $2 <= $1" -if [ -e "$2" ] && [ "$force" != "1" ] -then -curl -# -L -z "$2" -o "$2" "$1" -else -curl -# -L -o "$2" "$1" -fi -} - -copy_wget() { -echo "wget: $2 <= $1" -f1=$(basename $1) -f2=$(basename $2) -cd $(dirname $2) -wget -q -L -N "$1" -# wget has no true equivalent of curl's -o option. -# Different versions of wget handle (or not) % escaping differently. -# A URL query is the only reason why $f1 and $f2 should differ. -if [ "$f1" != "$f2" ]; then mv $f2\?* $f2; fi -cd - -} - - -# *** Results *** -# build: chorus-win32-master Continuous (Chorus_Win32masterContinuous) -# project: Chorus -# URL: https://build.palaso.org/viewType.html?buildTypeId=Chorus_Win32masterContinuous -# VCS: https://github.com/sillsdev/chorus.git [master] -# dependencies: -# [0] build: Chorus-Documentation (bt216) -# project: Chorus -# URL: https://build.palaso.org/viewType.html?buildTypeId=bt216 -# clean: false -# revision: latest.lastSuccessful -# paths: {"*.chm"=>"lib"} -# VCS: https://github.com/sillsdev/chorushelp.git [master] -# [1] build: icu4c-54-win32-minimal (bt471) -# project: Libraries -# URL: https://build.palaso.org/viewType.html?buildTypeId=bt471 -# clean: false -# revision: latest.lastSuccessful -# paths: {"*.dll"=>"lib/Debug"} -# [2] build: icu4c-54-win32-minimal (bt471) -# project: Libraries -# URL: https://build.palaso.org/viewType.html?buildTypeId=bt471 -# clean: false -# revision: latest.lastSuccessful -# paths: {"*.dll"=>"lib/Release"} -# [3] build: icucil-win32-default Continuous (bt14) -# project: Libraries -# URL: https://build.palaso.org/viewType.html?buildTypeId=bt14 -# clean: false -# revision: latest.lastSuccessful -# paths: {"icu*.dll"=>"lib/Release"} -# VCS: https://github.com/sillsdev/icu-dotnet [master] -# [4] build: icucil-win32-default Continuous (bt14) -# project: Libraries -# URL: https://build.palaso.org/viewType.html?buildTypeId=bt14 -# clean: false -# revision: latest.lastSuccessful -# paths: {"icu*.dll"=>"lib/Debug"} -# VCS: https://github.com/sillsdev/icu-dotnet [master] -# [5] build: palaso-win32-master Continuous (Libpalaso_PalasoWin32masterContinuous) -# project: libpalaso -# URL: https://build.palaso.org/viewType.html?buildTypeId=Libpalaso_PalasoWin32masterContinuous -# clean: false -# revision: fw-9.1.1.tcbuildtag -# paths: {"SIL.Core.dll"=>"lib/Release", "SIL.Core.Desktop.dll"=>"lib/Release", "SIL.Lift.dll"=>"lib/Release", "SIL.TestUtilities.dll"=>"lib/Release", "SIL.Windows.Forms.dll"=>"lib/Release", "SIL.Windows.Forms.GeckoBrowserAdapter.dll"=>"lib/Release", "SIL.WritingSystems.dll"=>"lib/Release", "SIL.WritingSystems.Tests.dll"=>"lib/Release", "L10NSharp.dll"=>"lib/Release", "debug/SIL.Core.dll"=>"lib/Debug", "debug/SIL.Core.pdb"=>"lib/Debug", "debug/SIL.Core.Desktop.dll"=>"lib/Debug", "debug/SIL.Core.Desktop.pdb"=>"lib/Debug", "debug/SIL.TestUtilities.dll"=>"lib/Debug", "debug/SIL.TestUtilities.pdb"=>"lib/Debug", "debug/SIL.Windows.Forms.dll"=>"lib/Debug", "debug/SIL.Windows.Forms.pdb"=>"lib/Debug", "debug/SIL.Windows.Forms.GeckoBrowserAdapter.dll"=>"lib/Debug", "debug/SIL.Windows.Forms.GeckoBrowserAdapter.pdb"=>"lib/Debug", "debug/SIL.Lift.dll"=>"lib/Debug", "debug/SIL.Lift.pdb"=>"lib/Debug", "debug/SIL.WritingSystems.dll"=>"lib/Debug", "debug/SIL.WritingSystems.pdb"=>"lib/Debug", "debug/SIL.WritingSystems.Tests.dll"=>"lib/Debug", "debug/SIL.WritingSystems.Tests.pdb"=>"lib/Debug", "debug/L10NSharp.dll"=>"lib/Debug", "debug/L10NSharp.pdb"=>"lib/Debug"} -# VCS: https://github.com/sillsdev/libpalaso.git [refs/heads/master] - -# make sure output directories exist -mkdir -p ../lib -mkdir -p ../lib/Debug -mkdir -p ../lib/Release - -# download artifact dependencies -copy_auto http://build.palaso.org/guestAuth/repository/download/bt216/latest.lastSuccessful/Chorus_Help.chm ../lib/Chorus_Help.chm -copy_auto http://build.palaso.org/guestAuth/repository/download/bt471/latest.lastSuccessful/icudt54.dll ../lib/Debug/icudt54.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/bt471/latest.lastSuccessful/icuin54.dll ../lib/Debug/icuin54.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/bt471/latest.lastSuccessful/icuuc54.dll ../lib/Debug/icuuc54.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/bt471/latest.lastSuccessful/icudt54.dll ../lib/Release/icudt54.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/bt471/latest.lastSuccessful/icuin54.dll ../lib/Release/icuin54.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/bt471/latest.lastSuccessful/icuuc54.dll ../lib/Release/icuuc54.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/bt14/latest.lastSuccessful/icu.net.dll ../lib/Release/icu.net.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/bt14/latest.lastSuccessful/icudt54.dll ../lib/Release/icudt54.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/bt14/latest.lastSuccessful/icuin54.dll ../lib/Release/icuin54.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/bt14/latest.lastSuccessful/icuuc54.dll ../lib/Release/icuuc54.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/bt14/latest.lastSuccessful/icu.net.dll ../lib/Debug/icu.net.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/bt14/latest.lastSuccessful/icudt54.dll ../lib/Debug/icudt54.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/bt14/latest.lastSuccessful/icuin54.dll ../lib/Debug/icuin54.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/bt14/latest.lastSuccessful/icuuc54.dll ../lib/Debug/icuuc54.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoWin32masterContinuous/fw-9.1.1.tcbuildtag/SIL.Core.dll ../lib/Release/SIL.Core.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoWin32masterContinuous/fw-9.1.1.tcbuildtag/SIL.Core.Desktop.dll ../lib/Release/SIL.Core.Desktop.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoWin32masterContinuous/fw-9.1.1.tcbuildtag/SIL.Lift.dll ../lib/Release/SIL.Lift.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoWin32masterContinuous/fw-9.1.1.tcbuildtag/SIL.TestUtilities.dll ../lib/Release/SIL.TestUtilities.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoWin32masterContinuous/fw-9.1.1.tcbuildtag/SIL.Windows.Forms.dll ../lib/Release/SIL.Windows.Forms.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoWin32masterContinuous/fw-9.1.1.tcbuildtag/SIL.Windows.Forms.GeckoBrowserAdapter.dll ../lib/Release/SIL.Windows.Forms.GeckoBrowserAdapter.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoWin32masterContinuous/fw-9.1.1.tcbuildtag/SIL.WritingSystems.dll ../lib/Release/SIL.WritingSystems.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoWin32masterContinuous/fw-9.1.1.tcbuildtag/SIL.WritingSystems.Tests.dll ../lib/Release/SIL.WritingSystems.Tests.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoWin32masterContinuous/fw-9.1.1.tcbuildtag/L10NSharp.dll ../lib/Release/L10NSharp.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoWin32masterContinuous/fw-9.1.1.tcbuildtag/debug/SIL.Core.dll ../lib/Debug/SIL.Core.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoWin32masterContinuous/fw-9.1.1.tcbuildtag/debug/SIL.Core.pdb ../lib/Debug/SIL.Core.pdb -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoWin32masterContinuous/fw-9.1.1.tcbuildtag/debug/SIL.Core.Desktop.dll ../lib/Debug/SIL.Core.Desktop.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoWin32masterContinuous/fw-9.1.1.tcbuildtag/debug/SIL.Core.Desktop.pdb ../lib/Debug/SIL.Core.Desktop.pdb -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoWin32masterContinuous/fw-9.1.1.tcbuildtag/debug/SIL.TestUtilities.dll ../lib/Debug/SIL.TestUtilities.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoWin32masterContinuous/fw-9.1.1.tcbuildtag/debug/SIL.TestUtilities.pdb ../lib/Debug/SIL.TestUtilities.pdb -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoWin32masterContinuous/fw-9.1.1.tcbuildtag/debug/SIL.Windows.Forms.dll ../lib/Debug/SIL.Windows.Forms.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoWin32masterContinuous/fw-9.1.1.tcbuildtag/debug/SIL.Windows.Forms.pdb ../lib/Debug/SIL.Windows.Forms.pdb -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoWin32masterContinuous/fw-9.1.1.tcbuildtag/debug/SIL.Windows.Forms.GeckoBrowserAdapter.dll ../lib/Debug/SIL.Windows.Forms.GeckoBrowserAdapter.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoWin32masterContinuous/fw-9.1.1.tcbuildtag/debug/SIL.Windows.Forms.GeckoBrowserAdapter.pdb ../lib/Debug/SIL.Windows.Forms.GeckoBrowserAdapter.pdb -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoWin32masterContinuous/fw-9.1.1.tcbuildtag/debug/SIL.Lift.dll ../lib/Debug/SIL.Lift.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoWin32masterContinuous/fw-9.1.1.tcbuildtag/debug/SIL.Lift.pdb ../lib/Debug/SIL.Lift.pdb -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoWin32masterContinuous/fw-9.1.1.tcbuildtag/debug/SIL.WritingSystems.dll ../lib/Debug/SIL.WritingSystems.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoWin32masterContinuous/fw-9.1.1.tcbuildtag/debug/SIL.WritingSystems.pdb ../lib/Debug/SIL.WritingSystems.pdb -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoWin32masterContinuous/fw-9.1.1.tcbuildtag/debug/SIL.WritingSystems.Tests.dll ../lib/Debug/SIL.WritingSystems.Tests.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoWin32masterContinuous/fw-9.1.1.tcbuildtag/debug/SIL.WritingSystems.Tests.pdb ../lib/Debug/SIL.WritingSystems.Tests.pdb -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoWin32masterContinuous/fw-9.1.1.tcbuildtag/debug/L10NSharp.dll ../lib/Debug/L10NSharp.dll -copy_auto http://build.palaso.org/guestAuth/repository/download/Libpalaso_PalasoWin32masterContinuous/fw-9.1.1.tcbuildtag/debug/L10NSharp.pdb ../lib/Debug/L10NSharp.pdb -# End of script diff --git a/build/readme - making buildUpdate script.txt b/build/readme - making buildUpdate script.txt deleted file mode 100644 index fdecbae44..000000000 --- a/build/readme - making buildUpdate script.txt +++ /dev/null @@ -1,13 +0,0 @@ -(Re)building buildUpdate.sh requires ruby and https://github.com/chrisvire/BuildUpdate -Here's the command line commands I used: - -cd -\buildupdate.rb -t bt2 -f buildupdate.win.sh -r .. -\buildupdate.rb -t bt323 -f buildupdate.mono.sh -r .. - -Explanation: - -"-t bt2" points at the Windows configuration that tracks this branch -"-t bt323" points at the Linux configuration that tracks this branch -"-f ____" gives what I want the file to be called -"-r .." takes care of moving the context up from build to the root directory \ No newline at end of file diff --git a/environ b/environ index 282d28341..af935b457 100644 --- a/environ +++ b/environ @@ -9,7 +9,7 @@ # the sourcing script should cd/pushd to the directory containing this script BASE="$(pwd)" [ -z "$BUILD" ] && BUILD=Debug -[ -z "$MONO_PREFIX" ] && MONO_PREFIX=/opt/mono4-sil +[ -z "$MONO_PREFIX" ] && MONO_PREFIX=/opt/mono5-sil # Dependency locations # Search for xulrunner and geckofx, select the best, and add its location to LD_LIBRARY_PATH. diff --git a/lgtm.yml b/lgtm.yml new file mode 100644 index 000000000..f79d3386c --- /dev/null +++ b/lgtm.yml @@ -0,0 +1,21 @@ +extraction: + # We don't use python in Chorus, so we ignore all files to prevent failing LGTM builds + python: + index: + exclude: + - "**/*.*" + + # GitVersion doesn't natively support LGTM and fails when it finds a detached head, + # so we create and checkout a branch. + csharp: + after_prepare: + - git branch -f PR && git checkout PR + +queries: + # Exclude python queries + - exclude: py/* + + # The following queries are irrelevant for desktop apps + - exclude: cs/path-injection # Uncontrolled data used in path expression + - exclude: cs/command-line-injection # Uncontrolled command line + - exclude: cs/log-forging # Log entries created from user input diff --git a/lib/common/Mercurial-i686.zip b/lib/common/Mercurial-i686.zip deleted file mode 100644 index d857502ab..000000000 Binary files a/lib/common/Mercurial-i686.zip and /dev/null differ diff --git a/lib/common/Mercurial-x86_64.zip b/lib/common/Mercurial-x86_64.zip deleted file mode 100644 index 95d508bf2..000000000 Binary files a/lib/common/Mercurial-x86_64.zip and /dev/null differ diff --git a/lib/common/Mercurial.zip b/lib/common/Mercurial.zip deleted file mode 100644 index 6fb88b033..000000000 Binary files a/lib/common/Mercurial.zip and /dev/null differ diff --git a/lib/common/UpdatingMercurial.md b/lib/common/UpdatingMercurial.md deleted file mode 100644 index 6cf29395e..000000000 --- a/lib/common/UpdatingMercurial.md +++ /dev/null @@ -1,23 +0,0 @@ -To update the mercurial zip files for the linux distributions you should perform the following steps or some reasonable facsimile: - -* On an Ubuntu machine for the appropriate platform add the mercurial releases ppa(ppa:mercurial-ppa/releases) - -* Install the mercurial package - -* Create a Mercurial folder that you will zip. - -* Looking at the installed files copy all of the relevant ones into our zip folder in a way so that local access will work. For example, - - cp /etc/bin/hg to Mercurial/hg - cp -rL /usr/share/pyshared/mercurial Mercurial/mercurial - cp -rL /usr/share/mercurial Mercurial/mercurial - - [repeat for hgext directories and whatever else is needed] - -* Add an appropriate mercurial.ini file at the root - -* Zip up the folder and name it correctly for the platform and replace the old zip in source control. Note that the Mercurial zip file should be zipped on Windows. This solves a problem when unzipping the file with SharpZipLib which otherwise does not extract the `mercurial` subfolder and stores the `mercurial.ini` file with 0 bytes. - -To update Mercurial on Windows you will need to do the following: -* Install the desired mercurial, delete the localization files as well as anything else that looks to be large and irrelevant. -* Zip up the folder and copy it over MercurialWindows.zip \ No newline at end of file diff --git a/src/.nuget/packages.config b/src/.nuget/packages.config deleted file mode 100644 index 23a62fd78..000000000 --- a/src/.nuget/packages.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/src/Chorus.Tests/Chorus.Tests.csproj b/src/Chorus.Tests/Chorus.Tests.csproj index 14e3cd8e1..ef5ca755b 100644 --- a/src/Chorus.Tests/Chorus.Tests.csproj +++ b/src/Chorus.Tests/Chorus.Tests.csproj @@ -1,233 +1,47 @@ - - + + - Debug - AnyCPU - 9.0.21022 - 2.0 - {887A58D6-E5C5-4BA1-9C9B-41C6E8F0B915} - Library - Properties + net461 Chorus.Tests - Chorus.Tests - 512 - - - 3.5 - - v4.6.1 - - - - True - full - False - ..\..\output\Debug - DEBUG;TRACE - prompt - 4 - True - AnyCPU - false - 6 + Chorus.Tests + Debug;Release + Unit tests for Chorus.exe + SIL International + SIL International + chorus + Copyright © 2010-2020 SIL International + ../../output/$(Configuration) + true + ../FieldWorks.snk + true 1591 - - - pdbonly - True - ..\..\output\Release - TRACE - prompt - 4 - True - True - AnyCPU - false - 6 - - - True - ..\..\output\DebugMono - DEBUG;TRACE;MONO - True - full + false + false + AnyCPU - prompt - 4 - False - false - 6 + win7-x86;win7-x64 - - True - ..\..\output\ReleaseMono - TRACE;MONO - True - True - pdbonly - AnyCPU - prompt - 4 - false - 6 - - - true - ..\..\output\Debug\ - DEBUG;TRACE - true - full - AnyCPU - 6 - prompt - MinimumRecommendedRules.ruleset - - - true - ..\..\output\Release\ - TRACE - true - true - pdbonly - AnyCPU - 6 - prompt - MinimumRecommendedRules.ruleset - - - - False - ..\..\lib\Debug\SIL.Core.dll - - - False - ..\..\lib\Debug\SIL.Core.Desktop.dll - - - False - ..\..\lib\Debug\SIL.Windows.Forms.dll - - - False - ..\..\lib\Debug\SIL.TestUtilities.dll - - - - - False - ..\..\lib\Release\SIL.Core.dll - - - False - ..\..\lib\Release\SIL.Core.Desktop.dll - - - False - ..\..\lib\Release\SIL.Windows.Forms.dll - - - False - ..\..\lib\Release\SIL.TestUtilities.dll - - - - - False - ..\..\lib\DebugMono\SIL.Core.dll - - - False - ..\..\lib\DebugMono\SIL.Core.Desktop.dll - - - False - ..\..\lib\DebugMono\SIL.Windows.Forms.dll - - - False - ..\..\lib\DebugMono\SIL.TestUtilities.dll - - - - - False - ..\..\lib\ReleaseMono\SIL.Core.dll - - - False - ..\..\lib\ReleaseMono\SIL.Core.Desktop.dll - - - False - ..\..\lib\ReleaseMono\SIL.Windows.Forms.dll - - - False - ..\..\lib\ReleaseMono\SIL.TestUtilities.dll - - - - - ..\..\packages\Autofac.2.6.3.862\lib\NET40\Autofac.dll - - - ..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - {9DA5A655-1881-4BE1-81BA-256E47CF7537} - Chorus - - - {0681E722-1856-44A1-B585-220E6AEC85CB} - LibChorus.TestUtilities - - - {94245366-8F1E-475C-810D-FE89BB3948E0} - LibChorus - + + + + - - + - + + + + + + + $(AssemblySearchPaths);{GAC} + + \ No newline at end of file diff --git a/src/Chorus.Tests/ChorusApplicationTests.cs b/src/Chorus.Tests/ChorusApplicationTests.cs index 572281b8e..2b6c20ea3 100644 --- a/src/Chorus.Tests/ChorusApplicationTests.cs +++ b/src/Chorus.Tests/ChorusApplicationTests.cs @@ -6,7 +6,8 @@ namespace Chorus.Tests { - [TestFixture, RequiresSTA] + [TestFixture] + [Apartment(ApartmentState.STA)] public class ChorusApplicationTests { [Test] diff --git a/src/Chorus.Tests/ChorusSystemTests.cs b/src/Chorus.Tests/ChorusSystemTests.cs index 919fc5e5c..5505152a2 100644 --- a/src/Chorus.Tests/ChorusSystemTests.cs +++ b/src/Chorus.Tests/ChorusSystemTests.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Drawing; +using System.IO; using System.Linq; using System.Threading; using System.Windows.Forms; @@ -12,7 +13,7 @@ namespace Chorus.Tests { - [TestFixture, RequiresSTA] + [TestFixture, Apartment(ApartmentState.STA)] public class ChorusSystemTests { private TemporaryFolder _folder; @@ -24,7 +25,7 @@ public class ChorusSystemTests [SetUp] public void Setup() { - _folder = new TemporaryFolder("ChorusSystemTests"); + _folder = new TemporaryFolder("ChorusSystemTests_" + Path.GetRandomFileName()); _targetFile1 = new TempFileFromFolder(_folder, "one.txt", "just a pretend file"); _existingNotesFile = new TempFileFromFolder(_folder, "one.txt." + AnnotationRepository.FileExtension, @" diff --git a/src/Chorus.Tests/ChorusSystemUsage.cs b/src/Chorus.Tests/ChorusSystemUsage.cs index 533e86536..21ea42a0e 100644 --- a/src/Chorus.Tests/ChorusSystemUsage.cs +++ b/src/Chorus.Tests/ChorusSystemUsage.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Threading; using System.Windows.Forms; using Chorus.notes; using NUnit.Framework; @@ -14,7 +15,7 @@ namespace Chorus.Tests /// These are not really tests! They are documented, compilable, runable set of samples to /// help you get started incorporating Chorus into your application. /// - [TestFixture, RequiresSTA] + [TestFixture, Apartment(ApartmentState.STA)] public class ChorusSystemUsage { private ChorusSystem _chorusSystem; diff --git a/src/Chorus.Tests/Properties/AssemblyInfo.cs b/src/Chorus.Tests/Properties/AssemblyInfo.cs deleted file mode 100644 index 4c49d04df..000000000 --- a/src/Chorus.Tests/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Chorus.Tests")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Chorus.Tests")] -[assembly: AssemblyCopyright("Copyright © 2009")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("182548c4-fc27-4f2f-b4aa-8b9af98c8a59")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/Chorus.Tests/UI/Clone/GetSharedProjectModelTests.cs b/src/Chorus.Tests/UI/Clone/GetSharedProjectModelTests.cs index 3c247ca5e..6716c624d 100644 --- a/src/Chorus.Tests/UI/Clone/GetSharedProjectModelTests.cs +++ b/src/Chorus.Tests/UI/Clone/GetSharedProjectModelTests.cs @@ -35,7 +35,7 @@ public void HasExtantRepositories() var extantRepoIdentifiers = GetSharedProjectModel.ExtantRepoIdentifiers(parentFolder.Path, null); Assert.AreEqual(1, extantRepoIdentifiers.Count); - Assert.IsTrue(extantRepoIdentifiers.ContainsKey(repo.Identifier)); + Assert.That(extantRepoIdentifiers, Does.ContainKey(repo.Identifier)); Assert.That(extantRepoIdentifiers[repo.Identifier], Is.EqualTo("childFolder")); } } @@ -56,7 +56,7 @@ public void ExtantRepositories_FindsRepoInOtherRepoLocation() var extantRepoIdentifiers = GetSharedProjectModel.ExtantRepoIdentifiers(parentFolder.Path, "otherRepositories"); Assert.AreEqual(1, extantRepoIdentifiers.Count); - Assert.IsTrue(extantRepoIdentifiers.ContainsKey(repo.Identifier)); + Assert.That(extantRepoIdentifiers, Does.ContainKey(repo.Identifier)); Assert.That(extantRepoIdentifiers[repo.Identifier], Is.EqualTo("childFolder")); } } diff --git a/src/Chorus.Tests/UI/Clone/TargetFolderControlTests.cs b/src/Chorus.Tests/UI/Clone/TargetFolderControlTests.cs index e16f93317..0e6540041 100644 --- a/src/Chorus.Tests/UI/Clone/TargetFolderControlTests.cs +++ b/src/Chorus.Tests/UI/Clone/TargetFolderControlTests.cs @@ -41,7 +41,7 @@ public void LocalFolderName_WontAcceptSpacesBeforeName() model.LocalFolderName = ""; var ctrl = new TargetFolderControl(model); ctrl._localFolderName.Text = " Bob"; - Assert.IsFalse(model.TargetHasProblem); + Assert.That(model.TargetHasProblem, Is.False); Assert.AreEqual(Path.Combine(testFolder.Path, "Bob"), model.TargetDestination); } } @@ -58,7 +58,7 @@ public void LocalFolderName_WontAcceptSpacesAfterName() model.LocalFolderName = ""; var ctrl = new TargetFolderControl(model); ctrl._localFolderName.Text = "Billy "; - Assert.IsTrue(model.TargetHasProblem); + Assert.That(model.TargetHasProblem, Is.True); Assert.AreEqual(Path.Combine(testFolder.Path, "Billy"), model.TargetDestination); } } diff --git a/src/Chorus.Tests/UI/Sync/SyncControlModelTests.cs b/src/Chorus.Tests/UI/Sync/SyncControlModelTests.cs index 1a6e0865d..4791034c9 100644 --- a/src/Chorus.Tests/UI/Sync/SyncControlModelTests.cs +++ b/src/Chorus.Tests/UI/Sync/SyncControlModelTests.cs @@ -123,8 +123,8 @@ public void Sync_NonExistentLangForgeProject_ExitsGracefullyWithCorrectErrorResu // NOTE: we can't use AutoResetEvent with Sync() - for some reason this doesn't work WaitForSyncToFinish(ref results); - Assert.IsFalse(results.Succeeded); - Assert.IsNotNull(results.ErrorEncountered); + Assert.That(results.Succeeded, Is.False); + Assert.That(results.ErrorEncountered, Is.Not.Null); } [Test] @@ -143,9 +143,9 @@ public void Sync_Cancelled_ResultsHaveCancelledEqualsTrue() // NOTE: we can't use AutoResetEvent with Sync() - for some reason this doesn't work WaitForSyncToFinish(ref results); - Assert.IsFalse(results.Succeeded); - Assert.IsTrue(results.Cancelled); - Assert.IsNull(results.ErrorEncountered); + Assert.That(results.Succeeded, Is.False); + Assert.That(results.Cancelled, Is.True); + Assert.That(results.ErrorEncountered, Is.Null); } [Test] @@ -155,7 +155,7 @@ public void AsyncLocalCheckIn_GivesGoodResult() var waitHandle = new AutoResetEvent(false); _model.AsyncLocalCheckIn("testing", r => { result=r; waitHandle.Set();}); WaitForTasksToFinish(1, waitHandle); - Assert.IsTrue(result.Succeeded); + Assert.That(result.Succeeded, Is.True); } /// @@ -175,9 +175,9 @@ public void AsyncLocalCheckIn_NoHgLockWarningWithMultipleWorkers() _model.AsyncLocalCheckIn("testing", r => { result3=r; waitHandle3.Set(); }); WaitForTasksToFinish(3, waitHandle1, waitHandle2, waitHandle3); - Assert.IsFalse(_model.StatusProgress.WarningEncountered, "There was a warning encountered during the sync: {0}", _model.StatusProgress.LastWarning); - Assert.IsFalse(_model.StatusProgress.ErrorEncountered, "There was an error encountered during the sync: {0}", _model.StatusProgress.LastError); - Assert.IsTrue(result1.Succeeded && result2.Succeeded && result3.Succeeded, "One of the CheckIn attempts did not succeed."); + Assert.That(_model.StatusProgress.WarningEncountered, Is.False, $"There was a warning encountered during the sync: {_model.StatusProgress.LastWarning}"); + Assert.That(_model.StatusProgress.ErrorEncountered, Is.False, $"There was an error encountered during the sync: {_model.StatusProgress.LastError}"); + Assert.That(result1.Succeeded && result2.Succeeded && result3.Succeeded, Is.True, "One of the CheckIn attempts did not succeed."); } [Test] diff --git a/src/Chorus.Tests/UI/Sync/SyncDialogTests.cs b/src/Chorus.Tests/UI/Sync/SyncDialogTests.cs index e01ec657e..07eb1da21 100644 --- a/src/Chorus.Tests/UI/Sync/SyncDialogTests.cs +++ b/src/Chorus.Tests/UI/Sync/SyncDialogTests.cs @@ -12,7 +12,7 @@ namespace Chorus.Tests.UI.Sync public class SyncDialogTests { [Test, Ignore("Run by hand only")] - [NUnit.Framework.RequiresSTA] + [Apartment(ApartmentState.STA)] public void ShowSyncStartControl_NoPaths() { using(var setup = new RepositorySetup("pedro")) @@ -26,7 +26,7 @@ public void ShowSyncStartControl_NoPaths() } [Test, Ignore("Run by hand only")] - [NUnit.Framework.RequiresSTA] + [Apartment(ApartmentState.STA)] public void ShowSyncDialog_InternetAndNetworkPaths_WindowsStyle() { Application.EnableVisualStyles(); @@ -49,7 +49,7 @@ public void ShowSyncDialog_InternetAndNetworkPaths_WindowsStyle() } [Test, Ignore("Run by hand only")] - [NUnit.Framework.RequiresSTA] + [Apartment(ApartmentState.STA)] public void ShowSyncDialog_InternetAndNetworkPaths() { Application.EnableVisualStyles(); @@ -205,7 +205,7 @@ public void LaunchDialog_BogusTarget_AdmitsError() { dlg.SyncOptions.RepositorySourcesToTry.Add(RepositoryAddress.Create("bogus", @"z:/")); dlg.ShowDialog(); - Assert.IsTrue(dlg.FinalStatus.WarningEncountered); + Assert.That(dlg.FinalStatus.WarningEncountered, Is.True); } } } @@ -219,7 +219,7 @@ public void Sync_GetUsbStatusLink_NoUsb() var syncStartModel = new SyncStartModel(null); var result = syncStartModel.GetUsbStatusLink(usbLocator, out message); - Assert.IsFalse(result, "Should fail!"); + Assert.That(result, Is.False, "Should fail!"); Assert.AreEqual("First insert a USB flash drive.", message); } @@ -232,7 +232,7 @@ public void Sync_GetUsbStatusLink_MultipleUsb() var syncStartModel = new SyncStartModel(null); var result = syncStartModel.GetUsbStatusLink(usbLocator, out message); - Assert.IsFalse(result, "Should fail!"); + Assert.That(result, Is.False, "Should fail!"); Assert.AreEqual("More than one USB drive detected. Please remove one.", message); } @@ -245,8 +245,8 @@ public void Sync_GetUsbStatusLink_OneUsb() var syncStartModel = new SyncStartModel(null); var result = syncStartModel.GetUsbStatusLink(usbLocator, out message); - Assert.IsTrue(result, "Should pass!"); - Assert.IsTrue(message.StartsWith("C:")); + Assert.That(result, Is.True, "Should pass!"); + Assert.That(message.StartsWith("C:"), Is.True); } } } \ No newline at end of file diff --git a/src/Chorus.Tests/UI/notes/AnnotationModelTests.cs b/src/Chorus.Tests/UI/notes/AnnotationModelTests.cs index 49f0f2203..9065053e7 100644 --- a/src/Chorus.Tests/UI/notes/AnnotationModelTests.cs +++ b/src/Chorus.Tests/UI/notes/AnnotationModelTests.cs @@ -26,15 +26,15 @@ public void AddButtonClicked_NewMessageHasContents_NewMessageAppendedToAnnotatio var messageSelected = new MessageSelectedEvent(); AnnotationEditorModel annotationModel = CreateAnnotationModel(messageSelected); messageSelected.Raise(annotation, annotation.Messages.First()); - Assert.IsFalse(annotationModel.IsResolved); - Assert.IsFalse(annotation.IsClosed); + Assert.That(annotationModel.IsResolved, Is.False); + Assert.That(annotation.IsClosed, Is.False); Assert.AreEqual(1, annotation.Messages.Count()); annotationModel.AddMessage("hello"); - Assert.IsFalse(annotationModel.IsResolved,"should not have changed status"); + Assert.That(annotationModel.IsResolved, Is.False,"should not have changed status"); Assert.AreEqual(2, annotation.Messages.Count()); Assert.AreEqual("bob", annotation.Messages.Last().GetAuthor("")); Assert.AreEqual("hello", annotation.Messages.Last().Text); - Assert.IsTrue(DateTime.Now.Subtract(annotation.Messages.Last().Date).Seconds < 2); + Assert.That(DateTime.Now.Subtract(annotation.Messages.Last().Date).Seconds, Is.LessThan(2)); } [Test] @@ -44,11 +44,11 @@ public void CloseIssue_AnnotationGetsNewMessageWithNewStatus() var messageSelected = new MessageSelectedEvent(); AnnotationEditorModel annotationModel = CreateAnnotationModel(messageSelected); messageSelected.Raise(annotation, annotation.Messages.First()); - Assert.IsFalse(annotationModel.IsResolved); - Assert.IsFalse(annotation.IsClosed); + Assert.That(annotationModel.IsResolved, Is.False); + Assert.That(annotation.IsClosed, Is.False); annotationModel.IsResolved = true; - Assert.IsTrue(annotationModel.IsResolved); - Assert.IsTrue(annotation.IsClosed); + Assert.That(annotationModel.IsResolved, Is.True); + Assert.That(annotation.IsClosed, Is.True); } [Test] @@ -58,15 +58,15 @@ public void ResolveButtonClicked_NewMessageHasContents_ResolutionAndMessageAreOn var messageSelected = new MessageSelectedEvent(); AnnotationEditorModel annotationModel = CreateAnnotationModel(messageSelected); messageSelected.Raise(annotation, annotation.Messages.First()); - Assert.IsFalse(annotationModel.IsResolved); - Assert.IsFalse(annotation.IsClosed); + Assert.That(annotationModel.IsResolved, Is.False); + Assert.That(annotation.IsClosed, Is.False); Assert.AreEqual(1, annotation.Messages.Count()); annotationModel.UnResolveAndAddMessage("hello"); - Assert.IsTrue(annotationModel.IsResolved, "should have changed status"); + Assert.That(annotationModel.IsResolved, Is.True, "should have changed status"); Assert.AreEqual(2, annotation.Messages.Count()); Assert.AreEqual("bob", annotation.Messages.Last().GetAuthor("")); Assert.AreEqual("hello", annotation.Messages.Last().Text); - Assert.IsTrue(DateTime.Now.Subtract(annotation.Messages.Last().Date).Seconds < 2); + Assert.That(DateTime.Now.Subtract(annotation.Messages.Last().Date).Seconds, Is.LessThan(2)); } private AnnotationEditorModel CreateAnnotationModel(MessageSelectedEvent messageSelected) diff --git a/src/Chorus.Tests/UI/notes/MessageTests.cs b/src/Chorus.Tests/UI/notes/MessageTests.cs index 811362e9e..fe8cd5269 100644 --- a/src/Chorus.Tests/UI/notes/MessageTests.cs +++ b/src/Chorus.Tests/UI/notes/MessageTests.cs @@ -21,7 +21,7 @@ public void HtmlText_HadCData_ResultContainsHyperlink() var m = new Message(element); string text = m.GetHtmlText(new EmbeddedMessageContentHandlerRepository()); - Assert.IsTrue(text.Contains(""); var m = new Message(element); - Assert.IsFalse(m.GetHtmlText(new EmbeddedMessageContentHandlerRepository()).Contains("")) + using (var subfolder = new TemporaryFolder(_folder, "Sub")) + using (new TempFileFromFolder(_folder, "one." + AnnotationRepository.FileExtension, "")) using (new TempFileFromFolder(subfolder, "two." + AnnotationRepository.FileExtension, "")) { - var repos = AnnotationRepository.CreateRepositoriesFromFolder(folder.Path, _progress); + var repos = AnnotationRepository.CreateRepositoriesFromFolder(_folder.Path, _progress); var m = new NotesInProjectViewModel(TheUser, repos, new ChorusNotesDisplaySettings(), new ConsoleProgress()); Assert.AreEqual(2, m.GetMessages().Count()); } @@ -57,15 +61,12 @@ private TempFile CreateNotesFile(TemporaryFolder folder, string contents) [Test] public void GetMessages_SearchContainsAuthor_FindsMatches() { - using (var folder = new TemporaryFolder("NotesModelTests")) + string contents = ""; + using (CreateNotesFile(_folder, contents)) { - string contents = ""; - using (CreateNotesFile(folder, contents)) - { - var m = new NotesInProjectViewModel(TheUser, AnnotationRepository.CreateRepositoriesFromFolder(folder.Path, _progress), new ChorusNotesDisplaySettings(), new ConsoleProgress()); - m.SearchText = "john"; - Assert.AreEqual(1, m.GetMessages().Count()); - } + var m = new NotesInProjectViewModel(TheUser, AnnotationRepository.CreateRepositoriesFromFolder(_folder.Path, _progress), new ChorusNotesDisplaySettings(), new ConsoleProgress()); + m.SearchText = "john"; + Assert.AreEqual(1, m.GetMessages().Count()); } } @@ -75,217 +76,193 @@ public void GetMessages_SearchContainsAuthor_FindsMatches() [Test] public void GetMessages_SearchContainsClass_FindsMatches() { - using (var folder = new TemporaryFolder("NotesModelTests")) + string contents = @" + "; + using (CreateNotesFile(_folder, contents)) { - string contents = @" - "; - using (CreateNotesFile(folder, contents)) - { - var repos = AnnotationRepository.CreateRepositoriesFromFolder(folder.Path, _progress); - var m = new NotesInProjectViewModel(TheUser, repos, new ChorusNotesDisplaySettings(), new ConsoleProgress()); - Assert.AreEqual(2, m.GetMessages().Count(), "should get 2 annotations when search box is empty"); - m.SearchText = "ques"; - Assert.AreEqual(1, m.GetMessages().Count()); - Assert.AreEqual("john",m.GetMessages().First().Message.Author); - - } + var repos = AnnotationRepository.CreateRepositoriesFromFolder(_folder.Path, _progress); + var m = new NotesInProjectViewModel(TheUser, repos, new ChorusNotesDisplaySettings(), new ConsoleProgress()); + Assert.AreEqual(2, m.GetMessages().Count(), "should get 2 annotations when search box is empty"); + m.SearchText = "ques"; + Assert.AreEqual(1, m.GetMessages().Count()); + Assert.AreEqual("john",m.GetMessages().First().Message.Author); } } [Test] public void GetMessages_SearchContainsWordInMessageInUpperCase_FindsMatches() { - using (var folder = new TemporaryFolder("NotesModelTests")) + string contents = @" + my mESsage contents"; + using (CreateNotesFile(_folder, contents)) { - string contents = @" - my mESsage contents"; - using (CreateNotesFile(folder, contents)) - { - var repos = AnnotationRepository.CreateRepositoriesFromFolder(folder.Path, _progress); - var m = new NotesInProjectViewModel(TheUser, repos, new ChorusNotesDisplaySettings(), new ConsoleProgress()); - Assert.AreEqual(2, m.GetMessages().Count(), "should get 2 annotations when search box is empty"); - m.SearchText = "MesSAGE";//es is lower case - Assert.AreEqual(1, m.GetMessages().Count()); - Assert.AreEqual("bob", m.GetMessages().First().Message.Author); - - } + var repos = AnnotationRepository.CreateRepositoriesFromFolder(_folder.Path, _progress); + var m = new NotesInProjectViewModel(TheUser, repos, new ChorusNotesDisplaySettings(), new ConsoleProgress()); + Assert.AreEqual(2, m.GetMessages().Count(), "should get 2 annotations when search box is empty"); + m.SearchText = "MesSAGE";//es is lower case + Assert.AreEqual(1, m.GetMessages().Count()); + Assert.AreEqual("bob", m.GetMessages().First().Message.Author); } } [Test] public void GetMessages_SearchContainsClassInWrongUpperCase_FindsMatches() { - using (var folder = new TemporaryFolder("NotesModelTests")) + string contents = @" + "; + using (CreateNotesFile(_folder, contents)) { - string contents = @" - "; - using (CreateNotesFile(folder, contents)) - { - var repos = AnnotationRepository.CreateRepositoriesFromFolder(folder.Path, _progress); - var m = new NotesInProjectViewModel(TheUser, repos, new ChorusNotesDisplaySettings(), new ConsoleProgress()); - Assert.AreEqual(2, m.GetMessages().Count(), "should get 2 annotations when search box is empty"); - m.SearchText = "Ques"; - Assert.AreEqual(1, m.GetMessages().Count()); - Assert.AreEqual("john", m.GetMessages().First().Message.Author); - - } + var repos = AnnotationRepository.CreateRepositoriesFromFolder(_folder.Path, _progress); + var m = new NotesInProjectViewModel(TheUser, repos, new ChorusNotesDisplaySettings(), new ConsoleProgress()); + Assert.AreEqual(2, m.GetMessages().Count(), "should get 2 annotations when search box is empty"); + m.SearchText = "Ques"; + Assert.AreEqual(1, m.GetMessages().Count()); + Assert.AreEqual("john", m.GetMessages().First().Message.Author); } } [Test] public void GetMessages_ShowQuestionsFalse_HidesQuestions() { - using (var folder = new TemporaryFolder("NotesModelTests")) + string contents = @" + "; + using (CreateNotesFile(_folder, contents)) { - string contents = @" - "; - using (CreateNotesFile(folder, contents)) - { - var repos = AnnotationRepository.CreateRepositoriesFromFolder(folder.Path, _progress); - var m = new NotesInProjectViewModel(TheUser, repos, new ChorusNotesDisplaySettings(), new ConsoleProgress()); - Assert.AreEqual(2, m.GetMessages().Count(), "should get 2 annotations by default"); - m.ShowQuestions = false; - Assert.AreEqual(1, m.GetMessages().Count()); - Assert.AreEqual("bob", m.GetMessages().First().Message.Author, "question should not be shown"); - } + var repos = AnnotationRepository.CreateRepositoriesFromFolder(_folder.Path, _progress); + var m = new NotesInProjectViewModel(TheUser, repos, new ChorusNotesDisplaySettings(), new ConsoleProgress()); + Assert.AreEqual(2, m.GetMessages().Count(), "should get 2 annotations by default"); + m.ShowQuestions = false; + Assert.AreEqual(1, m.GetMessages().Count()); + Assert.AreEqual("bob", m.GetMessages().First().Message.Author, "question should not be shown"); } } [Test] public void FilterStateMessage_HideAll_HideNone() { - using (var folder = new TemporaryFolder("NotesModelTests")) + string contents = @" + "; + using (CreateNotesFile(_folder, contents)) { - string contents = @" - "; - using (CreateNotesFile(folder, contents)) - { - var repos = AnnotationRepository.CreateRepositoriesFromFolder(folder.Path, _progress); - var m = new NotesInProjectViewModel(TheUser, repos, new ChorusNotesDisplaySettings(), new ConsoleProgress()); - m.ShowConflicts = false; - m.ShowNotifications = false; - m.ShowQuestions = false; - Assert.AreEqual("Nothing selected to display", m.FilterStateMessage, - "Wrong filter state message when nothing can be displayed"); - m.ShowQuestions = true; - m.ShowConflicts = true; - m.ShowNotifications = true; - m.ShowClosedNotes = true; - Assert.AreEqual("All", m.FilterStateMessage, - "Wrong filter state message when all annotations should be displayed"); - } + var repos = AnnotationRepository.CreateRepositoriesFromFolder(_folder.Path, _progress); + var m = new NotesInProjectViewModel(TheUser, repos, new ChorusNotesDisplaySettings(), new ConsoleProgress()); + m.ShowConflicts = false; + m.ShowNotifications = false; + m.ShowQuestions = false; + Assert.AreEqual("Nothing selected to display", m.FilterStateMessage, + "Wrong filter state message when nothing can be displayed"); + m.ShowQuestions = true; + m.ShowConflicts = true; + m.ShowNotifications = true; + m.ShowClosedNotes = true; + Assert.AreEqual("All", m.FilterStateMessage, + "Wrong filter state message when all annotations should be displayed"); } } [Test] public void GetMessages_HideNotificationsAndConflicts_HidesCorrectItems() { - using (var folder = new TemporaryFolder("NotesModelTests")) - { - string contents = @" - - unknown: cunninghamd deleted this element, while Jen edited it. The automated merger kept the change made by Jen. - + string contents = @" + + unknown: cunninghamd deleted this element, while Jen edited it. The automated merger kept the change made by Jen. + ]]> - - - unknown: cunninghamd and Jen both edited the text of this element. The automated merger kept the change made by Jen. - + + + unknown: cunninghamd and Jen both edited the text of this element. The automated merger kept the change made by Jen. + ]]> - - "; - using (CreateNotesFile(folder, contents)) - { - var repos = AnnotationRepository.CreateRepositoriesFromFolder(folder.Path, _progress); - var m = new NotesInProjectViewModel(TheUser, repos, new ChorusNotesDisplaySettings(), new ConsoleProgress()); - Assert.AreEqual(3, m.GetMessages().Count(), "should get 1 from each of 3 annotations by default"); - m.ShowNotifications = false; - Assert.AreEqual(2, m.GetMessages().Count(), "one from the notification should not be shown, leaving 2"); - // They are sorted by date in descending order - Assert.AreEqual("fred", m.GetMessages().First().Message.Author, "should get only most recent message from annotation"); - Assert.AreEqual("john", m.GetMessages().ToArray()[1].Message.Author); + +"; + using (CreateNotesFile(_folder, contents)) + { + var repos = AnnotationRepository.CreateRepositoriesFromFolder(_folder.Path, _progress); + var m = new NotesInProjectViewModel(TheUser, repos, new ChorusNotesDisplaySettings(), new ConsoleProgress()); + Assert.AreEqual(3, m.GetMessages().Count(), "should get 1 from each of 3 annotations by default"); + m.ShowNotifications = false; + Assert.AreEqual(2, m.GetMessages().Count(), "one from the notification should not be shown, leaving 2"); + // They are sorted by date in descending order + Assert.AreEqual("fred", m.GetMessages().First().Message.Author, "should get only most recent message from annotation"); + Assert.AreEqual("john", m.GetMessages().ToArray()[1].Message.Author); - m.ShowConflicts = false; - Assert.AreEqual(1, m.GetMessages().Count(), "conflict and notification should not be shown"); - Assert.AreEqual("john", m.GetMessages().First().Message.Author); + m.ShowConflicts = false; + Assert.AreEqual(1, m.GetMessages().Count(), "conflict and notification should not be shown"); + Assert.AreEqual("john", m.GetMessages().First().Message.Author); - m.ShowNotifications = true; - Assert.AreEqual(2, m.GetMessages().Count(), "conflict should not be shown"); - Assert.AreEqual("jill", m.GetMessages().First().Message.Author); - Assert.AreEqual("john", m.GetMessages().ToArray()[1].Message.Author); - } + m.ShowNotifications = true; + Assert.AreEqual(2, m.GetMessages().Count(), "conflict should not be shown"); + Assert.AreEqual("jill", m.GetMessages().First().Message.Author); + Assert.AreEqual("john", m.GetMessages().ToArray()[1].Message.Author); } } [Test] public void GetMessages_ReturnsMostRecentMessagePassingFilterInAnnotation() { - using (var folder = new TemporaryFolder("NotesModelTests")) + string contents = @" + + + + + + "; + using (CreateNotesFile(_folder, contents)) { - string contents = @" - - - - - - "; - using (CreateNotesFile(folder, contents)) - { - var repos = AnnotationRepository.CreateRepositoriesFromFolder(folder.Path, _progress); - var m = new NotesInProjectViewModel(TheUser, repos, new ChorusNotesDisplaySettings(), - new ConsoleProgress()); - Assert.AreEqual(2, m.GetMessages().Count(), "Should get one from each annotation by default"); - Assert.That(m.GetMessages().First().Message.Author, Is.EqualTo("bill"), "bill's is the newest message"); - Assert.That(m.GetMessages().Last().Message.Author, Is.EqualTo("bob"), "bob's is the oldest message"); - m.SearchText = "john"; - Assert.AreEqual(1, m.GetMessages().Count(), "Should only get a message from the annotation where one passes filter"); - Assert.That(m.GetMessages().First().Message.Author, Is.EqualTo("john"), "Should get one of John's messages (that pass filter)"); - Assert.That(m.GetMessages().First().Message.Date.Second, Is.EqualTo(36), "Should the newest message passing the filter"); - } + var repos = AnnotationRepository.CreateRepositoriesFromFolder(_folder.Path, _progress); + var m = new NotesInProjectViewModel(TheUser, repos, new ChorusNotesDisplaySettings(), + new ConsoleProgress()); + Assert.AreEqual(2, m.GetMessages().Count(), "Should get one from each annotation by default"); + Assert.That(m.GetMessages().First().Message.Author, Is.EqualTo("bill"), "bill's is the newest message"); + Assert.That(m.GetMessages().Last().Message.Author, Is.EqualTo("bob"), "bob's is the oldest message"); + m.SearchText = "john"; + Assert.AreEqual(1, m.GetMessages().Count(), "Should only get a message from the annotation where one passes filter"); + Assert.That(m.GetMessages().First().Message.Author, Is.EqualTo("john"), "Should get one of John's messages (that pass filter)"); + Assert.That(m.GetMessages().First().Message.Date.Second, Is.EqualTo(36), "Should the newest message passing the filter"); } } } diff --git a/src/Chorus.Tests/UI/notes/NotesUITests.cs b/src/Chorus.Tests/UI/notes/NotesUITests.cs index 15ee8e24a..c2af9bd0b 100644 --- a/src/Chorus.Tests/UI/notes/NotesUITests.cs +++ b/src/Chorus.Tests/UI/notes/NotesUITests.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Drawing; +using System.Threading; using System.Windows.Forms; using Chorus.notes; using Chorus.UI.Notes; @@ -62,7 +63,7 @@ some description of the conflict } } - [Test, RequiresSTA, Ignore("By Hand only")] + [Test, Apartment(ApartmentState.STA), Ignore("By Hand only")] public void ShowNotesBrowser_LargeNumber() { using (var f = new TempFile("")) @@ -81,7 +82,7 @@ public void ShowNotesBrowser_LargeNumber() } } - [Test, Ignore("By Hand only"), RequiresSTA] + [Test, Ignore("By Hand only"), Apartment(ApartmentState.STA)] public void ShowNotesBrowser_SmallNumber() { using (var folder = new TemporaryFolder("NotesModelTests")) diff --git a/src/Chorus.Tests/clone/ClonerTests.cs b/src/Chorus.Tests/clone/ClonerTests.cs index 5ff9de761..e83c2476a 100644 --- a/src/Chorus.Tests/clone/ClonerTests.cs +++ b/src/Chorus.Tests/clone/ClonerTests.cs @@ -26,7 +26,7 @@ public void MakeClone_NoProblems_MakesClone() var progress = new ConsoleProgress(); progress.ShowVerbose = true; model.MakeClone(repo.ProjectFolder.Path, f.Path, progress); - Assert.IsTrue(Directory.Exists(f.Combine(RepositorySetup.ProjectNameForTest, ".hg"))); + Assert.That(f.Combine(RepositorySetup.ProjectNameForTest, ".hg"), Does.Exist); } } @@ -47,8 +47,8 @@ public void MakeClone_TargetExists_CreatesCloneInAnotherFolder() Directory.CreateDirectory(extantSubfolderPath); var cloneFolder = model.MakeClone(repo.ProjectFolder.Path, f.Path, progress); - Assert.AreEqual(extantFolder + "1", cloneFolder); - Assert.IsTrue(Directory.Exists(extantFolder + "1")); + Assert.That(cloneFolder, Is.EqualTo(extantFolder + "1")); + Assert.That(extantFolder + "1", Does.Exist); } } @@ -66,9 +66,9 @@ public void MakeClone_TargetExists_CreatesCloneInWhenTargetIsEmpty() Directory.CreateDirectory(extantFolder); var cloneFolder = model.MakeClone(repo.ProjectFolder.Path, f.Path, progress); - Assert.AreEqual(extantFolder, cloneFolder); - Assert.IsTrue(Directory.Exists(extantFolder)); - Assert.IsFalse(Directory.Exists(extantFolder + "1")); + Assert.That(cloneFolder, Is.EqualTo(extantFolder)); + Assert.That(extantFolder, Does.Exist); + Assert.That(extantFolder + "1", Does.Not.Exist); } } diff --git a/src/Chorus.Tests/packages.config b/src/Chorus.Tests/packages.config deleted file mode 100644 index 0ffdb4f8e..000000000 --- a/src/Chorus.Tests/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/Chorus/Chorus.csproj b/src/Chorus/Chorus.csproj index ce8d5f91d..85567c3de 100644 --- a/src/Chorus/Chorus.csproj +++ b/src/Chorus/Chorus.csproj @@ -1,689 +1,86 @@ - - + + - Debug - AnyCPU - 9.0.21022 - 2.0 - {9DA5A655-1881-4BE1-81BA-256E47CF7537} - WinExe - Properties + net461 Chorus - Chorus - 512 - Chorus.Program - chorus.ico - - - 3.5 - - false - v4.6.1 - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - true - - - True - full - False - ..\..\output\Debug - DEBUG;TRACE - prompt - 4 - True - AnyCPU - ..\..\output\Debug\Chorus.XML - true - false - 6 + Chorus + Debug;Release + End-user collaboration library via 3-way xml merging and hg dvcs under the hood. + SIL International + SIL International + chorus + Copyright © 2010-2020 SIL International + SIL.Chorus.App + MIT + https://github.com/sillsdev/chorus + false + ../../output/$(Configuration) + ../../output + true + ../FieldWorks.snk + None + Exe + true + snupkg + + + ../../CHANGELOG.md 1591 - - - pdbonly - True - ..\..\output\Release - TRACE - prompt - 4 - True - True + false + AnyCPU - false - 6 - - - True - ..\..\output\DebugMono - DEBUG;TRACE;MONO - True - ..\..\output\DebugMono\Chorus.XML - full - prompt - - - 4 - False - false - 6 - - - True - ..\..\output\ReleaseMono - TRACE;MONO - True - True - pdbonly - prompt - - - 4 - false - 6 + win7-x86;win7-x64 - - true - ..\..\output\Debug\ - DEBUG;TRACE - true - ..\..\output\Debug\Chorus.XML - full - AnyCPU - 6 - prompt - MinimumRecommendedRules.ruleset - - - true - ..\..\output\Release\ - TRACE - true - true - pdbonly - AnyCPU - 6 - prompt - MinimumRecommendedRules.ruleset - - - - ..\..\lib\Debug\L10NSharp.dll - - - False - ..\..\lib\Debug\SIL.Core.dll - - - False - ..\..\lib\Debug\SIL.Core.Desktop.dll - - - False - ..\..\lib\Debug\SIL.Windows.Forms.dll - - - False - ..\..\lib\Debug\SIL.Windows.Forms.GeckoBrowserAdapter.dll - - - - - ..\..\lib\Release\L10NSharp.dll - - - False - ..\..\lib\Release\SIL.Core.dll - - - False - ..\..\lib\Release\SIL.Core.Desktop.dll - - - False - ..\..\lib\Release\SIL.Windows.Forms.dll - - - False - ..\..\lib\Release\SIL.Windows.Forms.GeckoBrowserAdapter.dll - - - - - ..\..\lib\DebugMono\L10NSharp.dll - - - False - ..\..\lib\DebugMono\SIL.Core.dll - - - False - ..\..\lib\DebugMono\SIL.Core.Desktop.dll - - - False - ..\..\lib\DebugMono\SIL.Windows.Forms.dll - - - False - ..\..\lib\DebugMono\SIL.Windows.Forms.GeckoBrowserAdapter.dll - + + + + + + + + + - - - ..\..\lib\ReleaseMono\L10NSharp.dll - - - ..\..\lib\ReleaseMono\SIL.Core.dll - - - ..\..\lib\ReleaseMono\SIL.Core.Desktop.dll - - - ..\..\lib\ReleaseMono\SIL.Windows.Forms.dll - - - False - ..\..\lib\ReleaseMono\SIL.Windows.Forms.GeckoBrowserAdapter.dll - + + + + - - ..\..\packages\Autofac.2.6.3.862\lib\NET40\Autofac.dll - - - - - - - - - - {94245366-8F1E-475C-810D-FE89BB3948E0} - LibChorus - - - ..\..\packages\Vulcan.Uczniowie.HelpProvider.1.0.16\lib\net461\Vulcan.Uczniowie.HelpProvider.dll - True - + - - - - - - - - Component - - - BetterLabel.cs - - - Form - - - DuplicateProjectWarningDialog.cs - - - Form - - - GetSharedProjectDlg.cs - - - - - - Form - - - GetCloneFromChorusHubDialog.cs - - - - - UserControl - - - ServerSettingsControl.cs - - - - UserControl - - - TargetFolderControl.cs - - - Form - - - GetCloneFromInternetDialog.cs - - - Form - - - GetCloneFromUsbDialog.cs - - - UserControl - - - TroubleshootingView.cs - - - UserControl - - - ReadinessPanel.cs - - - - Form - - - AnnotationInspector.cs - - - - Form - - - ConflictDetailsForm.cs - - - - - Form - - - NoteDetailDialog.cs - - - - UserControl - - - NotesBarView.cs - - - UserControl - - - NotesBrowserPage.cs - - - UserControl - - - SearchBox.cs - - - - - UserControl - - - ChangeReportView.cs - - - UserControl - - - ChangesInRevisionView.cs - - - - - UserControl - - - AnnotationEditorView.cs - - - - UserControl - - - NotesInProjectView.cs - - - - True + True - HistoryRowIcons.resx - - - UserControl - - - RevisionsInRepositoryView.cs - - - - UserControl - - - HistoryPage.cs - - - - - DuplicateProjectWarningDialog.cs - - - GetCloneFromChorusHubDialog.cs - Designer - - - GetSharedProjectDlg.cs - - - ChangeReportView.cs - Designer - - - HistoryPage.cs - Designer - - - ResXFileCodeGenerator - HistoryRowIcons.Designer.cs - Designer - - - RevisionsInRepositoryView.cs - Designer - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - ChangesInRevisionView.cs - Designer - - - Shell.cs - Designer - - - SendReceiveSettings.cs - - - SettingsView.cs - Designer - - - SetupPanel.cs - Designer - - - SyncPanel.cs - Designer - - True Resources.resx - True - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - + + True True Settings.settings - True - - - - Form - - - SendReceiveSettings.cs - - - - Form - - - Shell.cs - - - UserControl - - - SettingsView.cs - - - UserControl - - - SetupPanel.cs - - - Form - - - ServerSettingsDialog.cs - - - - UserControl - - - SyncControl.cs - - - Form - - - SyncDialog.cs - - - UserControl - - - SyncPanel.cs - - - - UserControl - - - SyncStartControl.cs - - - - Component - - - UsbDriveLocator.cs + + SettingsSingleFileGenerator + Settings.Designer.cs + + - - - BetterLabel.cs - Designer - - - ServerSettingsControl.cs - Designer - - - TargetFolderControl.cs - Designer - - - GetCloneFromInternetDialog.cs - Designer - - - GetCloneFromUsbDialog.cs - Designer - - - TroubleshootingView.cs - Designer - - - ReadinessPanel.cs - Designer - - - AnnotationInspector.cs - Designer - - - AnnotationEditorView.cs - Designer - - - NoteDetailDialog.cs - Designer - - - NotesBarView.cs - Designer - - - NotesInProjectView.cs - Designer - - - NotesBrowserPage.cs - Designer - - - SearchBox.cs - Designer - - - ServerSettingsDialog.cs - Designer - - - ConflictDetailsForm.cs - Designer - - - SyncControl.cs - Designer - - - SyncDialog.cs - Designer - - - SyncStartControl.cs - Designer - - - Designer + + ResXFileCodeGenerator + Resources.Designer.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - + + + + $(AssemblySearchPaths);{GAC} + + \ No newline at end of file diff --git a/src/Chorus/Properties/AssemblyInfo.cs b/src/Chorus/Properties/AssemblyInfo.cs index d8cfdd6a9..0dc35040c 100644 --- a/src/Chorus/Properties/AssemblyInfo.cs +++ b/src/Chorus/Properties/AssemblyInfo.cs @@ -1,39 +1,6 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; +using System.Runtime.CompilerServices; using Vulcan.Uczniowie.HelpProvider; -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Chorus")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("SIL International")] -[assembly: AssemblyProduct("Chorus")] -[assembly: AssemblyCopyright("Copyright © 2009")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] [assembly: AssemblyHelpMapFileName("chorus.helpmap")] -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("c483028f-9e77-4cc9-b685-63947681c645")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.1.0.0")] -[assembly: AssemblyFileVersion("1.1.0.0")] -[assembly: InternalsVisibleTo("Chorus.Tests")] \ No newline at end of file +[assembly: InternalsVisibleTo("Chorus.Tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001005f4452c387d979e3cba05fd73bb9aebe8f8830874663d66a7869f614a8f5e8def658d5c5920fae609d28aa005d5a9af5bd758ca8f19ad0347b7aa76e1f723f8994792136f5ceff9fb6f719d4337f65da2e1d66a85cc5e28e4656a1a30c2ff513440393177625c725d3fb156dc3c11610ea5936b9404ab9d51f7eb71ac0aa27bd")] \ No newline at end of file diff --git a/src/Chorus/Properties/Resources.Designer.cs b/src/Chorus/Properties/Resources.Designer.cs index c0bb12507..5c2453e3b 100644 --- a/src/Chorus/Properties/Resources.Designer.cs +++ b/src/Chorus/Properties/Resources.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.17626 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -9,333 +9,333 @@ //------------------------------------------------------------------------------ namespace Chorus.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Chorus.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap check12x12 { - get { - object obj = ResourceManager.GetObject("check12x12", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap check16x16 { - get { - object obj = ResourceManager.GetObject("check16x16", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap chorus32x32 { - get { - object obj = ResourceManager.GetObject("chorus32x32", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap chorusHubLarge { - get { - object obj = ResourceManager.GetObject("chorusHubLarge", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap chorusHubMedium { - get { - object obj = ResourceManager.GetObject("chorusHubMedium", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Committer_Person { - get { - object obj = ResourceManager.GetObject("Committer Person", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream. - /// - internal static System.IO.UnmanagedMemoryStream errorSound { - get { - return ResourceManager.GetStream("errorSound", resourceCulture); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap expand { - get { - object obj = ResourceManager.GetObject("expand", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Filter { - get { - object obj = ResourceManager.GetObject("Filter", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream. - /// - internal static System.IO.UnmanagedMemoryStream finishedSound { - get { - return ResourceManager.GetStream("finishedSound", resourceCulture); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap internet29x32 { - get { - object obj = ResourceManager.GetObject("internet29x32", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap internet59x64 { - get { - object obj = ResourceManager.GetObject("internet59x64", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap menuButton { - get { - object obj = ResourceManager.GetObject("menuButton", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap networkFolder29x32 { - get { - object obj = ResourceManager.GetObject("networkFolder29x32", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap networkFolder58x64 { - get { - object obj = ResourceManager.GetObject("networkFolder58x64", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap NewNote16x16 { - get { - object obj = ResourceManager.GetObject("NewNote16x16", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap search16x16 { - get { - object obj = ResourceManager.GetObject("search16x16", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap search18x18 { - get { - object obj = ResourceManager.GetObject("search18x18", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap send_receive_small { - get { - object obj = ResourceManager.GetObject("send_receive_small", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap sendReceiveCircle16x16png { - get { - object obj = ResourceManager.GetObject("sendReceiveCircle16x16png", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Usb32x28 { - get { - object obj = ResourceManager.GetObject("Usb32x28", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Usb64x64 { - get { - object obj = ResourceManager.GetObject("Usb64x64", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap warning16x16 { - get { - object obj = ResourceManager.GetObject("warning16x16", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap warning24x24 { - get { - object obj = ResourceManager.GetObject("warning24x24", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap warningImage { - get { - object obj = ResourceManager.GetObject("warningImage", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream. - /// - internal static System.IO.UnmanagedMemoryStream warningSound { - get { - return ResourceManager.GetStream("warningSound", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <?xml version="1.0" encoding="utf-16"?> - ///<!-- - /// | - /// | XSLT REC Compliant Version of IE5 Default Stylesheet - /// | - /// | Original version by Jonathan Marsh (jmarsh@xxxxxxxxxxxxx) - /// | http://msdn.microsoft.com/xml/samples/defaultss/defaultss.xsl - /// | - /// | Conversion to XSLT 1.0 REC Syntax by Steve Muench (smuench@xxxxxxxxxx) - /// | - /// | 14-Mar-2008 George Zabanah Modifications made to the XSLT stylesheet - /// | to add a little spacing and change default colour - /// | of na [rest of string was truncated]";. - /// - internal static string XmlToHtml10Basic { - get { - return ResourceManager.GetString("XmlToHtml10Basic", resourceCulture); - } - } - } + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Chorus.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap check12x12 { + get { + object obj = ResourceManager.GetObject("check12x12", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap check16x16 { + get { + object obj = ResourceManager.GetObject("check16x16", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap chorus32x32 { + get { + object obj = ResourceManager.GetObject("chorus32x32", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap chorusHubLarge { + get { + object obj = ResourceManager.GetObject("chorusHubLarge", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap chorusHubMedium { + get { + object obj = ResourceManager.GetObject("chorusHubMedium", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Committer_Person { + get { + object obj = ResourceManager.GetObject("Committer Person", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream. + /// + internal static System.IO.UnmanagedMemoryStream errorSound { + get { + return ResourceManager.GetStream("errorSound", resourceCulture); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap expand { + get { + object obj = ResourceManager.GetObject("expand", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Filter { + get { + object obj = ResourceManager.GetObject("Filter", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream. + /// + internal static System.IO.UnmanagedMemoryStream finishedSound { + get { + return ResourceManager.GetStream("finishedSound", resourceCulture); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap internet29x32 { + get { + object obj = ResourceManager.GetObject("internet29x32", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap internet59x64 { + get { + object obj = ResourceManager.GetObject("internet59x64", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap menuButton { + get { + object obj = ResourceManager.GetObject("menuButton", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap networkFolder29x32 { + get { + object obj = ResourceManager.GetObject("networkFolder29x32", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap networkFolder58x64 { + get { + object obj = ResourceManager.GetObject("networkFolder58x64", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap NewNote16x16 { + get { + object obj = ResourceManager.GetObject("NewNote16x16", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap search16x16 { + get { + object obj = ResourceManager.GetObject("search16x16", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap search18x18 { + get { + object obj = ResourceManager.GetObject("search18x18", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap send_receive_small { + get { + object obj = ResourceManager.GetObject("send_receive_small", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap sendReceiveCircle16x16png { + get { + object obj = ResourceManager.GetObject("sendReceiveCircle16x16png", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Usb32x28 { + get { + object obj = ResourceManager.GetObject("Usb32x28", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Usb64x64 { + get { + object obj = ResourceManager.GetObject("Usb64x64", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap warning16x16 { + get { + object obj = ResourceManager.GetObject("warning16x16", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap warning24x24 { + get { + object obj = ResourceManager.GetObject("warning24x24", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap warningImage { + get { + object obj = ResourceManager.GetObject("warningImage", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream. + /// + internal static System.IO.UnmanagedMemoryStream warningSound { + get { + return ResourceManager.GetStream("warningSound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to <?xml version="1.0" encoding="utf-16"?> + ///<!-- + /// | + /// | XSLT REC Compliant Version of IE5 Default Stylesheet + /// | + /// | Original version by Jonathan Marsh (jmarsh@xxxxxxxxxxxxx) + /// | http://msdn.microsoft.com/xml/samples/defaultss/defaultss.xsl + /// | + /// | Conversion to XSLT 1.0 REC Syntax by Steve Muench (smuench@xxxxxxxxxx) + /// | + /// | 14-Mar-2008 George Zabanah Modifications made to the XSLT stylesheet + /// | to add a little spacing and change default colour + /// | of na [rest of string was truncated]";. + /// + internal static string XmlToHtml10Basic { + get { + return ResourceManager.GetString("XmlToHtml10Basic", resourceCulture); + } + } + } } diff --git a/src/Chorus/Properties/Settings.Designer.cs b/src/Chorus/Properties/Settings.Designer.cs index a0c393761..5c81ff520 100644 --- a/src/Chorus/Properties/Settings.Designer.cs +++ b/src/Chorus/Properties/Settings.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.17626 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -9,66 +9,66 @@ //------------------------------------------------------------------------------ namespace Chorus.Properties { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default { - get { - return defaultInstance; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("")] - public string PathToRepository { - get { - return ((string)(this["PathToRepository"])); - } - set { - this["PathToRepository"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("True")] - public bool InternetEnabled { - get { - return ((bool)(this["InternetEnabled"])); - } - set { - this["InternetEnabled"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool SharedFolderEnabled { - get { - return ((bool)(this["SharedFolderEnabled"])); - } - set { - this["SharedFolderEnabled"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("True")] - public bool ShowChorusHubInSendReceive { - get { - return ((bool)(this["ShowChorusHubInSendReceive"])); - } - set { - this["ShowChorusHubInSendReceive"] = value; - } - } - } + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string PathToRepository { + get { + return ((string)(this["PathToRepository"])); + } + set { + this["PathToRepository"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool InternetEnabled { + get { + return ((bool)(this["InternetEnabled"])); + } + set { + this["InternetEnabled"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool SharedFolderEnabled { + get { + return ((bool)(this["SharedFolderEnabled"])); + } + set { + this["SharedFolderEnabled"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool ShowChorusHubInSendReceive { + get { + return ((bool)(this["ShowChorusHubInSendReceive"])); + } + set { + this["ShowChorusHubInSendReceive"] = value; + } + } + } } diff --git a/src/Chorus/UI/Clone/GetCloneFromChorusHubDialog.cs b/src/Chorus/UI/Clone/GetCloneFromChorusHubDialog.cs index eddbcef13..b40a14dc6 100644 --- a/src/Chorus/UI/Clone/GetCloneFromChorusHubDialog.cs +++ b/src/Chorus/UI/Clone/GetCloneFromChorusHubDialog.cs @@ -7,6 +7,7 @@ using Chorus.ChorusHub; using Chorus.VcsDrivers; using L10NSharp; +using SIL.PlatformUtilities; using SIL.Progress; using SIL.Windows.Forms.Progress; @@ -110,12 +111,9 @@ private void SwitchControlsForCloning() Height = 10, Style = ProgressBarStyle.Marquee, Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top, - MarqueeAnimationSpeed = 50 + MarqueeAnimationSpeed = Platform.IsMono ? 3000 : 50 }; -#if MONO - progressIndicator.MarqueeAnimationSpeed = 3000; -#else -#endif + progressIndicator.IndicateUnknownProgress(); _clonerStatusLabel = new TextBox @@ -233,9 +231,12 @@ void OnGetChorusHubInfo_Completed(object sender, RunWorkerCompletedEventArgs e) void OnChorusHubInfo_DoWork(object sender, DoWorkEventArgs e) { -#if !MONO // See https://bugzilla.xamarin.com/show_bug.cgi?id=4269. Remove #if when using mono that fixes this. - Thread.CurrentThread.Name = @"GetRepositoryInformation"; -#endif + if (Platform.IsWindows) + { + // See https://bugzilla.xamarin.com/show_bug.cgi?id=4269. Remove if when using mono that fixes this. + Thread.CurrentThread.Name = @"GetRepositoryInformation"; + } + var chorusHubServerInfo = ChorusHubServerInfo.FindServerInformation(); if (chorusHubServerInfo == null || !chorusHubServerInfo.ServerIsCompatibleWithThisClient) diff --git a/src/Chorus/UI/Clone/GetCloneFromInternetDialog.cs b/src/Chorus/UI/Clone/GetCloneFromInternetDialog.cs index 4a2693354..0f551a1d3 100644 --- a/src/Chorus/UI/Clone/GetCloneFromInternetDialog.cs +++ b/src/Chorus/UI/Clone/GetCloneFromInternetDialog.cs @@ -6,6 +6,7 @@ using Chorus.UI.Misc; using Chorus.VcsDrivers.Mercurial; using L10NSharp; +using SIL.PlatformUtilities; namespace Chorus.UI.Clone { @@ -27,9 +28,7 @@ public GetCloneFromInternetDialog(string parentDirectoryToPutCloneIn) public GetCloneFromInternetDialog(GetCloneFromInternetModel model) { _model = model; -//#if !MONO Font = SystemFonts.MessageBoxFont; -//#endif InitializeComponent(); Font = SystemFonts.MessageBoxFont; @@ -152,11 +151,8 @@ private void UpdateDisplay(State newState) _statusImage.Visible = false; _progressBar.Visible = true; _progressBar.Style = ProgressBarStyle.Marquee; -#if MONO - _progressBar.MarqueeAnimationSpeed = 3000; -#else - _progressBar.MarqueeAnimationSpeed = 50; -#endif + _progressBar.MarqueeAnimationSpeed = Platform.IsMono ? 3000 : 50; + _statusLabel.Visible = true; _statusLabel.Text = LocalizationManager.GetString("Messages.GettingProject", "Getting project..."); _statusLabel.Left = _progressBar.Left; @@ -187,9 +183,9 @@ private void UpdateDisplay(State newState) _fixSettingsButton.Visible = true; _fixSettingsButton.Focus(); _cancelButton.Visible = true; -#if !MONO - _cancelButton.Text = LocalizationManager.GetString("Common.Cancel", "&Cancel"); -#endif + if (!Platform.IsMono) + _cancelButton.Text = LocalizationManager.GetString("Common.Cancel", "&Cancel"); + //_cancelButton.Select(); _cancelTaskButton.Visible = false; _statusLabel.Visible = true; diff --git a/src/Chorus/UI/Misc/ServerSettingsControl.Designer.cs b/src/Chorus/UI/Misc/ServerSettingsControl.Designer.cs index bf121e480..5937019e0 100644 --- a/src/Chorus/UI/Misc/ServerSettingsControl.Designer.cs +++ b/src/Chorus/UI/Misc/ServerSettingsControl.Designer.cs @@ -153,7 +153,9 @@ private void InitializeComponent() this.tableLayoutPanel1.Controls.Add(this._passwordLabel, 0, 1); this.tableLayoutPanel1.Controls.Add(this._bandwidthLabel, 0, 4); this.tableLayoutPanel1.Controls.Add(this._accountLabel, 0, 0); + this.tableLayoutPanel1.Controls.Add(this._username, 1, 0); this.tableLayoutPanel1.Controls.Add(this._tlpCustomUrl, 1, 2); + this.tableLayoutPanel1.Controls.Add(this._password, 1, 1); this.tableLayoutPanel1.Controls.Add(this._bandwidth, 1, 4); this.tableLayoutPanel1.Controls.Add(this._projectId, 1, 5); this.tableLayoutPanel1.Controls.Add(this._tlpLogIn, 1, 3); @@ -173,7 +175,7 @@ private void InitializeComponent() this.tableLayoutPanel1.TabIndex = 30; // // _bandwidthLabel - // + // this._bandwidthLabel.Anchor = System.Windows.Forms.AnchorStyles.Right; this._bandwidthLabel.AutoSize = true; this.l10NSharpExtender1.SetLocalizableToolTip(this._bandwidthLabel, null); @@ -184,9 +186,12 @@ private void InitializeComponent() this._bandwidthLabel.Size = new System.Drawing.Size(57, 13); this._bandwidthLabel.TabIndex = 25; this._bandwidthLabel.Text = "&Bandwidth"; - // + // // _tlpCustomUrl // + this._tlpCustomUrl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this._tlpCustomUrl.ColumnCount = 2; this._tlpCustomUrl.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); this._tlpCustomUrl.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); @@ -228,7 +233,7 @@ private void InitializeComponent() this._customUrl.TextChanged += new System.EventHandler(this._customUrl_TextChanged); // // _bandwidth - // + // this._bandwidth.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); this._bandwidth.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this._bandwidth.FormattingEnabled = true; diff --git a/src/Chorus/UI/Notes/AnnotationEditorModel.cs b/src/Chorus/UI/Notes/AnnotationEditorModel.cs index e443d3a80..2887d304b 100644 --- a/src/Chorus/UI/Notes/AnnotationEditorModel.cs +++ b/src/Chorus/UI/Notes/AnnotationEditorModel.cs @@ -25,7 +25,9 @@ public class AnnotationEditorModel public MessageSelectedEvent EventToRaiseForChangedMessage { get; } internal event EventHandler UpdateContent; +#pragma warning disable 67 internal event EventHandler UpdateStates; +#pragma warning restore 67 diff --git a/src/Chorus/UI/Review/ChangedReport/ChangeReportView.cs b/src/Chorus/UI/Review/ChangedReport/ChangeReportView.cs index 476a6b083..987a57eb3 100644 --- a/src/Chorus/UI/Review/ChangedReport/ChangeReportView.cs +++ b/src/Chorus/UI/Review/ChangedReport/ChangeReportView.cs @@ -9,6 +9,7 @@ using Chorus.merge; using Chorus.retrieval; using Chorus.VcsDrivers.Mercurial; +using SIL.PlatformUtilities; namespace Chorus.UI.Review.ChangedReport { @@ -26,9 +27,8 @@ public ChangeReportView(ChorusFileTypeHandlerCollection handlers, ChangedRecordS InitializeComponent(); _normalChangeDescriptionRenderer.Font = SystemFonts.MessageBoxFont; changedRecordSelectedEvent.Subscribe(r=>LoadReport(r)); -#if !MONO - _normalChangeDescriptionRenderer.Navigated += webBrowser1_Navigated; -#endif + if (Platform.IsWindows) + _normalChangeDescriptionRenderer.Navigated += webBrowser1_Navigated; _styleSheet = CreateStyleSheet(writingSystems); } @@ -60,22 +60,21 @@ private string CreateStyleSheet(IEnumerable writingSystems) return styleSheetBuilder.ToString(); } -#if !MONO private void webBrowser1_Navigated(object sender, WebBrowserNavigatedEventArgs e) { //didn't work, 'cuase is't actually still being held by the browser // File.Delete(e.URI.AbsoluteUri.Replace(@"file:///", string.Empty)); } -#endif public void LoadReport(IChangeReport report) { if (report == null) { -#if !MONO - // GECKOFX blank url does not blank page - _normalChangeDescriptionRenderer.Navigate(string.Empty); -#endif + if (Platform.IsWindows) + { + // GECKOFX blank url does not blank page + _normalChangeDescriptionRenderer.Navigate(string.Empty); + } } else { diff --git a/src/Chorus/UI/Settings/SendReceiveSettings.Designer.cs b/src/Chorus/UI/Settings/SendReceiveSettings.Designer.cs index cec406180..ad0a19fbf 100644 --- a/src/Chorus/UI/Settings/SendReceiveSettings.Designer.cs +++ b/src/Chorus/UI/Settings/SendReceiveSettings.Designer.cs @@ -32,321 +32,321 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); - this.nameLabel = new System.Windows.Forms.Label(); - this.userNameTextBox = new System.Windows.Forms.TextBox(); - this.settingsTabs = new System.Windows.Forms.TabControl(); - this.internetTab = new System.Windows.Forms.TabPage(); - this.pictureBox1 = new System.Windows.Forms.PictureBox(); - this._internetSettingsLayout = new System.Windows.Forms.TableLayoutPanel(); - this._internetButtonEnabledCheckBox = new System.Windows.Forms.CheckBox(); - this._serverSettingsControl = new Chorus.UI.Misc.ServerSettingsControl(); - this.chorusHubTab = new System.Windows.Forms.TabPage(); - this._showChorusHubInSendReceive = new System.Windows.Forms.CheckBox(); - this.chorusHubSetup = new SIL.Windows.Forms.HtmlBrowser.XWebBrowser(); - this.pictureBox4 = new System.Windows.Forms.PictureBox(); - this._helpButton = new System.Windows.Forms.Button(); - this._cancelButton = new System.Windows.Forms.Button(); - this._okButton = new System.Windows.Forms.Button(); - this.settingsProtectionButton = new SIL.Windows.Forms.SettingProtection.SettingsProtectionLauncherButton(); - this.pictureBox3 = new System.Windows.Forms.PictureBox(); - this._helpProvider = new Vulcan.Uczniowie.HelpProvider.HelpComponent(this.components); - this.l10NSharpExtender1 = new L10NSharp.UI.L10NSharpExtender(this.components); - this.settingsTabs.SuspendLayout(); - this.internetTab.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); - this._internetSettingsLayout.SuspendLayout(); - this.chorusHubTab.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.l10NSharpExtender1)).BeginInit(); - this.SuspendLayout(); - // - // nameLabel - // - this.nameLabel.AutoSize = true; - this.l10NSharpExtender1.SetLocalizableToolTip(this.nameLabel, null); - this.l10NSharpExtender1.SetLocalizationComment(this.nameLabel, null); - this.l10NSharpExtender1.SetLocalizingId(this.nameLabel, "SendReceiveSettings.NameToShow"); - this.nameLabel.Location = new System.Drawing.Point(84, 9); - this.nameLabel.Name = "nameLabel"; - this.nameLabel.Size = new System.Drawing.Size(161, 13); - this.nameLabel.TabIndex = 0; - this.nameLabel.Text = "Name to show in change history:"; - // - // userNameTextBox - // - this.l10NSharpExtender1.SetLocalizableToolTip(this.userNameTextBox, null); - this.l10NSharpExtender1.SetLocalizationComment(this.userNameTextBox, null); - this.l10NSharpExtender1.SetLocalizingId(this.userNameTextBox, "SendReceiveSettings.SendReceiveSettings.userNameTextBox"); - this.userNameTextBox.Location = new System.Drawing.Point(86, 25); - this.userNameTextBox.Name = "userNameTextBox"; - this.userNameTextBox.Size = new System.Drawing.Size(158, 20); - this.userNameTextBox.TabIndex = 1; - this.userNameTextBox.TextChanged += new System.EventHandler(this.userNameTextBox_TextChanged); - // - // settingsTabs - // - this.settingsTabs.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.settingsTabs.Controls.Add(this.internetTab); - this.settingsTabs.Controls.Add(this.chorusHubTab); - this.settingsTabs.Location = new System.Drawing.Point(13, 77); - this.settingsTabs.Name = "settingsTabs"; - this.settingsTabs.SelectedIndex = 0; - this.settingsTabs.Size = new System.Drawing.Size(484, 294); - this.settingsTabs.TabIndex = 2; - // - // internetTab - // - this.internetTab.Controls.Add(this.pictureBox1); - this.internetTab.Controls.Add(this._internetSettingsLayout); - this.l10NSharpExtender1.SetLocalizableToolTip(this.internetTab, null); - this.l10NSharpExtender1.SetLocalizationComment(this.internetTab, null); - this.l10NSharpExtender1.SetLocalizingId(this.internetTab, "SendReceiveSettings.Internet"); - this.internetTab.Location = new System.Drawing.Point(4, 22); - this.internetTab.Name = "internetTab"; - this.internetTab.Padding = new System.Windows.Forms.Padding(3); - this.internetTab.Size = new System.Drawing.Size(476, 268); - this.internetTab.TabIndex = 0; - this.internetTab.Text = "Internet"; - this.internetTab.UseVisualStyleBackColor = true; - // - // pictureBox1 - // - this.pictureBox1.Image = global::Chorus.Properties.Resources.internet59x64; - this.l10NSharpExtender1.SetLocalizableToolTip(this.pictureBox1, null); - this.l10NSharpExtender1.SetLocalizationComment(this.pictureBox1, null); - this.l10NSharpExtender1.SetLocalizingId(this.pictureBox1, "SendReceiveSettings.SendReceiveSettings.pictureBox1"); - this.pictureBox1.Location = new System.Drawing.Point(6, 14); - this.pictureBox1.Name = "pictureBox1"; - this.pictureBox1.Size = new System.Drawing.Size(64, 66); - this.pictureBox1.TabIndex = 1; - this.pictureBox1.TabStop = false; - // - // _internetSettingsLayout - // - this._internetSettingsLayout.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this._internetSettingsLayout.AutoSize = true; - this._internetSettingsLayout.ColumnCount = 1; - this._internetSettingsLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this._internetSettingsLayout.Controls.Add(this._internetButtonEnabledCheckBox, 0, 0); - this._internetSettingsLayout.Controls.Add(this._serverSettingsControl, 0, 1); - this._internetSettingsLayout.Location = new System.Drawing.Point(73, 11); - this._internetSettingsLayout.Name = "_internetSettingsLayout"; - this._internetSettingsLayout.RowCount = 2; - this._internetSettingsLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 22F)); - this._internetSettingsLayout.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this._internetSettingsLayout.Size = new System.Drawing.Size(369, 229); - this._internetSettingsLayout.TabIndex = 0; - // - // _internetButtonEnabledCheckBox - // - this._internetButtonEnabledCheckBox.AutoSize = true; - this.l10NSharpExtender1.SetLocalizableToolTip(this._internetButtonEnabledCheckBox, null); - this.l10NSharpExtender1.SetLocalizationComment(this._internetButtonEnabledCheckBox, null); - this.l10NSharpExtender1.SetLocalizingId(this._internetButtonEnabledCheckBox, "SendReceiveSettings.ShowInternetOption"); - this._internetButtonEnabledCheckBox.Location = new System.Drawing.Point(88, 3); - this._internetButtonEnabledCheckBox.Margin = new System.Windows.Forms.Padding(88, 3, 3, 3); - this._internetButtonEnabledCheckBox.Name = "_internetButtonEnabledCheckBox"; - this._internetButtonEnabledCheckBox.Size = new System.Drawing.Size(211, 16); - this._internetButtonEnabledCheckBox.TabIndex = 0; - this._internetButtonEnabledCheckBox.Text = "&Show Internet as Send/Receive option"; - this._internetButtonEnabledCheckBox.UseVisualStyleBackColor = true; - // - // _serverSettingsControl - // - this._serverSettingsControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this._serverSettingsControl.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.l10NSharpExtender1.SetLocalizableToolTip(this._serverSettingsControl, null); - this.l10NSharpExtender1.SetLocalizationComment(this._serverSettingsControl, null); - this.l10NSharpExtender1.SetLocalizingId(this._serverSettingsControl, "SendReceiveSettings.SendReceiveSettings.ServerSettingsControl"); - this._serverSettingsControl.Location = new System.Drawing.Point(3, 25); - this._serverSettingsControl.MinimumSize = new System.Drawing.Size(363, 200); - this._serverSettingsControl.Model = null; - this._serverSettingsControl.Name = "_serverSettingsControl"; - this._serverSettingsControl.Size = new System.Drawing.Size(363, 201); - this._serverSettingsControl.TabIndex = 1; - // - // chorusHubTab - // - this.chorusHubTab.Controls.Add(this._showChorusHubInSendReceive); - this.chorusHubTab.Controls.Add(this.chorusHubSetup); - this.chorusHubTab.Controls.Add(this.pictureBox4); - this.l10NSharpExtender1.SetLocalizableToolTip(this.chorusHubTab, null); - this.l10NSharpExtender1.SetLocalizationComment(this.chorusHubTab, null); - this.l10NSharpExtender1.SetLocalizingId(this.chorusHubTab, "SendReceiveSettings.ChorusHub"); - this.chorusHubTab.Location = new System.Drawing.Point(4, 22); - this.chorusHubTab.Name = "chorusHubTab"; - this.chorusHubTab.Padding = new System.Windows.Forms.Padding(3); - this.chorusHubTab.Size = new System.Drawing.Size(476, 268); - this.chorusHubTab.TabIndex = 2; - this.chorusHubTab.Text = "Chorus Hub"; - this.chorusHubTab.UseVisualStyleBackColor = true; - // - // _showChorusHubInSendReceive - // - this._showChorusHubInSendReceive.AutoSize = true; - this.l10NSharpExtender1.SetLocalizableToolTip(this._showChorusHubInSendReceive, null); - this.l10NSharpExtender1.SetLocalizationComment(this._showChorusHubInSendReceive, null); - this.l10NSharpExtender1.SetLocalizingId(this._showChorusHubInSendReceive, "SendReceiveSettings.ShowChorusHub"); - this._showChorusHubInSendReceive.Location = new System.Drawing.Point(85, 17); - this._showChorusHubInSendReceive.Margin = new System.Windows.Forms.Padding(10, 3, 3, 3); - this._showChorusHubInSendReceive.Name = "_showChorusHubInSendReceive"; - this._showChorusHubInSendReceive.Size = new System.Drawing.Size(240, 17); - this._showChorusHubInSendReceive.TabIndex = 5; - this._showChorusHubInSendReceive.Text = "&Show Chorus Hub as a Send/Receive option"; - this._showChorusHubInSendReceive.UseVisualStyleBackColor = true; - // - // chorusHubSetup - // - this.chorusHubSetup.AllowWebBrowserDrop = false; - this.chorusHubSetup.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.chorusHubSetup.BackColor = System.Drawing.Color.White; - this.chorusHubSetup.Font = new System.Drawing.Font("Segoe UI", 9F); - this.chorusHubSetup.IsWebBrowserContextMenuEnabled = false; - this.l10NSharpExtender1.SetLocalizableToolTip(this.chorusHubSetup, null); - this.l10NSharpExtender1.SetLocalizationComment(this.chorusHubSetup, null); - this.l10NSharpExtender1.SetLocalizationPriority(this.chorusHubSetup, L10NSharp.LocalizationPriority.MediumLow); - this.l10NSharpExtender1.SetLocalizingId(this.chorusHubSetup, "SendReceiveSetting.ChorusHubDescription"); - this.chorusHubSetup.Location = new System.Drawing.Point(85, 44); - this.chorusHubSetup.Name = "chorusHubSetup"; - this.chorusHubSetup.Size = new System.Drawing.Size(0, 0); - this.chorusHubSetup.TabIndex = 4; - this.chorusHubSetup.TabStop = false; - this.chorusHubSetup.Url = new System.Uri("about:blank", System.UriKind.Absolute); - this.chorusHubSetup.WebBrowserShortcutsEnabled = false; - // - // pictureBox4 - // - this.pictureBox4.Image = global::Chorus.Properties.Resources.chorusHubLarge; - this.l10NSharpExtender1.SetLocalizableToolTip(this.pictureBox4, null); - this.l10NSharpExtender1.SetLocalizationComment(this.pictureBox4, null); - this.l10NSharpExtender1.SetLocalizingId(this.pictureBox4, "SendReceiveSettings.SendReceiveSettings.pictureBox4"); - this.pictureBox4.Location = new System.Drawing.Point(6, 17); - this.pictureBox4.Name = "pictureBox4"; - this.pictureBox4.Size = new System.Drawing.Size(64, 66); - this.pictureBox4.TabIndex = 3; - this.pictureBox4.TabStop = false; - // - // _helpButton - // - this._helpButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.l10NSharpExtender1.SetLocalizableToolTip(this._helpButton, null); - this.l10NSharpExtender1.SetLocalizationComment(this._helpButton, null); - this.l10NSharpExtender1.SetLocalizationPriority(this._helpButton, L10NSharp.LocalizationPriority.High); - this.l10NSharpExtender1.SetLocalizingId(this._helpButton, "Common.Help"); - this._helpButton.Location = new System.Drawing.Point(422, 399); - this._helpButton.Name = "_helpButton"; - this._helpButton.Size = new System.Drawing.Size(75, 23); - this._helpButton.TabIndex = 5; - this._helpButton.Text = "&Help"; - this._helpButton.UseVisualStyleBackColor = true; - this._helpButton.Click += new System.EventHandler(this._helpButton_Click); - // - // _cancelButton - // - this._cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this._cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.l10NSharpExtender1.SetLocalizableToolTip(this._cancelButton, null); - this.l10NSharpExtender1.SetLocalizationComment(this._cancelButton, null); - this.l10NSharpExtender1.SetLocalizingId(this._cancelButton, "Common.Cancel"); - this._cancelButton.Location = new System.Drawing.Point(341, 399); - this._cancelButton.Name = "_cancelButton"; - this._cancelButton.Size = new System.Drawing.Size(75, 23); - this._cancelButton.TabIndex = 4; - this._cancelButton.Text = "Cancel"; - this._cancelButton.UseVisualStyleBackColor = true; - this._cancelButton.Click += new System.EventHandler(this.cancelButton_Click); - // - // _okButton - // - this._okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.l10NSharpExtender1.SetLocalizableToolTip(this._okButton, null); - this.l10NSharpExtender1.SetLocalizationComment(this._okButton, null); - this.l10NSharpExtender1.SetLocalizingId(this._okButton, "Common.OK"); - this._okButton.Location = new System.Drawing.Point(260, 399); - this._okButton.Name = "_okButton"; - this._okButton.Size = new System.Drawing.Size(75, 23); - this._okButton.TabIndex = 3; - this._okButton.Text = "OK"; - this._okButton.UseVisualStyleBackColor = true; - this._okButton.Click += new System.EventHandler(this.okButton_Click); - // - // settingsProtectionButton - // - this.settingsProtectionButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.l10NSharpExtender1.SetLocalizableToolTip(this.settingsProtectionButton, null); - this.l10NSharpExtender1.SetLocalizationComment(this.settingsProtectionButton, null); - this.l10NSharpExtender1.SetLocalizationPriority(this.settingsProtectionButton, L10NSharp.LocalizationPriority.NotLocalizable); - this.l10NSharpExtender1.SetLocalizingId(this.settingsProtectionButton, "SendReceiveSettings.SendReceiveSettings.SettingsProtectionLauncherButton"); - this.settingsProtectionButton.Location = new System.Drawing.Point(14, 388); - this.settingsProtectionButton.Margin = new System.Windows.Forms.Padding(0); - this.settingsProtectionButton.Name = "settingsProtectionButton"; - this.settingsProtectionButton.Size = new System.Drawing.Size(258, 47); - this.settingsProtectionButton.TabIndex = 0; - // - // pictureBox3 - // - this.pictureBox3.Image = global::Chorus.Properties.Resources.Committer_Person; - this.l10NSharpExtender1.SetLocalizableToolTip(this.pictureBox3, null); - this.l10NSharpExtender1.SetLocalizationComment(this.pictureBox3, null); - this.l10NSharpExtender1.SetLocalizingId(this.pictureBox3, "SendReceiveSettings.SendReceiveSettings.pictureBox3"); - this.pictureBox3.Location = new System.Drawing.Point(17, 9); - this.pictureBox3.Name = "pictureBox3"; - this.pictureBox3.Size = new System.Drawing.Size(52, 51); - this.pictureBox3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; - this.pictureBox3.TabIndex = 6; - this.pictureBox3.TabStop = false; - // - // l10NSharpExtender1 - // - this.l10NSharpExtender1.LocalizationManagerId = "Chorus"; - this.l10NSharpExtender1.PrefixForNewItems = "SendReceiveSettings"; - // - // SendReceiveSettings - // - this.AcceptButton = this._okButton; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.CancelButton = this._cancelButton; - this.ClientSize = new System.Drawing.Size(508, 439); - this.Controls.Add(this.pictureBox3); - this.Controls.Add(this._okButton); - this.Controls.Add(this._cancelButton); - this.Controls.Add(this._helpButton); - this.Controls.Add(this.settingsTabs); - this.Controls.Add(this.userNameTextBox); - this.Controls.Add(this.nameLabel); - this.Controls.Add(this.settingsProtectionButton); - this.l10NSharpExtender1.SetLocalizableToolTip(this, null); - this.l10NSharpExtender1.SetLocalizationComment(this, null); - this.l10NSharpExtender1.SetLocalizingId(this, "SendReceiveSettings.WindowTitle"); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "SendReceiveSettings"; - this.ShowIcon = false; - this.ShowInTaskbar = false; - this.Text = "Send/Receive Settings"; - this.settingsTabs.ResumeLayout(false); - this.internetTab.ResumeLayout(false); - this.internetTab.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); - this._internetSettingsLayout.ResumeLayout(false); - this._internetSettingsLayout.PerformLayout(); - this.chorusHubTab.ResumeLayout(false); - this.chorusHubTab.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.l10NSharpExtender1)).EndInit(); - this.ResumeLayout(false); - this.PerformLayout(); + this.components = new System.ComponentModel.Container(); + this.nameLabel = new System.Windows.Forms.Label(); + this.userNameTextBox = new System.Windows.Forms.TextBox(); + this.settingsTabs = new System.Windows.Forms.TabControl(); + this.internetTab = new System.Windows.Forms.TabPage(); + this.pictureBox1 = new System.Windows.Forms.PictureBox(); + this._internetSettingsLayout = new System.Windows.Forms.TableLayoutPanel(); + this._internetButtonEnabledCheckBox = new System.Windows.Forms.CheckBox(); + this._serverSettingsControl = new Chorus.UI.Misc.ServerSettingsControl(); + this.chorusHubTab = new System.Windows.Forms.TabPage(); + this._showChorusHubInSendReceive = new System.Windows.Forms.CheckBox(); + this.chorusHubSetup = new SIL.Windows.Forms.HtmlBrowser.XWebBrowser(); + this.pictureBox4 = new System.Windows.Forms.PictureBox(); + this._helpButton = new System.Windows.Forms.Button(); + this._cancelButton = new System.Windows.Forms.Button(); + this._okButton = new System.Windows.Forms.Button(); + this.settingsProtectionButton = new SIL.Windows.Forms.SettingProtection.SettingsProtectionLauncherButton(); + this.pictureBox3 = new System.Windows.Forms.PictureBox(); + this._helpProvider = new Vulcan.Uczniowie.HelpProvider.HelpComponent(this.components); + this.l10NSharpExtender1 = new L10NSharp.UI.L10NSharpExtender(this.components); + this.settingsTabs.SuspendLayout(); + this.internetTab.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); + this._internetSettingsLayout.SuspendLayout(); + this.chorusHubTab.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.l10NSharpExtender1)).BeginInit(); + this.SuspendLayout(); + // + // nameLabel + // + this.nameLabel.AutoSize = true; + this.l10NSharpExtender1.SetLocalizableToolTip(this.nameLabel, null); + this.l10NSharpExtender1.SetLocalizationComment(this.nameLabel, null); + this.l10NSharpExtender1.SetLocalizingId(this.nameLabel, "SendReceiveSettings.NameToShow"); + this.nameLabel.Location = new System.Drawing.Point(84, 9); + this.nameLabel.Name = "nameLabel"; + this.nameLabel.Size = new System.Drawing.Size(161, 13); + this.nameLabel.TabIndex = 0; + this.nameLabel.Text = "Name to show in change history:"; + // + // userNameTextBox + // + this.l10NSharpExtender1.SetLocalizableToolTip(this.userNameTextBox, null); + this.l10NSharpExtender1.SetLocalizationComment(this.userNameTextBox, null); + this.l10NSharpExtender1.SetLocalizingId(this.userNameTextBox, "SendReceiveSettings.SendReceiveSettings.userNameTextBox"); + this.userNameTextBox.Location = new System.Drawing.Point(86, 25); + this.userNameTextBox.Name = "userNameTextBox"; + this.userNameTextBox.Size = new System.Drawing.Size(158, 20); + this.userNameTextBox.TabIndex = 1; + this.userNameTextBox.TextChanged += new System.EventHandler(this.userNameTextBox_TextChanged); + // + // settingsTabs + // + this.settingsTabs.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.settingsTabs.Controls.Add(this.internetTab); + this.settingsTabs.Controls.Add(this.chorusHubTab); + this.settingsTabs.Location = new System.Drawing.Point(13, 77); + this.settingsTabs.Name = "settingsTabs"; + this.settingsTabs.SelectedIndex = 0; + this.settingsTabs.Size = new System.Drawing.Size(484, 294); + this.settingsTabs.TabIndex = 2; + // + // internetTab + // + this.internetTab.Controls.Add(this.pictureBox1); + this.internetTab.Controls.Add(this._internetSettingsLayout); + this.l10NSharpExtender1.SetLocalizableToolTip(this.internetTab, null); + this.l10NSharpExtender1.SetLocalizationComment(this.internetTab, null); + this.l10NSharpExtender1.SetLocalizingId(this.internetTab, "SendReceiveSettings.Internet"); + this.internetTab.Location = new System.Drawing.Point(4, 22); + this.internetTab.Name = "internetTab"; + this.internetTab.Padding = new System.Windows.Forms.Padding(3); + this.internetTab.Size = new System.Drawing.Size(476, 268); + this.internetTab.TabIndex = 0; + this.internetTab.Text = "Internet"; + this.internetTab.UseVisualStyleBackColor = true; + // + // pictureBox1 + // + this.pictureBox1.Image = global::Chorus.Properties.Resources.internet59x64; + this.l10NSharpExtender1.SetLocalizableToolTip(this.pictureBox1, null); + this.l10NSharpExtender1.SetLocalizationComment(this.pictureBox1, null); + this.l10NSharpExtender1.SetLocalizingId(this.pictureBox1, "SendReceiveSettings.SendReceiveSettings.pictureBox1"); + this.pictureBox1.Location = new System.Drawing.Point(6, 14); + this.pictureBox1.Name = "pictureBox1"; + this.pictureBox1.Size = new System.Drawing.Size(64, 66); + this.pictureBox1.TabIndex = 1; + this.pictureBox1.TabStop = false; + // + // _internetSettingsLayout + // + this._internetSettingsLayout.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this._internetSettingsLayout.AutoSize = true; + this._internetSettingsLayout.ColumnCount = 1; + this._internetSettingsLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this._internetSettingsLayout.Controls.Add(this._internetButtonEnabledCheckBox, 0, 0); + this._internetSettingsLayout.Controls.Add(this._serverSettingsControl, 0, 1); + this._internetSettingsLayout.Location = new System.Drawing.Point(73, 11); + this._internetSettingsLayout.Name = "_internetSettingsLayout"; + this._internetSettingsLayout.RowCount = 2; + this._internetSettingsLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 22F)); + this._internetSettingsLayout.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this._internetSettingsLayout.Size = new System.Drawing.Size(369, 229); + this._internetSettingsLayout.TabIndex = 0; + // + // _internetButtonEnabledCheckBox + // + this._internetButtonEnabledCheckBox.AutoSize = true; + this.l10NSharpExtender1.SetLocalizableToolTip(this._internetButtonEnabledCheckBox, null); + this.l10NSharpExtender1.SetLocalizationComment(this._internetButtonEnabledCheckBox, null); + this.l10NSharpExtender1.SetLocalizingId(this._internetButtonEnabledCheckBox, "SendReceiveSettings.ShowInternetOption"); + this._internetButtonEnabledCheckBox.Location = new System.Drawing.Point(88, 3); + this._internetButtonEnabledCheckBox.Margin = new System.Windows.Forms.Padding(88, 3, 3, 3); + this._internetButtonEnabledCheckBox.Name = "_internetButtonEnabledCheckBox"; + this._internetButtonEnabledCheckBox.Size = new System.Drawing.Size(211, 16); + this._internetButtonEnabledCheckBox.TabIndex = 0; + this._internetButtonEnabledCheckBox.Text = "&Show Internet as Send/Receive option"; + this._internetButtonEnabledCheckBox.UseVisualStyleBackColor = true; + // + // _serverSettingsControl + // + this._serverSettingsControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this._serverSettingsControl.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.l10NSharpExtender1.SetLocalizableToolTip(this._serverSettingsControl, null); + this.l10NSharpExtender1.SetLocalizationComment(this._serverSettingsControl, null); + this.l10NSharpExtender1.SetLocalizingId(this._serverSettingsControl, "SendReceiveSettings.SendReceiveSettings.ServerSettingsControl"); + this._serverSettingsControl.Location = new System.Drawing.Point(3, 25); + this._serverSettingsControl.MinimumSize = new System.Drawing.Size(363, 200); + this._serverSettingsControl.Model = null; + this._serverSettingsControl.Name = "_serverSettingsControl"; + this._serverSettingsControl.Size = new System.Drawing.Size(363, 201); + this._serverSettingsControl.TabIndex = 1; + // + // chorusHubTab + // + this.chorusHubTab.Controls.Add(this._showChorusHubInSendReceive); + this.chorusHubTab.Controls.Add(this.chorusHubSetup); + this.chorusHubTab.Controls.Add(this.pictureBox4); + this.l10NSharpExtender1.SetLocalizableToolTip(this.chorusHubTab, null); + this.l10NSharpExtender1.SetLocalizationComment(this.chorusHubTab, null); + this.l10NSharpExtender1.SetLocalizingId(this.chorusHubTab, "SendReceiveSettings.ChorusHub"); + this.chorusHubTab.Location = new System.Drawing.Point(4, 22); + this.chorusHubTab.Name = "chorusHubTab"; + this.chorusHubTab.Padding = new System.Windows.Forms.Padding(3); + this.chorusHubTab.Size = new System.Drawing.Size(476, 268); + this.chorusHubTab.TabIndex = 2; + this.chorusHubTab.Text = "Chorus Hub"; + this.chorusHubTab.UseVisualStyleBackColor = true; + // + // _showChorusHubInSendReceive + // + this._showChorusHubInSendReceive.AutoSize = true; + this.l10NSharpExtender1.SetLocalizableToolTip(this._showChorusHubInSendReceive, null); + this.l10NSharpExtender1.SetLocalizationComment(this._showChorusHubInSendReceive, null); + this.l10NSharpExtender1.SetLocalizingId(this._showChorusHubInSendReceive, "SendReceiveSettings.ShowChorusHub"); + this._showChorusHubInSendReceive.Location = new System.Drawing.Point(85, 17); + this._showChorusHubInSendReceive.Margin = new System.Windows.Forms.Padding(10, 3, 3, 3); + this._showChorusHubInSendReceive.Name = "_showChorusHubInSendReceive"; + this._showChorusHubInSendReceive.Size = new System.Drawing.Size(240, 17); + this._showChorusHubInSendReceive.TabIndex = 5; + this._showChorusHubInSendReceive.Text = "&Show Chorus Hub as a Send/Receive option"; + this._showChorusHubInSendReceive.UseVisualStyleBackColor = true; + // + // chorusHubSetup + // + this.chorusHubSetup.AllowWebBrowserDrop = false; + this.chorusHubSetup.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.chorusHubSetup.BackColor = System.Drawing.Color.White; + this.chorusHubSetup.Font = new System.Drawing.Font("Segoe UI", 9F); + this.chorusHubSetup.IsWebBrowserContextMenuEnabled = false; + this.l10NSharpExtender1.SetLocalizableToolTip(this.chorusHubSetup, null); + this.l10NSharpExtender1.SetLocalizationComment(this.chorusHubSetup, null); + this.l10NSharpExtender1.SetLocalizationPriority(this.chorusHubSetup, L10NSharp.LocalizationPriority.MediumLow); + this.l10NSharpExtender1.SetLocalizingId(this.chorusHubSetup, "SendReceiveSetting.ChorusHubDescription"); + this.chorusHubSetup.Location = new System.Drawing.Point(85, 44); + this.chorusHubSetup.Name = "chorusHubSetup"; + this.chorusHubSetup.Size = new System.Drawing.Size(0, 0); + this.chorusHubSetup.TabIndex = 4; + this.chorusHubSetup.TabStop = false; + this.chorusHubSetup.Url = new System.Uri("about:blank", System.UriKind.Absolute); + this.chorusHubSetup.WebBrowserShortcutsEnabled = false; + // + // pictureBox4 + // + this.pictureBox4.Image = global::Chorus.Properties.Resources.chorusHubLarge; + this.l10NSharpExtender1.SetLocalizableToolTip(this.pictureBox4, null); + this.l10NSharpExtender1.SetLocalizationComment(this.pictureBox4, null); + this.l10NSharpExtender1.SetLocalizingId(this.pictureBox4, "SendReceiveSettings.SendReceiveSettings.pictureBox4"); + this.pictureBox4.Location = new System.Drawing.Point(6, 17); + this.pictureBox4.Name = "pictureBox4"; + this.pictureBox4.Size = new System.Drawing.Size(64, 66); + this.pictureBox4.TabIndex = 3; + this.pictureBox4.TabStop = false; + // + // _helpButton + // + this._helpButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.l10NSharpExtender1.SetLocalizableToolTip(this._helpButton, null); + this.l10NSharpExtender1.SetLocalizationComment(this._helpButton, null); + this.l10NSharpExtender1.SetLocalizationPriority(this._helpButton, L10NSharp.LocalizationPriority.High); + this.l10NSharpExtender1.SetLocalizingId(this._helpButton, "Common.Help"); + this._helpButton.Location = new System.Drawing.Point(422, 399); + this._helpButton.Name = "_helpButton"; + this._helpButton.Size = new System.Drawing.Size(75, 23); + this._helpButton.TabIndex = 5; + this._helpButton.Text = "&Help"; + this._helpButton.UseVisualStyleBackColor = true; + this._helpButton.Click += new System.EventHandler(this._helpButton_Click); + // + // _cancelButton + // + this._cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this._cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.l10NSharpExtender1.SetLocalizableToolTip(this._cancelButton, null); + this.l10NSharpExtender1.SetLocalizationComment(this._cancelButton, null); + this.l10NSharpExtender1.SetLocalizingId(this._cancelButton, "Common.Cancel"); + this._cancelButton.Location = new System.Drawing.Point(341, 399); + this._cancelButton.Name = "_cancelButton"; + this._cancelButton.Size = new System.Drawing.Size(75, 23); + this._cancelButton.TabIndex = 4; + this._cancelButton.Text = "Cancel"; + this._cancelButton.UseVisualStyleBackColor = true; + this._cancelButton.Click += new System.EventHandler(this.cancelButton_Click); + // + // _okButton + // + this._okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.l10NSharpExtender1.SetLocalizableToolTip(this._okButton, null); + this.l10NSharpExtender1.SetLocalizationComment(this._okButton, null); + this.l10NSharpExtender1.SetLocalizingId(this._okButton, "Common.OK"); + this._okButton.Location = new System.Drawing.Point(260, 399); + this._okButton.Name = "_okButton"; + this._okButton.Size = new System.Drawing.Size(75, 23); + this._okButton.TabIndex = 3; + this._okButton.Text = "OK"; + this._okButton.UseVisualStyleBackColor = true; + this._okButton.Click += new System.EventHandler(this.okButton_Click); + // + // settingsProtectionButton + // + this.settingsProtectionButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.l10NSharpExtender1.SetLocalizableToolTip(this.settingsProtectionButton, null); + this.l10NSharpExtender1.SetLocalizationComment(this.settingsProtectionButton, null); + this.l10NSharpExtender1.SetLocalizationPriority(this.settingsProtectionButton, L10NSharp.LocalizationPriority.NotLocalizable); + this.l10NSharpExtender1.SetLocalizingId(this.settingsProtectionButton, "SendReceiveSettings.SendReceiveSettings.SettingsProtectionLauncherButton"); + this.settingsProtectionButton.Location = new System.Drawing.Point(14, 388); + this.settingsProtectionButton.Margin = new System.Windows.Forms.Padding(0); + this.settingsProtectionButton.Name = "settingsProtectionButton"; + this.settingsProtectionButton.Size = new System.Drawing.Size(258, 47); + this.settingsProtectionButton.TabIndex = 0; + // + // pictureBox3 + // + this.pictureBox3.Image = global::Chorus.Properties.Resources.Committer_Person; + this.l10NSharpExtender1.SetLocalizableToolTip(this.pictureBox3, null); + this.l10NSharpExtender1.SetLocalizationComment(this.pictureBox3, null); + this.l10NSharpExtender1.SetLocalizingId(this.pictureBox3, "SendReceiveSettings.SendReceiveSettings.pictureBox3"); + this.pictureBox3.Location = new System.Drawing.Point(17, 9); + this.pictureBox3.Name = "pictureBox3"; + this.pictureBox3.Size = new System.Drawing.Size(52, 51); + this.pictureBox3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; + this.pictureBox3.TabIndex = 6; + this.pictureBox3.TabStop = false; + // + // l10NSharpExtender1 + // + this.l10NSharpExtender1.LocalizationManagerId = "Chorus"; + this.l10NSharpExtender1.PrefixForNewItems = "SendReceiveSettings"; + // + // SendReceiveSettings + // + this.AcceptButton = this._okButton; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this._cancelButton; + this.ClientSize = new System.Drawing.Size(508, 439); + this.Controls.Add(this.pictureBox3); + this.Controls.Add(this._okButton); + this.Controls.Add(this._cancelButton); + this.Controls.Add(this._helpButton); + this.Controls.Add(this.settingsTabs); + this.Controls.Add(this.userNameTextBox); + this.Controls.Add(this.nameLabel); + this.Controls.Add(this.settingsProtectionButton); + this.l10NSharpExtender1.SetLocalizableToolTip(this, null); + this.l10NSharpExtender1.SetLocalizationComment(this, null); + this.l10NSharpExtender1.SetLocalizingId(this, "SendReceiveSettings.WindowTitle"); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "SendReceiveSettings"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.Text = "Send/Receive Settings"; + this.settingsTabs.ResumeLayout(false); + this.internetTab.ResumeLayout(false); + this.internetTab.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); + this._internetSettingsLayout.ResumeLayout(false); + this._internetSettingsLayout.PerformLayout(); + this.chorusHubTab.ResumeLayout(false); + this.chorusHubTab.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.l10NSharpExtender1)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); } diff --git a/src/Chorus/UI/Sync/SyncControl.cs b/src/Chorus/UI/Sync/SyncControl.cs index e24cdaf25..965bb78a2 100644 --- a/src/Chorus/UI/Sync/SyncControl.cs +++ b/src/Chorus/UI/Sync/SyncControl.cs @@ -4,6 +4,7 @@ using System.Windows.Forms; using Chorus.VcsDrivers; using Chorus.VcsDrivers.Mercurial; +using SIL.PlatformUtilities; using SIL.Progress; namespace Chorus.UI.Sync @@ -126,12 +127,16 @@ private void OnLoad(object sender, EventArgs e) if (_model.HasFeature(SyncUIFeatures.SimpleRepositoryChooserInsteadOfAdvanced) || _model.Features == SyncUIFeatures.Minimal) { -#if MONO // in mono 2.0, the log tab is forever empty if we remove this tab - _chooseTargetsTab.Enabled = false; - _chooseTargetsTab.Visible = false; -#else - _tabControl.TabPages.Remove(_chooseTargetsTab); -#endif + if (Platform.IsMono) + { + // in mono 2.0, the log tab is forever empty if we remove this tab + _chooseTargetsTab.Enabled = false; + _chooseTargetsTab.Visible = false; + } + else + { + _tabControl.TabPages.Remove(_chooseTargetsTab); + } } if (!_model.HasFeature(SyncUIFeatures.TaskList)) { @@ -158,14 +163,15 @@ private void OnLoad(object sender, EventArgs e) LoadChoices(); -#if MONO - Invalidate(true); - Refresh(); - _tabControl.Refresh(); - _logTab.Refresh(); - _logBox.Refresh(); - // MessageBox.Show("inval/refreshed"); -#endif + if (Platform.IsMono) + { + Invalidate(true); + Refresh(); + _tabControl.Refresh(); + _logTab.Refresh(); + _logBox.Refresh(); + // MessageBox.Show("inval/refreshed"); + } } /// diff --git a/src/Chorus/UI/Sync/SyncDialog.cs b/src/Chorus/UI/Sync/SyncDialog.cs index cc52312c0..6ed995220 100644 --- a/src/Chorus/UI/Sync/SyncDialog.cs +++ b/src/Chorus/UI/Sync/SyncDialog.cs @@ -3,6 +3,7 @@ using System.Windows.Forms; using Chorus.sync; using Chorus.VcsDrivers.Mercurial; +using SIL.PlatformUtilities; using SIL.Progress; using SIL.Windows.Forms.Progress; @@ -135,9 +136,9 @@ private void _syncStartControl1_RepositoryChosen(object sender, SyncStartArgs ar _syncControl.Visible = true; Height = _syncControl.DesiredHeight; ResumeLayout(true); -#if MONO - _syncControl.Refresh(); -#endif + if (Platform.IsMono) + _syncControl.Refresh(); + _syncControl.Model.SyncOptions.RepositorySourcesToTry.Clear(); _syncControl.Model.SyncOptions.RepositorySourcesToTry.Add(args.Address); if(!string.IsNullOrEmpty(args.CommitMessage)) diff --git a/src/Chorus/UI/Sync/SyncStartModel.cs b/src/Chorus/UI/Sync/SyncStartModel.cs index 4df50daed..cce4f8348 100644 --- a/src/Chorus/UI/Sync/SyncStartModel.cs +++ b/src/Chorus/UI/Sync/SyncStartModel.cs @@ -3,6 +3,7 @@ using Chorus.VcsDrivers; using Chorus.VcsDrivers.Mercurial; using L10NSharp; +using SIL.PlatformUtilities; using SIL.Progress; namespace Chorus.UI.Sync @@ -164,15 +165,22 @@ internal bool GetUsbStatusLink(IUsbDriveLocator usbDriveLocator, out string mess try { var first = usbDrives[0]; -#if !MONO - message = string.Format(LocalizationManager.GetString("GetUsbStatus.DriveInfoAndFreeSpace", "{0} {1} ({2} Megs Free Space)", - "{x} tags are replaced as follows: ( Megs Free Space), " - + "for example: F:\\ MyDrive (640 Megs Free Space)"), - first.RootDirectory, first.VolumeLabel, Math.Floor(first.TotalFreeSpace / 1048576.0)); -#else - message = first.VolumeLabel; - //RootDir & volume label are the same on linux. TotalFreeSpace is, like, maxint or something in mono 2.0 -#endif + if (!Platform.IsMono) + { + message = string.Format(LocalizationManager.GetString( + "GetUsbStatus.DriveInfoAndFreeSpace", + "{0} {1} ({2} Megs Free Space)", + "{x} tags are replaced as follows: ( Megs Free Space), " + + "for example: F:\\ MyDrive (640 Megs Free Space)"), + first.RootDirectory, first.VolumeLabel, + Math.Floor(first.TotalFreeSpace / 1048576.0)); + } + else + { + message = first.VolumeLabel; + //RootDir & volume label are the same on linux. TotalFreeSpace is, like, maxint or something in mono 2.0 + } + ready = true; } catch (Exception error) diff --git a/src/Chorus/packages.config b/src/Chorus/packages.config deleted file mode 100644 index 94550fb51..000000000 --- a/src/Chorus/packages.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/ChorusHub/ChorusHub.csproj b/src/ChorusHub/ChorusHub.csproj index 870fe4f5f..1a5fc3d33 100644 --- a/src/ChorusHub/ChorusHub.csproj +++ b/src/ChorusHub/ChorusHub.csproj @@ -1,162 +1,59 @@ - - + + - Debug - AnyCPU - 8.0.30703 - 2.0 - {4D3ECD8D-431D-4B53-B635-017B36B002C9} - WinExe - Properties + net461 ChorusHub - ChorusHub - v4.6.1 - - - 512 - - - AnyCPU - true - full - false - ..\..\output\Debug\ - DEBUG;TRACE - prompt - 4 - false - 6 + ChorusHub + Debug;Release + End-user collaboration library via 3-way xml merging and hg dvcs under the hood. + SIL International + SIL International + chorus + Copyright © 2010-2020 SIL International + SIL.Chorus.ChorusHub + MIT + https://github.com/sillsdev/chorus + false + ../../output/$(Configuration) + ../../output + true + ../FieldWorks.snk + None + WinExe + true + snupkg + + + ../../CHANGELOG.md 1591 - - - AnyCPU - pdbonly - true - ..\..\output\Release\ - TRACE - prompt - 4 - true - 6 - - - True - ..\..\output\DebugMono - DEBUG;TRACE;MONO - True - full + false + AnyCPU - prompt - - - 4 - False - false - 6 + win7-x86;win7-x64 - - ..\..\output\ReleaseMono - TRACE;MONO - True - True - pdbonly - AnyCPU - prompt - 4 - false - 6 - - - true - ..\..\output\Debug\ - DEBUG;TRACE - full - AnyCPU - 6 - prompt - MinimumRecommendedRules.ruleset - - - ..\..\output\Release\ - TRACE - true - pdbonly - AnyCPU - 6 - prompt - MinimumRecommendedRules.ruleset - - - - False - ..\..\lib\Release\SIL.Core.dll - - - - - False - ..\..\lib\Debug\SIL.Core.dll - - - - - False - ..\..\lib\ReleaseMono\SIL.Core.dll - - - - - False - ..\..\lib\DebugMono\SIL.Core.dll - - - - - - - - - + - - - Component - - - ChorusHub.cs - - - - - - - Component - - - ProjectInstaller.cs - - + + + + - - ProjectInstaller.cs - + + - - {94245366-8F1E-475C-810D-FE89BB3948E0} - LibChorus - - - - + + - - + + + + $(AssemblySearchPaths);{GAC} + + \ No newline at end of file diff --git a/src/ChorusHub/HgServeRunner.cs b/src/ChorusHub/HgServeRunner.cs index e4afbbed1..26645fab5 100644 --- a/src/ChorusHub/HgServeRunner.cs +++ b/src/ChorusHub/HgServeRunner.cs @@ -3,6 +3,7 @@ using System.IO; using System.Text; using System.Threading; +using System.Web; using Chorus.VcsDrivers.Mercurial; using SIL.CommandLineProcessing; using SIL.Progress; @@ -146,33 +147,33 @@ public void CheckForFailedPushes() { while (true) { - var line = reader.ReadLine(); - if (line == null) - return; - - var start = line.IndexOf("GET /") + 5; - var end = line.IndexOf("?"); - if (line.Contains("404") && start > 9 & end > 0) - { - var name = line.Substring(start, end - start); - string directory = Path.Combine(_rootFolder, name); - - directory = SIL.Network.HttpUtilityFromMono.UrlDecode(directory); // convert %20 --> space - if (!Directory.Exists(directory)) - { - //Progress.WriteMessage("Creating new folder '" + name + "'"); - Directory.CreateDirectory(directory); - } - if (!Directory.Exists(Path.Combine(directory, ".hg"))) + var line = reader.ReadLine(); + if (line == null) + return; + + var start = line.IndexOf("GET /") + 5; + var end = line.IndexOf("?"); + if (line.Contains("404") && start > 9 & end > 0) { - //Progress.WriteMessage("Initializing blank repository: " + name + - // ". Try Sending again in a few minutes, when hg notices the new directory."); - HgRepository.CreateRepositoryInExistingDir(directory, new ConsoleProgress()); + var name = line.Substring(start, end - start); + string directory = Path.Combine(_rootFolder, name); + + directory = HttpUtility.UrlDecode(directory); // convert %20 --> space + if (!Directory.Exists(directory)) + { + //Progress.WriteMessage("Creating new folder '" + name + "'"); + Directory.CreateDirectory(directory); + } + if (!Directory.Exists(Path.Combine(directory, ".hg"))) + { + //Progress.WriteMessage("Initializing blank repository: " + name + + // ". Try Sending again in a few minutes, when hg notices the new directory."); + HgRepository.CreateRepositoryInExistingDir(directory, new ConsoleProgress()); + } } } + } } - } - } catch { //EventLog.WriteEntry("Application", error.Message, EventLogEntryType.Error); diff --git a/src/ChorusHub/Properties/AssemblyInfo.cs b/src/ChorusHub/Properties/AssemblyInfo.cs deleted file mode 100644 index 402703ab9..000000000 --- a/src/ChorusHub/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("ChorusHub")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("ChorusHub")] -[assembly: AssemblyCopyright("Copyright © 2014")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("9dbeb21e-3cb1-421b-9457-9ae8a922c49e")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/ChorusHubApp/ChorusHubApp.csproj b/src/ChorusHubApp/ChorusHubApp.csproj index bd91366c1..4875bc51b 100644 --- a/src/ChorusHubApp/ChorusHubApp.csproj +++ b/src/ChorusHubApp/ChorusHubApp.csproj @@ -1,244 +1,69 @@ - - + + - Debug - AnyCPU - 8.0.30703 - 2.0 - {EB8C974D-B1C6-4CE0-BFD4-170EFE18790C} - WinExe - Properties + net461 ChorusHubApp - ChorusHubApp - v4.6.1 - 512 - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - ChorusHubApp.Program - - - true - ..\..\output\$(Configuration)\ - DEBUG;TRACE - full - AnyCPU - ..\..\output\$(Configuration)\ChorusHub.exe.CodeAnalysisLog.xml - true - GlobalSuppressions.cs - prompt - MinimumRecommendedRules.ruleset - ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets - true - ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules - true - false - 6 + ChorusHubApp + Debug;Release + End-user collaboration library via 3-way xml merging and hg dvcs under the hood. + SIL International + SIL International + chorus + Copyright © 2010-2020 SIL International + SIL.Chorus.ChorusHubApp + MIT + https://github.com/sillsdev/chorus + false + ../../output/$(Configuration) + ../../output + true + ../FieldWorks.snk + None + WinExe + true + snupkg + + + ../../CHANGELOG.md 1591 - - - ..\..\output\$(Configuration)\ - TRACE - true - pdbonly + false + AnyCPU - ..\..\output\$(Configuration)\ChorusHub.exe.CodeAnalysisLog.xml - true - GlobalSuppressions.cs - prompt - MinimumRecommendedRules.ruleset - ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets - false - ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules - false - false - 6 - - - true - ..\..\output\DebugMono - DEBUG;TRACE;MONO - true - full - prompt - - - false - 6 - - - true - ..\..\output\ReleaseMono - TRACE;MONO - true - true - pdbonly - prompt - - - false - 6 + win7-x86;win7-x64 - - - - - - true - ..\..\output\Debug\ - DEBUG;TRACE - full - AnyCPU - 6 - prompt - MinimumRecommendedRules.ruleset - - - ..\..\output\Release\ - TRACE - true - pdbonly - AnyCPU - 6 - prompt - MinimumRecommendedRules.ruleset - false - false - - - - False - ..\..\lib\Debug\SIL.Core.dll - - - False - ..\..\lib\Debug\SIL.Windows.Forms.dll - - - - - False - ..\..\lib\Release\SIL.Core.dll - - - False - ..\..\lib\Release\SIL.Windows.Forms.dll - - - - - False - ..\..\lib\DebugMono\SIL.Core.dll - - - False - ..\..\lib\DebugMono\SIL.Windows.Forms.dll - - - - - False - ..\..\lib\ReleaseMono\SIL.Core.dll - - - False - ..\..\lib\ReleaseMono\SIL.Windows.Forms.dll - + + + + + + + + - - False - ..\..\lib\Debug\SIL.Core.Desktop.dll - - - - - - - ..\..\packages\Vulcan.Uczniowie.HelpProvider.1.0.16\lib\net461\Vulcan.Uczniowie.HelpProvider.dll - True - + + + - - Form - - - ChorusHubWindow.cs - - - - - True + True + True Settings.settings - - - - False - Microsoft .NET Framework 4 Client Profile %28x86 and x64%29 - true - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - false - - - False - Windows Installer 3.1 - true - - - - - {4D3ECD8D-431D-4B53-B635-017B36B002C9} - ChorusHub - - - {94245366-8F1E-475C-810D-FE89BB3948E0} - LibChorus - - - - - - + SettingsSingleFileGenerator Settings.Designer.cs - - - ChorusHubWindow.cs - - - - + + + + $(AssemblySearchPaths);{GAC} + + \ No newline at end of file diff --git a/src/ChorusHubApp/Finder.cs b/src/ChorusHubApp/Finder.cs deleted file mode 100644 index b1ce9a84a..000000000 --- a/src/ChorusHubApp/Finder.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Net; -using System.Net.Sockets; -using System.Text; -using System.Threading; - -namespace ChorusHub -{ - public class Finder - { - private State _state; - private IAsyncResult _asyncResult; - private ChorusHubInfo _foundHub; - - private class State - { - public IPEndPoint Endpoint; - public UdpClient udpClient; - } - - public void Start() - { - _state = new State(); - _state.Endpoint = new IPEndPoint(IPAddress.Any, Advertiser.Port); - _state.udpClient = new UdpClient(_state.Endpoint); - _asyncResult = _state.udpClient.BeginReceive(ReceiveCallback, _state); - } - - public void Stop() - { - //just kills us _state.udpClient.EndReceive(_asyncResult, ref _state.Endpoint); - // Debug.WriteLine("Finder Stopped"); - } - - public void ReceiveCallback(IAsyncResult args) - { - UdpClient u = ((State)(args.AsyncState)).udpClient; - IPEndPoint e = ((State)(args.AsyncState)).Endpoint; - - Byte[] receiveBytes = u.EndReceive(args, ref e); - string s = Encoding.ASCII.GetString(receiveBytes); - if(ChorusHubInfo.IsChorusHubInfo(s)) - { - _foundHub = ChorusHubInfo.Parse(s); - } - } - - public ChorusHubInfo Find() - { - _foundHub = null; - Start(); - for (int i = 0; i < 20; i++) - { - if (_foundHub != null) - break; - Thread.Sleep(200); - } - Stop(); - return _foundHub;//will be null if none found - } - } -} diff --git a/src/ChorusHubApp/Program.cs b/src/ChorusHubApp/Program.cs index 21ede61a5..ee2e76b54 100644 --- a/src/ChorusHubApp/Program.cs +++ b/src/ChorusHubApp/Program.cs @@ -4,6 +4,7 @@ using Chorus.ChorusHub; using ChorusHubApp.Properties; using SIL.Reporting; +using SIL.Windows.Forms.Reporting; namespace ChorusHubApp { @@ -60,66 +61,7 @@ private static void SetupErrorHandling() ErrorReport.AddProperty("AdvertisingPort", ChorusHubOptions.AdvertisingPort.ToString()); ErrorReport.AddProperty("MercurialPort", ChorusHubOptions.MercurialPort.ToString()); ErrorReport.AddStandardProperties(); - ExceptionHandler.Init(); + ExceptionHandler.Init(new WinFormsExceptionHandler()); } - -// -// -// try -// { -// _service.Start(true); -// while (!_isClosing) -// { -// _service.Tick(); -// Thread.Sleep(1000); -// } -// } -// finally -// { -// CloseDown(); -// } -// } -// -// private static bool ConsoleCtrlCheck(CtrlTypes ctrlType) -// { -// // Put your own handler here -// -// switch (ctrlType) -// { -// case CtrlTypes.CTRL_BREAK_EVENT: -// case CtrlTypes.CTRL_CLOSE_EVENT: -// case CtrlTypes.CTRL_C_EVENT: -// case CtrlTypes.CTRL_LOGOFF_EVENT: -// case CtrlTypes.CTRL_SHUTDOWN_EVENT: -// //NB: there is reason to believe that once we return from this handler, -// //the app will die *real soon*. So we need to clean up first. -// CloseDown(); -// _isClosing = true; -// break; -// } -// -// return true; -// } -// -// private static void CloseDown() -// { -// Console.WriteLine("Stopping..."); -// _service.Stop(); -// } -// -// #region unmanaged -// [DllImport("Kernel32")] -// public static extern bool SetConsoleCtrlHandler(HandlerRoutine Handler, bool Add); -// public delegate bool HandlerRoutine(CtrlTypes CtrlType); -// public enum CtrlTypes -// { -// CTRL_C_EVENT = 0, -// CTRL_BREAK_EVENT, -// CTRL_CLOSE_EVENT, -// CTRL_LOGOFF_EVENT = 5, -// CTRL_SHUTDOWN_EVENT -// } -// #endregion - } } diff --git a/src/ChorusHubApp/Properties/AssemblyInfo.cs b/src/ChorusHubApp/Properties/AssemblyInfo.cs index e2c80220c..1b097f51e 100644 --- a/src/ChorusHubApp/Properties/AssemblyInfo.cs +++ b/src/ChorusHubApp/Properties/AssemblyInfo.cs @@ -1,37 +1,2 @@ -using System.Reflection; -using System.Runtime.InteropServices; -using Vulcan.Uczniowie.HelpProvider; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("ChorusHub")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("ChorusHub")] -[assembly: AssemblyCopyright("Copyright © SIL International 2012")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] +using Vulcan.Uczniowie.HelpProvider; [assembly: AssemblyHelpMapFileName("chorus.helpmap")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("7ad734dd-50ee-4f0a-a188-c4ca2d03ef05")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/ChorusHubApp/Properties/Settings.Designer.cs b/src/ChorusHubApp/Properties/Settings.Designer.cs index 64a93c152..1d702d7bb 100644 --- a/src/ChorusHubApp/Properties/Settings.Designer.cs +++ b/src/ChorusHubApp/Properties/Settings.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.1008 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -12,7 +12,7 @@ namespace ChorusHubApp.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); diff --git a/src/ChorusHubApp/Properties/Settings.settings b/src/ChorusHubApp/Properties/Settings.settings index 3656c7353..5be967e4c 100644 --- a/src/ChorusHubApp/Properties/Settings.settings +++ b/src/ChorusHubApp/Properties/Settings.settings @@ -1,9 +1,9 @@  - + - - - + + + \ No newline at end of file diff --git a/src/ChorusHubApp/packages.config b/src/ChorusHubApp/packages.config deleted file mode 100644 index 76b4b08c2..000000000 --- a/src/ChorusHubApp/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/ChorusHubTests/ChorusHubTests.cs b/src/ChorusHubTests/ChorusHubTests.cs index e01ecb196..f0b177ffb 100644 --- a/src/ChorusHubTests/ChorusHubTests.cs +++ b/src/ChorusHubTests/ChorusHubTests.cs @@ -37,7 +37,7 @@ public void TestTeardown() [Test, Ignore("Run by hand.")] public void FindServer_NoServerFound_Null() { - Assert.IsNull(ChorusHubServerInfo.FindServerInformation()); + Assert.That(ChorusHubServerInfo.FindServerInformation(), Is.Null); } [Test] @@ -75,7 +75,7 @@ public void GetRepostoryNames_TwoItemsInHubFolder_GetOneItemWithProjectFilter() ChorusHubOptions.RootDirectory = chorusHubSourceFolder.Path; using (var service = new ChorusHubServer()) { - Assert.IsTrue(service.Start(true)); + Assert.That(service.Start(true), Is.True); var chorusHubServerInfo = ChorusHubServerInfo.FindServerInformation(); Assert.NotNull(chorusHubServerInfo); @@ -83,7 +83,7 @@ public void GetRepostoryNames_TwoItemsInHubFolder_GetOneItemWithProjectFilter() var client1 = new ChorusHubClient(chorusHubServerInfo); var allRepoInfo = client1.GetRepositoryInformation(string.Empty); Assert.AreEqual(2, allRepoInfo.Count()); - Assert.IsTrue(allRepoInfo.Select(ri => ri.RepoName.Contains("repo2")).Any()); + Assert.That(allRepoInfo.Select(ri => ri.RepoName.Contains("repo2")).Any(), Is.True); // Make sure filter works // In order to have a hope of getting a different result to GetRepositoryInformation @@ -94,7 +94,7 @@ public void GetRepostoryNames_TwoItemsInHubFolder_GetOneItemWithProjectFilter() var repoInfo = client2.GetRepositoryInformation(queryString); Assert.AreEqual(1, repoInfo.Count()); var info = repoInfo.First(); - Assert.IsTrue(info.RepoName == "repo1"); + Assert.That(info.RepoName, Is.EqualTo("repo1")); } } } @@ -123,7 +123,7 @@ public void GetRepostoryNames_TwoItemsInHubFolder_GetTwoItems() using (var service = new ChorusHubServer()) { // hg server side is now involved in deciding what repos are available - Assert.IsTrue(service.Start(true)); + Assert.That(service.Start(true), Is.True); var chorusHubServerInfo = ChorusHubServerInfo.FindServerInformation(); Assert.NotNull(chorusHubServerInfo); var client = new ChorusHubClient(chorusHubServerInfo); @@ -131,8 +131,8 @@ public void GetRepostoryNames_TwoItemsInHubFolder_GetTwoItems() Assert.AreEqual(2, repoInfo.Count()); var info1 = repoInfo.First(); var info2 = repoInfo.Last(); - Assert.IsTrue(info1.RepoName == "repo1"); - Assert.IsTrue(info2.RepoName == "repo2"); + Assert.That(info1.RepoName, Is.EqualTo("repo1")); + Assert.That(info2.RepoName, Is.EqualTo("repo2")); } } } @@ -172,7 +172,7 @@ public void GetRepostoryNames_ThreeItemsInHubFolder_GetTwoItemsWithProjectFilter ChorusHubOptions.RootDirectory = chorusHubSourceFolder.Path; using (var service = new ChorusHubServer()) { - Assert.IsTrue(service.Start(true)); + Assert.That(service.Start(true), Is.True); // Make sure filter works var chorusHubServerInfo = ChorusHubServerInfo.FindServerInformation(); @@ -182,8 +182,8 @@ public void GetRepostoryNames_ThreeItemsInHubFolder_GetTwoItemsWithProjectFilter Assert.AreEqual(2, repoInfo.Count()); var info1 = repoInfo.First(); var info2 = repoInfo.Last(); - Assert.IsTrue(info1.RepoName == "repo1"); - Assert.IsTrue(info2.RepoName == "repo3"); + Assert.That(info1.RepoName, Is.EqualTo("repo1")); + Assert.That(info2.RepoName, Is.EqualTo("repo3")); } } } @@ -216,7 +216,7 @@ public void GetRepostoryNames_TwoItemsInHubFolder_GetNoneForProjectFilter() ChorusHubOptions.RootDirectory = chorusHubSourceFolder.Path; using (var service = new ChorusHubServer()) { - Assert.IsTrue(service.Start(true)); + Assert.That(service.Start(true), Is.True); // Make sure filter works var chorusHubServerInfo = ChorusHubServerInfo.FindServerInformation(); diff --git a/src/ChorusHubTests/ChorusHubTests.csproj b/src/ChorusHubTests/ChorusHubTests.csproj index efb7d278d..afe560304 100644 --- a/src/ChorusHubTests/ChorusHubTests.csproj +++ b/src/ChorusHubTests/ChorusHubTests.csproj @@ -1,168 +1,47 @@ - - + + - Debug - AnyCPU - 8.0.30703 - 2.0 - {BE491193-6666-4A1C-A23A-FE962632F07D} - Library - Properties + net461 ChorusHubTests - ChorusHubTests - v4.6.1 - 512 - - - - AnyCPU - true - full - false - ..\..\output\Debug\ - DEBUG;TRACE - prompt - 4 - AnyCPU - false - 6 + ChorusHubTests + Debug;Release + Unit tests for ChorusHub.exe + SIL International + SIL International + chorus + Copyright © 2010-2020 SIL International + ../../output/$(Configuration) + true + ../FieldWorks.snk + true 1591 - - - AnyCPU - pdbonly - true - ..\..\output\Release\ - TRACE - prompt - 4 - false - 6 - - - True - ..\..\output\DebugMono - DEBUG;TRACE;MONO - True - full + false + false + AnyCPU - prompt - 4 - False - false - 6 + win7-x86;win7-x64 - - True - ..\..\output\ReleaseMono - TRACE;MONO - True - True - pdbonly - AnyCPU - prompt - 4 - false - 6 - - - true - ..\..\output\Debug\ - DEBUG;TRACE - full - AnyCPU - 6 - prompt - MinimumRecommendedRules.ruleset - - - ..\..\output\Release\ - TRACE - true - pdbonly - AnyCPU - 6 - prompt - MinimumRecommendedRules.ruleset - - - - False - ..\..\lib\Debug\SIL.Core.dll - - - False - ..\..\lib\Debug\SIL.TestUtilities.dll - - - - - False - ..\..\lib\Release\SIL.Core.dll - - - False - ..\..\lib\Release\SIL.TestUtilities.dll - - - - - False - ..\..\lib\DebugMono\SIL.Core.dll - - - False - ..\..\lib\DebugMono\SIL.TestUtilities.dll - - - - - False - ..\..\lib\ReleaseMono\SIL.Core.dll - - - False - ..\..\lib\ReleaseMono\SIL.TestUtilities.dll - - - - - ..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll - - - - - - - - + - - {4D3ECD8D-431D-4B53-B635-017B36B002C9} - ChorusHub - - - {9DA5A655-1881-4BE1-81BA-256E47CF7537} - Chorus - - - {0681E722-1856-44A1-B585-220E6AEC85CB} - LibChorus.TestUtilities - - - {94245366-8F1E-475C-810D-FE89BB3948E0} - LibChorus - + + + - - + - + + + + + + + + $(AssemblySearchPaths);{GAC} + + \ No newline at end of file diff --git a/src/ChorusHubTests/Properties/AssemblyInfo.cs b/src/ChorusHubTests/Properties/AssemblyInfo.cs deleted file mode 100644 index bc578726b..000000000 --- a/src/ChorusHubTests/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("ChorusHubTests")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("ChorusHubTests")] -[assembly: AssemblyCopyright("Copyright © 2014")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("63efde68-62f8-41dc-a6d3-f4c65228ce44")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/ChorusHubTests/packages.config b/src/ChorusHubTests/packages.config deleted file mode 100644 index 512ce05d0..000000000 --- a/src/ChorusHubTests/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/ChorusMerge.Tests/ChorusMerge.Tests.csproj b/src/ChorusMerge.Tests/ChorusMerge.Tests.csproj index f10a2dbbd..5d78272c4 100644 --- a/src/ChorusMerge.Tests/ChorusMerge.Tests.csproj +++ b/src/ChorusMerge.Tests/ChorusMerge.Tests.csproj @@ -1,174 +1,47 @@ - - + + - Debug - AnyCPU - 9.0.21022 - 2.0 - {2F4DCA63-3503-4F4E-BEC6-8247F83F3BE4} - Library - Properties + net461 ChorusMerge.Tests - ChorusMerge.Tests - - - 3.5 - - - True - v4.6.1 - - - - True - full - False - ..\..\output\Debug - DEBUG;TRACE - prompt - 4 - True - AnyCPU - false - 6 + ChorusMerge.Tests + Debug;Release + Unit tests for LibChorus.dll + SIL International + SIL International + chorus + Copyright © 2010-2020 SIL International + ../../output/$(Configuration) + true + ../FieldWorks.snk + true 1591 - - - pdbonly - True - ..\..\output\Release - TRACE - prompt - 4 - True - True - AnyCPU - false - 6 - - - True - ..\..\output\DebugMono - DEBUG;TRACE;MONO - True - full + false + false + AnyCPU - prompt - 4 - False - false - 6 + win7-x86;win7-x64 - - True - ..\..\output\ReleaseMono - TRACE;MONO - True - True - pdbonly - AnyCPU - prompt - 4 - false - 6 - - - true - ..\..\output\Debug\ - DEBUG;TRACE - true - full - AnyCPU - 6 - prompt - MinimumRecommendedRules.ruleset - - - true - ..\..\output\Release\ - TRACE - true - true - pdbonly - AnyCPU - 6 - prompt - MinimumRecommendedRules.ruleset - - - - False - ..\..\lib\Debug\SIL.Core.dll - - - False - ..\..\lib\Debug\SIL.TestUtilities.dll - - - - - False - ..\..\lib\Release\SIL.Core.dll - - - False - ..\..\lib\Release\SIL.TestUtilities.dll - - - - - False - ..\..\lib\DebugMono\SIL.Core.dll - - - False - ..\..\lib\DebugMono\SIL.TestUtilities.dll - - - - - False - ..\..\lib\ReleaseMono\SIL.Core.dll - - - False - ..\..\lib\ReleaseMono\SIL.TestUtilities.dll - - - - - ..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll - - - - - - - - + - - {1264E294-F719-491C-863A-703CB48385D8} - ChorusMerge - - - {F9671F8B-8556-44EA-81A7-C236D871B471} - LibChorus.Tests - - - {94245366-8F1E-475C-810D-FE89BB3948E0} - LibChorus - + + + + + - - + - + + + + + + $(AssemblySearchPaths);{GAC} + + \ No newline at end of file diff --git a/src/ChorusMerge.Tests/ChorusMergeTests.cs b/src/ChorusMerge.Tests/ChorusMergeTests.cs index 6dee8b245..88966317c 100644 --- a/src/ChorusMerge.Tests/ChorusMergeTests.cs +++ b/src/ChorusMerge.Tests/ChorusMergeTests.cs @@ -17,7 +17,7 @@ namespace ChorusMerge.Tests public class ChorusMergeTests { // The file is held onto by R#'s test taskrunner for some reason. - //[TestFixtureTearDown] + //[OneTimeTearDown] //public void FixtureTearDown() //{ // var file = Path.Combine(Path.GetTempPath(), "LiftMerger.FindEntryById"); @@ -30,10 +30,10 @@ public void Main_NoConflictFileB4_ConflictsEncountered_HaveConflictFileAfter() { using (var group = new GroupOfConflictingLiftFiles()) { - Assert.AreEqual(0, DoMerge(group)); - Assert.IsTrue(File.Exists(group.BobTextConflictsPath)); + Assert.That(DoMerge(group), Is.EqualTo(0)); + Assert.That(group.BobTextConflictsPath, Does.Exist); var text = File.ReadAllText(group.BobTextConflictsPath); - Assert.AreNotEqual(string.Empty, text); + Assert.That(text, Is.Not.Empty); } } diff --git a/src/ChorusMerge.Tests/Properties/AssemblyInfo.cs b/src/ChorusMerge.Tests/Properties/AssemblyInfo.cs deleted file mode 100644 index 1d2a95947..000000000 --- a/src/ChorusMerge.Tests/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("ChorusMerge.Tests")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("ChorusMerge.Tests")] -[assembly: AssemblyCopyright("Copyright © 2008")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("af5e9109-1e8d-4e5f-b5ad-a26d0dc4ef42")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/ChorusMerge.Tests/packages.config b/src/ChorusMerge.Tests/packages.config deleted file mode 100644 index 512ce05d0..000000000 --- a/src/ChorusMerge.Tests/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/ChorusMerge/ChorusMerge.csproj b/src/ChorusMerge/ChorusMerge.csproj index 85e0ee1bd..fb8bad8bd 100644 --- a/src/ChorusMerge/ChorusMerge.csproj +++ b/src/ChorusMerge/ChorusMerge.csproj @@ -1,128 +1,54 @@ - - + + - Debug - AnyCPU - 9.0.21022 - 2.0 - {1264E294-F719-491C-863A-703CB48385D8} - Exe - Properties + net461 ChorusMerge - ChorusMerge - - - 3.5 - - - True - v4.6.1 - - - True - full - False - ..\..\output\Debug - DEBUG;TRACE - prompt - 4 - True - AnyCPU - true - 6 + ChorusMerge + Debug;Release + Merge tool for Chorus, the end-user collaboration library via 3-way xml merging and hg dvcs under the hood. + SIL International + SIL International + chorus + Copyright © 2010-2020 SIL International + SIL.Chorus.ChorusMerge + MIT + https://github.com/sillsdev/chorus + false + ../../output/$(Configuration) + ../../output + true + ../FieldWorks.snk + None + Exe + true + snupkg + + + ../../CHANGELOG.md 1591 - - - pdbonly - True - ..\..\output\Release - TRACE - prompt - 4 - True - True + false + AnyCPU - true - 6 + win7-x86;win7-x64 - - True - ..\..\output\DebugMono - DEBUG;TRACE;MONO - True - full - AnyCPU - prompt - - - 4 - False - false - 6 - - - True - ..\..\output\ReleaseMono - TRACE;MONO - True - True - pdbonly - AnyCPU - prompt - - - 4 - false - 6 - - - true - ..\..\output\Debug\ - DEBUG;TRACE - true - full - AnyCPU - 6 - prompt - MinimumRecommendedRules.ruleset - false - - - true - ..\..\output\Release\ - TRACE - true - true - pdbonly - AnyCPU - 6 - prompt - MinimumRecommendedRules.ruleset - false - - - - - + - - + + + + - - {94245366-8F1E-475C-810D-FE89BB3948E0} - LibChorus - + - - - - - + + + + $(AssemblySearchPaths);{GAC} + + \ No newline at end of file diff --git a/src/ChorusMerge/Program.cs b/src/ChorusMerge/Program.cs index 9313bc933..448810810 100644 --- a/src/ChorusMerge/Program.cs +++ b/src/ChorusMerge/Program.cs @@ -6,9 +6,10 @@ using Chorus.FileTypeHandlers; using Chorus.merge; using Chorus.merge.xml.generic; +using SIL.PlatformUtilities; // Allow redirecting Console.Error for unit tests (Avoid spurious build failures) -[assembly: InternalsVisibleTo("ChorusMerge.Tests")] +[assembly: InternalsVisibleTo("ChorusMerge.Tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001005f4452c387d979e3cba05fd73bb9aebe8f8830874663d66a7869f614a8f5e8def658d5c5920fae609d28aa005d5a9af5bd758ca8f19ad0347b7aa76e1f723f8994792136f5ceff9fb6f719d4337f65da2e1d66a85cc5e28e4656a1a30c2ff513440393177625c725d3fb156dc3c11610ea5936b9404ab9d51f7eb71ac0aa27bd")] namespace ChorusMerge { @@ -34,20 +35,28 @@ public static int Main(string[] args) { try { -#if MONO - var ourFilePath = args[0]; - var commonFilePath = args[1]; - var theirFilePath = args[2]; -#else - // Convert the input arguments from cp1252 -> utf8 -> ucs2 - // It always seems to be 1252, even when the input code page is actually something else. CP 2012-03 - // var inputEncoding = Console.InputEncoding; - var inputEncoding = Encoding.GetEncoding(1252); - var ourFilePath = Encoding.UTF8.GetString(inputEncoding.GetBytes(args[0])); - var commonFilePath = Encoding.UTF8.GetString(inputEncoding.GetBytes(args[1])); - var theirFilePath = Encoding.UTF8.GetString(inputEncoding.GetBytes(args[2])); - Console.WriteLine("ChorusMerge: Input encoding {0}", inputEncoding.EncodingName); -#endif + string ourFilePath; + string commonFilePath; + string theirFilePath; + + if (Platform.IsMono) + { + ourFilePath = args[0]; + commonFilePath = args[1]; + theirFilePath = args[2]; + } + else + { + // Convert the input arguments from cp1252 -> utf8 -> ucs2 + // It always seems to be 1252, even when the input code page is actually something else. CP 2012-03 + // var inputEncoding = Console.InputEncoding; + var inputEncoding = Encoding.GetEncoding(1252); + ourFilePath = Encoding.UTF8.GetString(inputEncoding.GetBytes(args[0])); + commonFilePath = Encoding.UTF8.GetString(inputEncoding.GetBytes(args[1])); + theirFilePath = Encoding.UTF8.GetString(inputEncoding.GetBytes(args[2])); + Console.WriteLine("ChorusMerge: Input encoding {0}", + inputEncoding.EncodingName); + } //this was originally put here to test if console writes were making it out to the linux log or not Console.WriteLine("ChorusMerge: {0}, {1}, {2}", ourFilePath, commonFilePath, theirFilePath); diff --git a/src/ChorusMerge/Properties/AssemblyInfo.cs b/src/ChorusMerge/Properties/AssemblyInfo.cs deleted file mode 100644 index ad2cf36d2..000000000 --- a/src/ChorusMerge/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("ChorusMerge")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("ChorusMerge")] -[assembly: AssemblyCopyright("Copyright © 2008")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("e55f21b0-5d84-46ed-b3c3-b1f7d5d4a25c")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -[assembly: AssemblyVersion("1.1.0.0")] -[assembly: AssemblyFileVersion("1.1.0.0")] diff --git a/src/ChorusMerge/app.config b/src/ChorusMerge/app.config deleted file mode 100644 index 0dff63a07..000000000 --- a/src/ChorusMerge/app.config +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/Installer/ChorusHub.wixproj b/src/Installer/ChorusHub.wixproj index 21f1eff08..27e92cb7c 100644 --- a/src/Installer/ChorusHub.wixproj +++ b/src/Installer/ChorusHub.wixproj @@ -1,5 +1,5 @@  - + Release x86 diff --git a/src/Installer/ChorusHub.wxs b/src/Installer/ChorusHub.wxs index 19108467e..a740c45e6 100644 --- a/src/Installer/ChorusHub.wxs +++ b/src/Installer/ChorusHub.wxs @@ -58,7 +58,7 @@ http://blogs.msdn.com/robmen/archive/2003/10/04/56479.aspx --> - + @@ -76,46 +76,46 @@ http://blogs.msdn.com/robmen/archive/2003/10/04/56479.aspx --> - + - + - + - + - + - + - - + + - - + + - - + + - + @@ -141,9 +141,9 @@ http://blogs.msdn.com/robmen/archive/2003/10/04/56479.aspx --> - - - + + + @@ -152,7 +152,7 @@ http://blogs.msdn.com/robmen/archive/2003/10/04/56479.aspx --> - + diff --git a/src/Installer/ChorusMergeModule.wixproj b/src/Installer/ChorusMergeModule.wixproj index 405f4c520..814e34825 100644 --- a/src/Installer/ChorusMergeModule.wixproj +++ b/src/Installer/ChorusMergeModule.wixproj @@ -1,5 +1,5 @@  - + Release x86 diff --git a/src/Installer/ChorusMergeModule.wxs b/src/Installer/ChorusMergeModule.wxs index 2ca372894..c27a0d0cb 100644 --- a/src/Installer/ChorusMergeModule.wxs +++ b/src/Installer/ChorusMergeModule.wxs @@ -48,13 +48,13 @@ http://blogs.msdn.com/robmen/archive/2003/10/04/56479.aspx --> - + - + - + @@ -62,34 +62,34 @@ http://blogs.msdn.com/robmen/archive/2003/10/04/56479.aspx --> - + - + - + - - + + - - + + - - + + - + - + - + @@ -100,9 +100,9 @@ http://blogs.msdn.com/robmen/archive/2003/10/04/56479.aspx --> - - - + + + diff --git a/src/Installer/GeneratedMercurial.wxs b/src/Installer/GeneratedMercurial.wxs index 21121c6ed..ac5c898ae 100644 --- a/src/Installer/GeneratedMercurial.wxs +++ b/src/Installer/GeneratedMercurial.wxs @@ -4,685 +4,134 @@ + - - - - - - + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -692,10 +141,6 @@ - - - - @@ -715,185 +160,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Installer/GeneratedMercurialExtensions.wxs b/src/Installer/GeneratedMercurialExtensions.wxs index 77cf34f8e..8a0695b44 100644 --- a/src/Installer/GeneratedMercurialExtensions.wxs +++ b/src/Installer/GeneratedMercurialExtensions.wxs @@ -2,63 +2,64 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - + diff --git a/src/LibChorus.TestUtilities/LibChorus.TestUtilities.csproj b/src/LibChorus.TestUtilities/LibChorus.TestUtilities.csproj index 1c97f8c19..ba1332c00 100644 --- a/src/LibChorus.TestUtilities/LibChorus.TestUtilities.csproj +++ b/src/LibChorus.TestUtilities/LibChorus.TestUtilities.csproj @@ -1,165 +1,57 @@ - - + + - Debug - AnyCPU - 9.0.21022 - 2.0 - {0681E722-1856-44A1-B585-220E6AEC85CB} - Library - Properties + net461 LibChorus.TestUtilities - LibChorus.TestUtilities - 512 - v4.6.1 - - - - True - full - False - ..\..\output\Debug - DEBUG;TRACE - prompt - 4 - True - AnyCPU - false - 6 + LibChorus.TestUtilities + Debug;Release + Test utilities for Chorus, the end-user collaboration library via 3-way xml merging and hg dvcs under the hood. + SIL International + SIL International + chorus + Copyright © 2010-2020 SIL International + SIL.Chorus.LibChorus.TestUtilities + MIT + https://github.com/sillsdev/chorus + false + ../../output/$(Configuration) + ../../output + true + ../FieldWorks.snk + None + true + snupkg + + + ../../CHANGELOG.md 1591 - - - pdbonly - True - ..\..\output\Release - TRACE - prompt - 4 - True - True + false + AnyCPU - false - 6 + win7-x86;win7-x64 - - True - ..\..\output\DebugMono - DEBUG;TRACE;MONO - True - full - AnyCPU - prompt - 4 - False - false - 6 - - - True - ..\..\output\ReleaseMono - TRACE;MONO - True - True - pdbonly - AnyCPU - prompt - 4 - false - 6 - - - true - ..\..\output\Debug\ - DEBUG;TRACE - true - full - AnyCPU - 6 - prompt - MinimumRecommendedRules.ruleset - - - true - ..\..\output\Release\ - TRACE - true - true - pdbonly - AnyCPU - 6 - prompt - MinimumRecommendedRules.ruleset - - - - False - ..\..\lib\Debug\SIL.Core.dll - - - False - ..\..\lib\Debug\SIL.TestUtilities.dll - - - - - False - ..\..\lib\Release\SIL.Core.dll - - - False - ..\..\lib\Release\SIL.TestUtilities.dll - - - - - False - ..\..\lib\DebugMono\SIL.Core.dll - - - False - ..\..\lib\DebugMono\SIL.TestUtilities.dll - - - - - False - ..\..\lib\ReleaseMono\SIL.Core.dll - - - False - ..\..\lib\ReleaseMono\SIL.TestUtilities.dll - - - - - - - - ..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll - - + - - - - - - - - - {94245366-8F1E-475C-810D-FE89BB3948E0} - LibChorus - - - - + + + + + + + + - + + + + + $(AssemblySearchPaths);{GAC} + + \ No newline at end of file diff --git a/src/LibChorus.TestUtilities/Properties/AssemblyInfo.cs b/src/LibChorus.TestUtilities/Properties/AssemblyInfo.cs deleted file mode 100644 index 897b9287a..000000000 --- a/src/LibChorus.TestUtilities/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("LibChorus.TestUtilities")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] -[assembly: AssemblyProduct("LibChorus.TestUtilities")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2012")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("e84173d8-7319-4632-b28c-d861aad8f6ed")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/LibChorus.TestUtilities/RepositorySetup.cs b/src/LibChorus.TestUtilities/RepositorySetup.cs index 112febc52..db83cfd1f 100644 --- a/src/LibChorus.TestUtilities/RepositorySetup.cs +++ b/src/LibChorus.TestUtilities/RepositorySetup.cs @@ -5,6 +5,7 @@ using Chorus.VcsDrivers.Mercurial; using NUnit.Framework; using NUnit.Framework.Constraints; +using SIL.PlatformUtilities; using SIL.Progress; using SIL.TestUtilities; @@ -97,7 +98,7 @@ public void Dispose() { if (Repository != null) { - Assert.IsFalse(Repository.GetHasLocks(), "A lock was left over, after the test."); + Assert.That(Repository.GetHasLocks(), Is.False, "A lock was left over, after the test."); } if (ProjectFolder != null) { @@ -198,17 +199,17 @@ public RepositoryAddress GetRepositoryAddress() public void AssertFileExistsRelativeToRoot(string relativePath) { - Assert.IsTrue(File.Exists(RootFolder.Combine(relativePath))); + Assert.That(RootFolder.Combine(relativePath), Does.Exist); } public void AssertFileExistsInRepository(string pathRelativeToRepositoryRoot) { - Assert.IsTrue(Repository.GetFileExistsInRepo(pathRelativeToRepositoryRoot)); + Assert.That(Repository.GetFileExistsInRepo(pathRelativeToRepositoryRoot), Is.True); } public void AssertFileDoesNotExistInRepository(string pathRelativeToRepositoryRoot) { - Assert.IsFalse(Repository.GetFileExistsInRepo(pathRelativeToRepositoryRoot)); + Assert.That(Repository.GetFileExistsInRepo(pathRelativeToRepositoryRoot), Is.False); } public static void MakeRepositoryForTest(string newRepositoryPath, string userId, IProgress progress) @@ -232,18 +233,18 @@ public IDisposable GetFileLockForReading(string localPath) } public IDisposable GetFileLockForWriting(string localPath) { -#if MONO + if (!Platform.IsMono) + return new StreamReader(ProjectFolder.Combine(localPath)); + // This doesn't work. A mono bug perhaps? (CP) - FileStream f = new FileStream(ProjectFolder.Combine(localPath), FileMode.Open, FileAccess.ReadWrite, FileShare.Read); + FileStream f = new FileStream(ProjectFolder.Combine(localPath), FileMode.Open, + FileAccess.ReadWrite, FileShare.Read); // This didn't work either //f.Lock(0, f.Length - 1); //FileStream f = new FileStream(ProjectFolder.Combine(localPath), FileMode.Open, FileAccess.Write, FileShare.None); // This locked the file, but also deleted it (as expected) which isn't what the test expects //FileStream f = new FileStream(ProjectFolder.Combine(localPath), FileMode.Create, FileAccess.Write, FileShare.None); return f; -#else - return new StreamReader(ProjectFolder.Combine(localPath)); -#endif } @@ -261,7 +262,7 @@ public void AssertHeadCount(int count) public void AssertFileExists(string relativePath) { - Assert.IsTrue(File.Exists(ProjectFolder.Combine(relativePath))); + Assert.That(ProjectFolder.Combine(relativePath), Does.Exist); } public void AssertFileContents(string relativePath, string expectedContents) diff --git a/src/LibChorus.TestUtilities/RepositoryWithFilesSetup.cs b/src/LibChorus.TestUtilities/RepositoryWithFilesSetup.cs index e299e8c8f..d1027f33b 100644 --- a/src/LibChorus.TestUtilities/RepositoryWithFilesSetup.cs +++ b/src/LibChorus.TestUtilities/RepositoryWithFilesSetup.cs @@ -111,7 +111,7 @@ public void Dispose() { if (Repository != null) { - Assert.IsFalse(Repository.GetHasLocks(), "A lock was left over, after the test."); + Assert.That(Repository.GetHasLocks(), Is.False, "A lock was left over, after the test."); } if (DoNotDispose) @@ -214,8 +214,8 @@ public void AssertHeadCount(int count) public void AssertSingleConflictType() { string cmlFile = ChorusNotesMergeEventListener.GetChorusNotesFilePath(UserFile.Path); - Assert.IsTrue(File.Exists(cmlFile), "ChorusNotes file should have been in working set"); - Assert.IsTrue(Synchronizer.Repository.GetFileIsInRepositoryFromFullPath(cmlFile), "ChorusNotes file should have been in repository"); + Assert.That(cmlFile, Does.Exist, "ChorusNotes file should have been in working set"); + Assert.That(Synchronizer.Repository.GetFileIsInRepositoryFromFullPath(cmlFile), Is.True, "ChorusNotes file should have been in repository"); XmlDocument doc = new XmlDocument(); doc.Load(cmlFile); @@ -230,12 +230,12 @@ public HgRepository GetRepository() public void AssertNoErrorsReported() { - Assert.IsFalse(ProgressString.ToLower().Contains("error")); + Assert.That(ProgressString, Does.Not.Contain("error").IgnoreCase); } public void AssertFileExists(string relativePath) { - Assert.IsTrue(File.Exists(ProjectFolder.Combine(relativePath))); + Assert.That(ProjectFolder.Combine(relativePath), Does.Exist); } public void AssertFileContents(string relativePath, string expectedContents) diff --git a/src/LibChorus.TestUtilities/XmlTestHelper.cs b/src/LibChorus.TestUtilities/XmlTestHelper.cs index b0923e095..138b7f3c9 100644 --- a/src/LibChorus.TestUtilities/XmlTestHelper.cs +++ b/src/LibChorus.TestUtilities/XmlTestHelper.cs @@ -68,7 +68,7 @@ public static void AssertXPathNotNull(string documentPath, string xpath) doc.WriteContentTo(writer); writer.Flush(); } - Assert.IsNotNull(node); + Assert.That(node, Is.Not.Null); } public static void AssertXPathIsNull(string xml, string xpath) @@ -87,7 +87,7 @@ public static void AssertXPathIsNull(string xml, string xpath) doc.WriteContentTo(writer); writer.Flush(); } - Assert.IsNull(node); + Assert.That(node, Is.Null); } public static void AssertXPathMatchesExactlyOne(string xml, string xpath, Dictionary namespaces) @@ -136,7 +136,7 @@ public static void AssertXPathIsNull(string xml, string xpath, Dictionary - - - \ No newline at end of file diff --git a/src/LibChorus/EnhancedDiff3.cs b/src/LibChorus/EnhancedDiff3.cs deleted file mode 100644 index 9ac30d344..000000000 --- a/src/LibChorus/EnhancedDiff3.cs +++ /dev/null @@ -1,147 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Text; -using Chorus.VCS.Utilities; - -namespace Chorus.VCS -{ - public class EnhancedDiff3 - { - public static string GetVersion() - { - Process p = new Process(); - p.StartInfo.UseShellExecute = false; - p.StartInfo.RedirectStandardError = true; - p.StartInfo.RedirectStandardOutput = true; - p.StartInfo.FileName = "diff3"; - p.StartInfo.Arguments = "--version"; - p.StartInfo.CreateNoWindow = true; - p.Start(); - p.WaitForExit(); - ExecutionResult result = new ExecutionResult(p); - Debug.WriteLine(result.StandardOutput); - return result.StandardOutput; - } - - private enum State - { - unknown, - ours, - common, - theirs, - normal - } - - public static void Merge(string common, string ours, string theirs, - string lcdOutputPath, string ourPartialOutputPath, string theirPartialOutputPath) - { - string merge = GetRawMerge(ours, common, theirs); - - StreamWriter lcd=null; - StreamWriter ourPartial=null; - StreamWriter theirPartial=null; - - try - { - lcd = File.CreateText(lcdOutputPath); - ourPartial = File.CreateText(ourPartialOutputPath); - theirPartial = File.CreateText(theirPartialOutputPath); - - ReadLines(merge, ourPartial, lcd, theirPartial); - } - finally - { - if (ourPartial != null) - { - ourPartial.Close(); - ourPartial.Dispose(); - } - if (theirPartial != null) - { - theirPartial.Close(); - theirPartial.Dispose(); - } - if (lcd != null) - { - lcd.Close(); - lcd.Dispose(); - } - } - } - - private static void ReadLines(string merge, StreamWriter ourPartial, StreamWriter lcd, StreamWriter theirPartial) - { - StringReader r = new StringReader(merge); - string line = null; - State state = State.normal; - do - { - line = r.ReadLine(); - if (line == null) - { - break; - } - if (line.StartsWith("<<<<<<<")) - { - state = State.ours; - continue; - } - else if (line.StartsWith("||||||")) - { - state = State.common; - continue; - } - else if (line.StartsWith("=======")) - { - state = State.theirs; - continue; - } - else if (line.StartsWith(">>>>>>>")) - { - state = State.normal; - continue; - } - - switch (state) - { - case State.ours: - ourPartial.WriteLine(line); - break; - case State.common: - lcd.WriteLine(line); - break; - case State.theirs: - theirPartial.WriteLine(line); - break; - default: - ourPartial.WriteLine(line); - lcd.WriteLine(line); - theirPartial.WriteLine(line); - break; - } - } while (line != null); - } - - public static string GetRawMerge(string oursPath, string commonPath, string theirPath) - { - Process p = new Process(); - p.StartInfo.UseShellExecute = false; - p.StartInfo.RedirectStandardError = true; - p.StartInfo.RedirectStandardOutput = true; - p.StartInfo.FileName = "diff3/bin/diff3.exe"; - p.StartInfo.Arguments = "-m " + oursPath + " "+commonPath+" "+theirPath; - p.StartInfo.CreateNoWindow = true; - p.Start(); - p.WaitForExit(); - ExecutionResult result = new ExecutionResult(p); - if (result.ExitCode == 2)//0 and 1 are ok - { - throw new ApplicationException("Got error "+result.ExitCode + " " +result.StandardOutput +" "+ result.StandardError); - } - Debug.WriteLine(result.StandardOutput); - return result.StandardOutput; - } - } -} diff --git a/src/LibChorus/FileTypeHandlers/lift/LiftDiffer.cs b/src/LibChorus/FileTypeHandlers/lift/LiftDiffer.cs deleted file mode 100644 index 39abfe945..000000000 --- a/src/LibChorus/FileTypeHandlers/lift/LiftDiffer.cs +++ /dev/null @@ -1,148 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Xml; -using Chorus.FileTypeHanders.xml; -using Chorus.merge.xml.generic; -using Chorus.VcsDrivers.Mercurial; - -namespace Chorus.FileTypeHanders.lift -{ - - /// - /// Given a parent and child lift file, reports on what changed. - /// - public class Lift2WayDiffer - { - private readonly FileInRevision _parentFileInRevision; - private readonly FileInRevision _childFileInRevision; - private readonly List _processedIds = new List(); - private readonly XmlDocument _childDom; - private readonly XmlDocument _parentDom; - private IMergeEventListener EventListener; - private readonly Dictionary _parentIdToNodeIndex; - - public static Lift2WayDiffer CreateFromFileInRevision(IMergeStrategy mergeStrategy, FileInRevision parent, FileInRevision child, IMergeEventListener eventListener, HgRepository repository) - { - return new Lift2WayDiffer(mergeStrategy, parent.GetFileContents(repository), child.GetFileContents(repository), eventListener, parent, child); - } - public static Lift2WayDiffer CreateFromStrings(IMergeStrategy mergeStrategy, string parentXml, string childXml, IMergeEventListener eventListener) - { - return new Lift2WayDiffer(mergeStrategy, parentXml, childXml, eventListener); - } - - private Lift2WayDiffer(IMergeStrategy mergeStrategy, string parentXml, string childXml,IMergeEventListener eventListener) - { - _childDom = new XmlDocument(); - _parentDom = new XmlDocument(); - - _childDom.LoadXml(childXml); - _parentDom.LoadXml(parentXml); - _parentIdToNodeIndex = new Dictionary(); - - EventListener = eventListener; - } - - private Lift2WayDiffer(IMergeStrategy mergeStrategy, string parentXml, string childXml , IMergeEventListener listener, FileInRevision parentFileInRevision, FileInRevision childFileInRevision) - :this(mergeStrategy,parentXml, childXml, listener) - { - _parentFileInRevision = parentFileInRevision; - _childFileInRevision = childFileInRevision; - } - - public void ReportDifferencesToListener() - { - foreach (XmlNode node in _parentDom.SafeSelectNodes("lift/entry")) - { - string strId = LiftUtils.GetId(node); - if (!_parentIdToNodeIndex.ContainsKey(strId)) - _parentIdToNodeIndex.Add(strId, node); - else - System.Diagnostics.Debug.WriteLine(String.Format("Found ID multiple times: {0}", strId)); - } - - foreach (XmlNode childNode in _childDom.SafeSelectNodes("lift/entry")) - { - try - { - ProcessEntry(childNode); - } - catch (Exception error) - { - EventListener.ChangeOccurred(new ErrorDeterminingChangeReport(_parentFileInRevision, - _childFileInRevision, null, childNode, - error)); - } - } - - //now detect any removed (not just marked as deleted) elements - foreach (XmlNode parentNode in _parentIdToNodeIndex.Values)// _parentDom.SafeSelectNodes("lift/entry")) - { - try - { - if (!_processedIds.Contains(LiftUtils.GetId(parentNode))) - { - EventListener.ChangeOccurred(new XmlDeletionChangeReport(_parentFileInRevision, parentNode, - null)); - } - } - catch (Exception error) - { - EventListener.ChangeOccurred(new ErrorDeterminingChangeReport(_parentFileInRevision, - _childFileInRevision, - parentNode, - null, - error)); - } - } - } - - - private void ProcessEntry(XmlNode child) - { - string id = LiftUtils.GetId(child); - XmlNode parent=null;// = LiftUtils.FindEntryById(_parentDom, id); - _parentIdToNodeIndex.TryGetValue(id, out parent); - - string path = string.Empty; - if (_childFileInRevision != null && !string.IsNullOrEmpty(_childFileInRevision.FullPath)) - { - path = Path.GetFileName(_childFileInRevision.FullPath); - } - string url = LiftUtils.GetUrl(child, path); - - if (parent == null) //it's new - { - //it's possible to create and entry, delete it, then checkin, leave us with this - //spurious deletion messages - if (string.IsNullOrEmpty(XmlUtilities.GetOptionalAttributeString(child, "dateDeleted"))) - { - EventListener.ChangeOccurred(new XmlAdditionChangeReport(_childFileInRevision, child, url)); - } - } - else if (LiftUtils.AreTheSame(child, parent))//unchanged or both made same change - { - } - else //one or both changed - { - if (!string.IsNullOrEmpty(XmlUtilities.GetOptionalAttributeString(child, "dateDeleted"))) - { - EventListener.ChangeOccurred(new XmlDeletionChangeReport(_parentFileInRevision, parent, child)); - } - else - { - //enhance... we are only using this because it will conveniently find the differences - //and fire them off for us - - //enhance: we can skip this and just say "something changed in this entry", - //until we really *need* the details (if ever), and have a way to call this then - //_mergingStrategy.MakeMergedEntry(this.EventListener, child, parent, parent); - EventListener.ChangeOccurred(new XmlChangedRecordReport(_parentFileInRevision, _childFileInRevision, parent,child, url)); - } - } - _processedIds.Add(id); - } - - - } -} \ No newline at end of file diff --git a/src/LibChorus/FileTypeHandlers/text/TextFileTypeHandler.cs b/src/LibChorus/FileTypeHandlers/text/TextFileTypeHandler.cs index 9cc3be54b..2666c51b2 100644 --- a/src/LibChorus/FileTypeHandlers/text/TextFileTypeHandler.cs +++ b/src/LibChorus/FileTypeHandlers/text/TextFileTypeHandler.cs @@ -9,6 +9,7 @@ using Chorus.Utilities; using Chorus.VcsDrivers.Mercurial; using SIL.IO; +using SIL.PlatformUtilities; using SIL.Progress; namespace Chorus.FileTypeHandlers.text @@ -144,35 +145,22 @@ public uint MaximumFileSize //Todo: not gonna work in Linux class LongToShortConverter { -#if !MONO [DllImport("kernel32.dll", CharSet = CharSet.Auto)] - - public static extern int GetShortPathName( - - [MarshalAs(UnmanagedType.LPTStr)] - - string path, - - [MarshalAs(UnmanagedType.LPTStr)] - - StringBuilder shortPath, - - int shortPathLength - - ); -#endif + private static extern int GetShortPathName( + [MarshalAs(UnmanagedType.LPTStr)] string path, + [MarshalAs(UnmanagedType.LPTStr)] StringBuilder shortPath, + int shortPathLength); public static string GetShortPath(string path) { -#if MONO - return path; -#else - StringBuilder shortPath = new StringBuilder(255); + if (Platform.IsMono) + return path; + + var shortPath = new StringBuilder(255); GetShortPathName(path, shortPath, shortPath.Capacity); return shortPath.ToString(); -#endif } } } \ No newline at end of file diff --git a/src/LibChorus/LibChorus.csproj b/src/LibChorus/LibChorus.csproj index 676609497..9f8bd338b 100644 --- a/src/LibChorus/LibChorus.csproj +++ b/src/LibChorus/LibChorus.csproj @@ -1,544 +1,96 @@ - - + + - Debug - AnyCPU - 9.0.21022 - 2.0 - {94245366-8F1E-475C-810D-FE89BB3948E0} - Library - Properties + net461 Chorus - LibChorus - - - 3.5 - - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - v4.6.1 - - - - True - full - False - ..\..\output\Debug - DEBUG;TRACE - prompt - 4 - True - AnyCPU - ..\..\output\Debug\LibChorus.XML - false - 6 + LibChorus + Debug;Release + End-user collaboration library via 3-way xml merging and hg dvcs under the hood. + SIL International + SIL International + chorus + Copyright © 2010-2020 SIL International + SIL.Chorus.LibChorus + MIT + https://github.com/sillsdev/chorus + false + ../../output/$(Configuration) + ../../output + true + ../FieldWorks.snk + None + true + snupkg + + + ../../CHANGELOG.md 1591 - - - pdbonly - True - ..\..\output\Release - TRACE - prompt - 4 - True - True - AnyCPU - false - 6 - - - True - ..\..\output\DebugMono - DEBUG;TRACE;MONO - True - ..\..\output\DebugMono\LibChorus.XML - full - AnyCPU - prompt - - - 4 - False - false - 6 - - - True - ..\..\output\ReleaseMono - TRACE;MONO - True - True - pdbonly - AnyCPU - prompt - 4 - false - 6 - - - true - ..\..\output\Debug\ - DEBUG;TRACE - true - ..\..\output\Debug\LibChorus.XML - full + false + AnyCPU - 6 - prompt - MinimumRecommendedRules.ruleset + win7-x86;win7-x64 - - true - ..\..\output\Release\ - TRACE - true - true - pdbonly - AnyCPU - 6 - prompt - MinimumRecommendedRules.ruleset - - - - False - ..\..\lib\Debug\L10NSharp.dll - - - False - ..\..\lib\Debug\SIL.Core.dll - - - False - ..\..\lib\Debug\SIL.Core.Desktop.dll - - - False - ..\..\lib\Debug\SIL.Lift.dll - - - False - ..\..\lib\Debug\SIL.WritingSystems.dll - - - - - False - ..\..\lib\Release\L10NSharp.dll - - - False - ..\..\lib\Release\SIL.Core.dll - - - False - ..\..\lib\Release\SIL.Core.Desktop.dll - - - False - ..\..\lib\Release\SIL.Lift.dll - - - False - ..\..\lib\Release\SIL.WritingSystems.dll - - - - - False - ..\..\lib\DebugMono\L10NSharp.dll - - - False - ..\..\lib\DebugMono\SIL.Core.dll - - - False - ..\..\lib\DebugMono\SIL.Core.Desktop.dll - - - False - ..\..\lib\DebugMono\SIL.Lift.dll - - - False - ..\..\lib\DebugMono\SIL.WritingSystems.dll - - - - - False - ..\..\lib\ReleaseMono\L10NSharp.dll - - - False - ..\..\lib\ReleaseMono\SIL.Core.dll - - - False - ..\..\lib\ReleaseMono\SIL.Core.Desktop.dll - - - False - ..\..\lib\ReleaseMono\SIL.Lift.dll - - - False - ..\..\lib\ReleaseMono\SIL.WritingSystems.dll - - + + + + + + + + + + + + + + + - - ..\..\packages\Autofac.2.6.3.862\lib\NET40\Autofac.dll - - - ..\..\packages\icu.net.2.7.0-beta.10\lib\net451\icu.net.dll - - - ..\..\packages\Microsoft.DotNet.PlatformAbstractions.2.0.4\lib\net45\Microsoft.DotNet.PlatformAbstractions.dll - - - ..\..\packages\Microsoft.Extensions.DependencyModel.2.0.4\lib\net451\Microsoft.Extensions.DependencyModel.dll - - - ..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll - - - - - - - - ..\..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + True True + AnnotationImages.resx + + True + True Resources.resx - - True + True - Settings.settings - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - True - True - AnnotationImages.resx + Settings.settings - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - False - .NET Framework 2.0 %28x86%29 - true - - - False - .NET Framework 3.0 %28x86%29 - false - - - False - .NET Framework 3.5 - false - + + SettingsSingleFileGenerator + Settings.Designer.cs + + - + PublicResXFileCodeGenerator AnnotationImages.Designer.cs - Designer - + ResXFileCodeGenerator Resources.Designer.cs - Designer - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - + - - - {94245366-8F1E-475C-810D-FE89BB3948E0} - Chorus - - + + $(AssemblySearchPaths);{GAC} - + \ No newline at end of file diff --git a/src/LibChorus/MercurialLocation.cs b/src/LibChorus/MercurialLocation.cs index 5b2fc6dcd..3ac61b798 100644 --- a/src/LibChorus/MercurialLocation.cs +++ b/src/LibChorus/MercurialLocation.cs @@ -65,29 +65,33 @@ private static void GuessAtLocationIfNotSetAlready() // We now try to use the same (antique) version of Mercurial on // both Windows and Linux, to maintain bug-for-bug compatibility. var executingAssemblyPath = ExecutionEnvironment.DirectoryOfExecutingAssembly; - var guess = Path.Combine(executingAssemblyPath, "Mercurial"); - if(Directory.Exists(guess)) + var guess = CheckForMercurialSubdirectory(executingAssemblyPath); + if (guess == null) { - PathToMercurialFolder = guess; - return; + var grandparentPath = Directory.GetParent(executingAssemblyPath).Parent.FullName; + guess = CheckForMercurialSubdirectory(grandparentPath); + if (guess == null) + { + var greatGrandParentPath = Directory.GetParent(grandparentPath).FullName; + guess = CheckForMercurialSubdirectory(greatGrandParentPath); + } } + PathToMercurialFolder = guess; + } + + private static string CheckForMercurialSubdirectory(string directory) + { //in case we're running off the wesay source code directory - var grandparentPath = Directory.GetParent(executingAssemblyPath).Parent.FullName; - guess = Path.Combine(grandparentPath, "common", "Mercurial"); + var guess = Path.Combine(directory, "common", "Mercurial"); if (Directory.Exists(guess)) { - PathToMercurialFolder = guess; - return; + return guess; } //in case we're running in chorus's solution directory - guess = Path.Combine(grandparentPath, "Mercurial"); - if (Directory.Exists(guess)) - { - PathToMercurialFolder = guess; - return; - } + guess = Path.Combine(directory, "Mercurial"); + return Directory.Exists(guess) ? guess : null; } } } diff --git a/src/LibChorus/Model/ServerSettingsModel.cs b/src/LibChorus/Model/ServerSettingsModel.cs index ab54236ce..b439f85c0 100644 --- a/src/LibChorus/Model/ServerSettingsModel.cs +++ b/src/LibChorus/Model/ServerSettingsModel.cs @@ -4,6 +4,7 @@ using System.Net; using System.Security.Cryptography; using System.Text; +using System.Web; using Chorus.Utilities; using Chorus.VcsDrivers; using Chorus.VcsDrivers.Mercurial; @@ -111,13 +112,13 @@ public virtual void InitFromProjectPath(string path) public virtual void InitFromUri(string url) { - var urlUsername = HttpUtilityFromMono.UrlDecode(UrlHelper.GetUserName(url)); + var urlUsername = HttpUtility.UrlDecode(UrlHelper.GetUserName(url)); if (!string.IsNullOrEmpty(urlUsername)) { Username = urlUsername; - Password = HttpUtilityFromMono.UrlDecode(UrlHelper.GetPassword(url)); + Password = HttpUtility.UrlDecode(UrlHelper.GetPassword(url)); } - ProjectId = HttpUtilityFromMono.UrlDecode(UrlHelper.GetPathAfterHost(url)); + ProjectId = HttpUtility.UrlDecode(UrlHelper.GetPathAfterHost(url)); HasLoggedIn = !string.IsNullOrEmpty(ProjectId); Bandwidth = new BandwidthItem(RepositoryAddress.IsKnownResumableRepository(url) ? BandwidthEnum.Low : BandwidthEnum.High); @@ -139,7 +140,7 @@ public string URL return CustomUrl; } - return $"https://{Host}/{HttpUtilityFromMono.UrlEncode(ProjectId)}"; + return $"https://{Host}/{HttpUtility.UrlEncode(ProjectId)}"; } } diff --git a/src/LibChorus/Properties/AnnotationImages.Designer.cs b/src/LibChorus/Properties/AnnotationImages.Designer.cs index a91d6f9b2..2ed35a67a 100644 --- a/src/LibChorus/Properties/AnnotationImages.Designer.cs +++ b/src/LibChorus/Properties/AnnotationImages.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.296 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -9,221 +9,269 @@ //------------------------------------------------------------------------------ namespace Chorus.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - public class AnnotationImages { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal AnnotationImages() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Chorus.Properties.AnnotationImages", typeof(AnnotationImages).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - public static System.Drawing.Bitmap approve16x16 { - get { - object obj = ResourceManager.GetObject("approve16x16", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - public static System.Drawing.Bitmap approve32x32 { - get { - object obj = ResourceManager.GetObject("approve32x32", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - public static System.Drawing.Bitmap check16x16 { - get { - object obj = ResourceManager.GetObject("check16x16", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - public static System.Drawing.Bitmap DataLossMerge16x16 { - get { - object obj = ResourceManager.GetObject("DataLossMerge16x16", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - public static System.Drawing.Bitmap DataLossMerge16x16Closed { - get { - object obj = ResourceManager.GetObject("DataLossMerge16x16Closed", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - public static System.Drawing.Bitmap DataLossMerge32x32 { - get { - object obj = ResourceManager.GetObject("DataLossMerge32x32", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - public static System.Drawing.Bitmap generic16x16 { - get { - object obj = ResourceManager.GetObject("generic16x16", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - public static System.Drawing.Bitmap generic32x32 { - get { - object obj = ResourceManager.GetObject("generic32x32", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized string similar to Element is not a text element. - /// - public static string kElementNotTextElement { - get { - return ResourceManager.GetString("kElementNotTextElement", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to File does not exist.. - /// - public static string kFileDoesNotExist { - get { - return ResourceManager.GetString("kFileDoesNotExist", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Invalid argument. - /// - public static string kInvalidArgument { - get { - return ResourceManager.GetString("kInvalidArgument", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to {"modelversion": 7000044}. - /// - public static string kModelVersion { - get { - return ResourceManager.GetString("kModelVersion", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Not a Text element.. - /// - public static string kNotATextElement { - get { - return ResourceManager.GetString("kNotATextElement", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Parameter is null or an empty string.. - /// - public static string kNullOrEmptyString { - get { - return ResourceManager.GetString("kNullOrEmptyString", resourceCulture); - } - } - - public static System.Drawing.Bitmap note16x16 { - get { - object obj = ResourceManager.GetObject("note16x16", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - public static System.Drawing.Bitmap note32x32 { - get { - object obj = ResourceManager.GetObject("note32x32", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - public static System.Drawing.Bitmap question16x16 { - get { - object obj = ResourceManager.GetObject("question16x16", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - public static System.Drawing.Bitmap question16x16Closed { - get { - object obj = ResourceManager.GetObject("question16x16Closed", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - public static System.Drawing.Bitmap question32x32 { - get { - object obj = ResourceManager.GetObject("question32x32", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - public static System.Drawing.Bitmap Warning16x16 { - get { - object obj = ResourceManager.GetObject("Warning16x16", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - public static System.Drawing.Bitmap Warning16x16Closed { - get { - object obj = ResourceManager.GetObject("Warning16x16Closed", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - public static System.Drawing.Bitmap Warning32x32 { - get { - object obj = ResourceManager.GetObject("Warning32x32", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - } + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class AnnotationImages { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal AnnotationImages() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Chorus.Properties.AnnotationImages", typeof(AnnotationImages).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap approve16x16 { + get { + object obj = ResourceManager.GetObject("approve16x16", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap approve32x32 { + get { + object obj = ResourceManager.GetObject("approve32x32", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap check16x16 { + get { + object obj = ResourceManager.GetObject("check16x16", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap DataLossMerge16x16 { + get { + object obj = ResourceManager.GetObject("DataLossMerge16x16", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap DataLossMerge16x16Closed { + get { + object obj = ResourceManager.GetObject("DataLossMerge16x16Closed", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap DataLossMerge32x32 { + get { + object obj = ResourceManager.GetObject("DataLossMerge32x32", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap generic16x16 { + get { + object obj = ResourceManager.GetObject("generic16x16", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap generic32x32 { + get { + object obj = ResourceManager.GetObject("generic32x32", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized string similar to Element is not a text element. + /// + public static string kElementNotTextElement { + get { + return ResourceManager.GetString("kElementNotTextElement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to File does not exist.. + /// + public static string kFileDoesNotExist { + get { + return ResourceManager.GetString("kFileDoesNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid argument. + /// + public static string kInvalidArgument { + get { + return ResourceManager.GetString("kInvalidArgument", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {"modelversion": 7000044}. + /// + public static string kModelVersion { + get { + return ResourceManager.GetString("kModelVersion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Not a Text element.. + /// + public static string kNotATextElement { + get { + return ResourceManager.GetString("kNotATextElement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Parameter is null or an empty string.. + /// + public static string kNullOrEmptyString { + get { + return ResourceManager.GetString("kNullOrEmptyString", resourceCulture); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap note16x16 { + get { + object obj = ResourceManager.GetObject("note16x16", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap note32x32 { + get { + object obj = ResourceManager.GetObject("note32x32", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap question16x16 { + get { + object obj = ResourceManager.GetObject("question16x16", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap question16x16Closed { + get { + object obj = ResourceManager.GetObject("question16x16Closed", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap question32x32 { + get { + object obj = ResourceManager.GetObject("question32x32", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap Warning16x16 { + get { + object obj = ResourceManager.GetObject("Warning16x16", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap Warning16x16Closed { + get { + object obj = ResourceManager.GetObject("Warning16x16Closed", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap Warning32x32 { + get { + object obj = ResourceManager.GetObject("Warning32x32", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } } diff --git a/src/LibChorus/Properties/AssemblyInfo.cs b/src/LibChorus/Properties/AssemblyInfo.cs index 736f1946e..102b56cd5 100644 --- a/src/LibChorus/Properties/AssemblyInfo.cs +++ b/src/LibChorus/Properties/AssemblyInfo.cs @@ -1,37 +1,5 @@ -using System.Reflection; using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Chorus")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("SIL")] -[assembly: AssemblyProduct("Chorus")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("89cfb86d-4b3a-489f-a321-653fd6d20d96")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.1.0.0")] -[assembly: AssemblyFileVersion("1.1.0.0")] -[assembly: InternalsVisibleTo("LibChorus.Tests")] -[assembly: InternalsVisibleTo("ChorusHubTests")] +// find the public key with: sn -tp FieldWorks.snk +[assembly: InternalsVisibleTo("LibChorus.Tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001005f4452c387d979e3cba05fd73bb9aebe8f8830874663d66a7869f614a8f5e8def658d5c5920fae609d28aa005d5a9af5bd758ca8f19ad0347b7aa76e1f723f8994792136f5ceff9fb6f719d4337f65da2e1d66a85cc5e28e4656a1a30c2ff513440393177625c725d3fb156dc3c11610ea5936b9404ab9d51f7eb71ac0aa27bd")] +[assembly: InternalsVisibleTo("ChorusHubTests, PublicKey=00240000048000009400000006020000002400005253413100040000010001005f4452c387d979e3cba05fd73bb9aebe8f8830874663d66a7869f614a8f5e8def658d5c5920fae609d28aa005d5a9af5bd758ca8f19ad0347b7aa76e1f723f8994792136f5ceff9fb6f719d4337f65da2e1d66a85cc5e28e4656a1a30c2ff513440393177625c725d3fb156dc3c11610ea5936b9404ab9d51f7eb71ac0aa27bd")] diff --git a/src/LibChorus/Properties/Resources.Designer.cs b/src/LibChorus/Properties/Resources.Designer.cs index d5c2e81ce..49cf79869 100644 --- a/src/LibChorus/Properties/Resources.Designer.cs +++ b/src/LibChorus/Properties/Resources.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.18444 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -19,7 +19,7 @@ namespace Chorus.Properties { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { diff --git a/src/LibChorus/Properties/Settings.Designer.cs b/src/LibChorus/Properties/Settings.Designer.cs index 2567777f9..c1457d7b7 100644 --- a/src/LibChorus/Properties/Settings.Designer.cs +++ b/src/LibChorus/Properties/Settings.Designer.cs @@ -8,55 +8,68 @@ // //------------------------------------------------------------------------------ -namespace Chorus.Properties { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default { - get { - return defaultInstance; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("")] - public string OtherBranchRevisions { - get { - return ((string)(this["OtherBranchRevisions"])); - } - set { - this["OtherBranchRevisions"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("")] - public string LanguageForgeUser { - get { - return ((string)(this["LanguageForgeUser"])); - } - set { - this["LanguageForgeUser"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("")] - public string LanguageForgePass { - get { - return ((string)(this["LanguageForgePass"])); - } - set { - this["LanguageForgePass"] = value; - } - } - } +namespace Chorus.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string OtherBranchRevisions + { + get + { + return ((string)(this["OtherBranchRevisions"])); + } + set + { + this["OtherBranchRevisions"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string LanguageForgeUser + { + get + { + return ((string)(this["LanguageForgeUser"])); + } + set + { + this["LanguageForgeUser"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string LanguageForgePass + { + get + { + return ((string)(this["LanguageForgePass"])); + } + set + { + this["LanguageForgePass"] = value; + } + } + } } diff --git a/src/LibChorus/Utilities/ExecutionEnvironment.cs b/src/LibChorus/Utilities/ExecutionEnvironment.cs index 881a8a354..3d55539f9 100644 --- a/src/LibChorus/Utilities/ExecutionEnvironment.cs +++ b/src/LibChorus/Utilities/ExecutionEnvironment.cs @@ -1,6 +1,7 @@ using System; using System.IO; using System.Reflection; +using SIL.PlatformUtilities; namespace Chorus.Utilities { @@ -43,17 +44,19 @@ protected static string GetTopAppDirectory() internal static string ChorusMergeFilePath() { -#if MONO - // We need to use a shell script wrapper on Linux to ensure the correct mono is called. - string chorusMergeFilePath = Path.Combine(ExecutionEnvironment.DirectoryOfExecutingAssembly, "chorusmerge"); - // The replace is only useful for use with the MonoDevelop environment whcih doesn't honor $(Configuration) in the csproj files. - // When this is exported as an environment var it needs escaping to prevent the shell from replacing it with an empty string. - // When MonoDevelop is fixed this can be removed. - chorusMergeFilePath = chorusMergeFilePath.Replace("$(Configuration)", "\\$(Configuration)"); -#else - string chorusMergeFilePath = Path.Combine(ExecutionEnvironment.DirectoryOfExecutingAssembly, "ChorusMerge.exe"); -#endif - return chorusMergeFilePath; + if (Platform.IsMono) + { + // We need to use a shell script wrapper on Linux to ensure the correct mono is called. + var chorusMergeFilePath = + Path.Combine(ExecutionEnvironment.DirectoryOfExecutingAssembly, + "chorusmerge"); + // The replace is only useful for use with the MonoDevelop environment which doesn't + // honor $(Configuration) in the csproj files. When this is exported as an environment + // var it needs escaping to prevent the shell from replacing it with an empty string. + // When MonoDevelop is fixed this can be removed. + return chorusMergeFilePath.Replace("$(Configuration)", "\\$(Configuration)"); + } + return Path.Combine(ExecutionEnvironment.DirectoryOfExecutingAssembly, "ChorusMerge.exe"); } } } \ No newline at end of file diff --git a/src/LibChorus/Utilities/UrlHelper.cs b/src/LibChorus/Utilities/UrlHelper.cs index bfcf74979..d02ba5f41 100644 --- a/src/LibChorus/Utilities/UrlHelper.cs +++ b/src/LibChorus/Utilities/UrlHelper.cs @@ -1,6 +1,7 @@ using System; using System.Linq; using System.Text.RegularExpressions; +using System.Web; using SIL.Reporting; namespace Chorus.Utilities @@ -61,16 +62,18 @@ public static string GetValueFromQueryStringOfRef(string url, string name, strin } //Could not parse the url lift://FTeam.lift?type=entry&label=نویس&id=e824f0ae-6d36-4c52-b30b-eb845d6c120a - var parse = SIL.Network.HttpUtilityFromMono.ParseQueryString(uri.Query); + var parse = HttpUtility.ParseQueryString(uri.Query); var r = parse.GetValues(name); var label = r == null ? defaultIfCannotGetIt : r.First(); return string.IsNullOrEmpty(label) ? defaultIfCannotGetIt : label; } +#pragma warning disable 168 catch (Exception e) +#pragma warning restore 168 { #if DEBUG - var message = String.Format("Debug mode only: GetValueFromQueryStringOfRef({0},{1}) {2}", originalUrl, name, e.Message); + var message = $"Debug mode only: GetValueFromQueryStringOfRef({originalUrl},{name}) {e.Message}"; ErrorReport.NotifyUserOfProblem(new SIL.Reporting.ShowOncePerSessionBasedOnExactMessagePolicy(), message); #endif return defaultIfCannotGetIt; diff --git a/src/LibChorus/VcsDrivers/Mercurial/HgRepository.cs b/src/LibChorus/VcsDrivers/Mercurial/HgRepository.cs index b5b30efb5..8e553a009 100644 --- a/src/LibChorus/VcsDrivers/Mercurial/HgRepository.cs +++ b/src/LibChorus/VcsDrivers/Mercurial/HgRepository.cs @@ -220,7 +220,7 @@ private static void CheckMercurialIni() { doc.Save(); } - // ReSharper disable EmptyGeneralCatchClause + // ReSharper disable EmptyGeneralCatchClause catch(Exception) { } @@ -1106,11 +1106,8 @@ public List GetRevisionsFromQueryResultText(string queryResultText) List items = new List(); Revision item = null; -#if MONO - int infiniteLoopChecker = 0;//trying to pin down WS-14981 send/receive hangs - while(line !=null && infiniteLoopChecker<100) -#endif - while (line != null) + int infiniteLoopChecker = 0; //trying to pin down WS-14981 send/receive hangs + while (line != null && infiniteLoopChecker < 100) { int colonIndex = line.IndexOf(":"); if (colonIndex > 0) @@ -1121,22 +1118,19 @@ public List GetRevisionsFromQueryResultText(string queryResultText) //With .net 3.5, this is removed by Trim(). With .net 4, it is not(!!!). //This lead to a failing test. We have no idea where it comes from, nor the cause. //The only thing that should be different on the server is that it is Windows XP. - string value = line.Substring(colonIndex + 1).Trim().Trim(new char[] { '\uFEFF', '\u200B' }).Trim(); + string value = line.Substring(colonIndex + 1).Trim() + .Trim(new char[] { '\uFEFF', '\u200B' }).Trim(); switch (label) { default: -#if MONO - infiniteLoopChecker++; -#endif + if (Platform.IsMono) + infiniteLoopChecker++; break; case "changeset": item = new Revision(this); items.Add(item); item.SetRevisionAndHashFromCombinedDescriptor(value); break; -#if MONO - infiniteLoopChecker=0; -#endif case "parent": item.AddParentFromCombinedNumberAndHash(value); break; @@ -1162,15 +1156,16 @@ public List GetRevisionsFromQueryResultText(string queryResultText) break; } } + line = reader.ReadLine(); } -#if MONO - if(infiniteLoopChecker >99) - { - _progress.WriteWarning("Had to break out of infinite loop in GetRevisionsFromQueryResultText(). See WS-14981: 'send/receive hangs'."); - } -#endif + if (infiniteLoopChecker > 99) + { + _progress.WriteWarning( + "Had to break out of infinite loop in GetRevisionsFromQueryResultText(). See WS-14981: 'send/receive hangs'."); + } + return items; } diff --git a/src/LibChorus/VcsDrivers/Mercurial/HgResumeRestApiServer.cs b/src/LibChorus/VcsDrivers/Mercurial/HgResumeRestApiServer.cs index b47caa855..1600acf04 100644 --- a/src/LibChorus/VcsDrivers/Mercurial/HgResumeRestApiServer.cs +++ b/src/LibChorus/VcsDrivers/Mercurial/HgResumeRestApiServer.cs @@ -1,6 +1,7 @@ using System; using System.Diagnostics; using System.Net; +using System.Web; using Chorus.Model; using Chorus.Utilities; @@ -123,7 +124,7 @@ public string ProjectId { if (_url.Query.Contains("repoId=")) { - return SIL.Network.HttpUtilityFromMono.ParseQueryString(_url.Query).Get("repoId"); + return HttpUtility.ParseQueryString(_url.Query).Get("repoId"); } if (_url.Segments[1].ToLower() != "projects/") { diff --git a/src/LibChorus/notes/AnnotationRepository.cs b/src/LibChorus/notes/AnnotationRepository.cs index d7a66c0f7..f0517eb54 100644 --- a/src/LibChorus/notes/AnnotationRepository.cs +++ b/src/LibChorus/notes/AnnotationRepository.cs @@ -212,7 +212,7 @@ public void Save(IProgress progress) _writingFileOurselves = true; using (var writer = XmlWriter.Create(AnnotationFilePath, CanonicalXmlSettings.CreateXmlWriterSettings()) - ) + ) { _doc.Save(writer); } diff --git a/src/LibChorus/packages.config b/src/LibChorus/packages.config deleted file mode 100644 index 48108556c..000000000 --- a/src/LibChorus/packages.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/src/LibChorusTests/FileHandlers/ChorusFileTypeHandlerCollectionTests.cs b/src/LibChorusTests/FileHandlers/ChorusFileTypeHandlerCollectionTests.cs index bcb3c24ad..b59959567 100644 --- a/src/LibChorusTests/FileHandlers/ChorusFileTypeHandlerCollectionTests.cs +++ b/src/LibChorusTests/FileHandlers/ChorusFileTypeHandlerCollectionTests.cs @@ -25,10 +25,12 @@ private static string SamplePluginPath { get { - var outputDir = Directory.GetParent(BaseDir).FullName; + var outputDir = Directory.GetParent(BaseDir).Parent.FullName; var samplePluginDir = Path.Combine(outputDir, "SamplePlugin"); - var samplePluginDllPath = Path.Combine(samplePluginDir, "Tests-ChorusPlugin.dll"); - return samplePluginDllPath; + var samplePluginDllPath = Path.Combine(samplePluginDir, "Release", "net461", "Tests-ChorusPlugin.dll"); + return File.Exists(samplePluginDllPath) ? + samplePluginDllPath : + Path.Combine(samplePluginDir, "Debug", "net461", "Tests-ChorusPlugin.dll"); } } diff --git a/src/LibChorusTests/FileHandlers/ChorusNotesFileHandlerTests.cs b/src/LibChorusTests/FileHandlers/ChorusNotesFileHandlerTests.cs index bb7c90e62..812543c6a 100644 --- a/src/LibChorusTests/FileHandlers/ChorusNotesFileHandlerTests.cs +++ b/src/LibChorusTests/FileHandlers/ChorusNotesFileHandlerTests.cs @@ -21,7 +21,7 @@ public class ChorusNotesFileHandlerTests { private IChorusFileTypeHandler _chorusNotesFileHandler; - [TestFixtureSetUp] + [OneTimeSetUp] public void FixtureSetup() { _chorusNotesFileHandler = (from handler in ChorusFileTypeHandlerCollection.CreateWithInstalledHandlers().Handlers @@ -29,7 +29,7 @@ where handler.GetType().Name == "ChorusNotesFileHandler" select handler).First(); } - [TestFixtureTearDown] + [OneTimeTearDown] public void FixtureTearDown() { _chorusNotesFileHandler = null; @@ -46,7 +46,7 @@ public void GetExtensionsOfKnownTextFileTypesIsChorusNotes() [Test] public void CanValidate_IsFalse() { - Assert.IsFalse(_chorusNotesFileHandler.CanValidateFile(null)); + Assert.That(_chorusNotesFileHandler.CanValidateFile(null), Is.False); } [Test] @@ -61,7 +61,7 @@ public void CanMergeAFile() using (var tempFile = TempFile.WithExtension("." + AnnotationRepository.FileExtension)) { File.WriteAllText(tempFile.Path, "" + Environment.NewLine + ""); - Assert.IsTrue(_chorusNotesFileHandler.CanMergeFile(tempFile.Path)); + Assert.That(_chorusNotesFileHandler.CanMergeFile(tempFile.Path), Is.True); } } @@ -262,9 +262,9 @@ public void EnsureMergedCData_IsRetained() private static void CheckResults(bool expectedToMatch, string source, string target) { - Assert.IsTrue(target.Contains("524786f4-8e27-4ebf-b7ea-02846723c2d8")); - Assert.IsTrue(target.Contains("a0481907-3fff-45a2-bb1c-961c3198c86a")); - Assert.IsTrue(target.Contains(" handler.GetType().Name == "ProjectLexiconSettingsFileHandler")).First(); } - [TestFixtureTearDown] + [OneTimeTearDown] public void FixtureTearDown() { _projectLexiconSettingsFileHandler = null; @@ -37,8 +37,8 @@ public void HandlerShouldProcessMaximumFileSize() public void HandlerOnlySupportsProjectLexiconSettingsExtension() { var extensions = _projectLexiconSettingsFileHandler.GetExtensionsOfKnownTextFileTypes(); - Assert.IsTrue(extensions.Count() == 1); - Assert.AreEqual("plsx", extensions.First()); + Assert.That(extensions.Count(), Is.EqualTo(1)); + Assert.That(extensions.First(), Is.EqualTo("plsx")); } [Test] diff --git a/src/LibChorusTests/FileHandlers/LexiconSettings/ProjectLexiconSettingsFileMergeTests.cs b/src/LibChorusTests/FileHandlers/LexiconSettings/ProjectLexiconSettingsFileMergeTests.cs index 96dcd4179..fccd28099 100644 --- a/src/LibChorusTests/FileHandlers/LexiconSettings/ProjectLexiconSettingsFileMergeTests.cs +++ b/src/LibChorusTests/FileHandlers/LexiconSettings/ProjectLexiconSettingsFileMergeTests.cs @@ -77,7 +77,7 @@ private static string TheirContentTemplate(string element) ".Replace("'", "\""), element); } - [TestFixtureSetUp] + [OneTimeSetUp] public void FixtureSetup() { _projectLexiconSettingsFileHandler = @@ -86,7 +86,7 @@ where handler.GetType().Name == "ProjectLexiconSettingsFileHandler" select handler).First(); } - [TestFixtureTearDown] + [OneTimeTearDown] public void FixtureTearDown() { _projectLexiconSettingsFileHandler = null; @@ -96,7 +96,7 @@ public void FixtureTearDown() [Test] public void CannotMergeNonexistantFile() { - Assert.IsFalse(_projectLexiconSettingsFileHandler.CanMergeFile("bogusPathname")); + Assert.That(_projectLexiconSettingsFileHandler.CanMergeFile("bogusPathname"), Is.False); } [Test] @@ -105,20 +105,20 @@ public void CanMergeGoodProjectLexiconSettingsFile() using (var tempFile = TempFile.WithExtension(".plsx")) { File.WriteAllText(tempFile.Path, "" + Environment.NewLine + ""); - Assert.IsTrue(_projectLexiconSettingsFileHandler.CanMergeFile(tempFile.Path)); + Assert.That(_projectLexiconSettingsFileHandler.CanMergeFile(tempFile.Path), Is.True); } } [Test] public void CannotMergeEmptyStringFile() { - Assert.IsFalse(_projectLexiconSettingsFileHandler.CanMergeFile(String.Empty)); + Assert.That(_projectLexiconSettingsFileHandler.CanMergeFile(String.Empty), Is.False); } [Test] public void CannotMergeNullFile() { - Assert.IsFalse(_projectLexiconSettingsFileHandler.CanMergeFile(null)); + Assert.That(_projectLexiconSettingsFileHandler.CanMergeFile(null), Is.False); } [Test] @@ -145,9 +145,9 @@ public void DuplicateWritingSystemsElementsAreRemoved() XmlMergeService.RemoveAmbiguousChildren(merger.EventListener, merger.MergeStrategies, badRootNode); XmlMergeService.RemoveAmbiguousChildNodes = oldValue; var childNodes = badRootNode.SelectNodes("WritingSystems"); - Assert.IsNotNull(childNodes); - Assert.IsTrue(childNodes.Count == 1); - Assert.IsNull(childNodes[0].Attributes["goner"]); + Assert.That(childNodes, Is.Not.Null); + Assert.That(childNodes.Count, Is.EqualTo(1)); + Assert.That(childNodes[0].Attributes["goner"], Is.Null); } [Test] diff --git a/src/LibChorusTests/FileHandlers/LexiconSettings/ProjectLexiconSettingsFileValidationTests.cs b/src/LibChorusTests/FileHandlers/LexiconSettings/ProjectLexiconSettingsFileValidationTests.cs index 3fe7aa7cc..5ad6b19d7 100644 --- a/src/LibChorusTests/FileHandlers/LexiconSettings/ProjectLexiconSettingsFileValidationTests.cs +++ b/src/LibChorusTests/FileHandlers/LexiconSettings/ProjectLexiconSettingsFileValidationTests.cs @@ -4,6 +4,7 @@ using Chorus.FileTypeHandlers; using NUnit.Framework; using SIL.IO; +using SIL.PlatformUtilities; namespace LibChorus.Tests.FileHandlers.LexiconSettings { @@ -19,29 +20,31 @@ public class ProjectLexiconSettingsFileValidationTests private TempFile _goodXmlButNotProjectLexiconSettingsTempFile; private TempFile _nonXmlTempFile; - [TestFixtureSetUp] + [OneTimeSetUp] public void FixtureSetup() { _handler = (ChorusFileTypeHandlerCollection.CreateWithInstalledHandlers().Handlers.Where( handler => handler.GetType().Name == "ProjectLexiconSettingsFileHandler")).First(); _goodXmlTempFile = TempFile.WithExtension(".plsx"); -#if MONO - File.WriteAllText(_goodXmlTempFile.Path, "" + Environment.NewLine + "" + Environment.NewLine + ""); -#else - File.WriteAllText(_goodXmlTempFile.Path, "" + Environment.NewLine + ""); -#endif + var nl = Environment.NewLine; + File.WriteAllText(_goodXmlTempFile.Path, Platform.IsMono ? + $"{nl}{nl}" : + $"{nl}"); _illformedXmlTempFile = TempFile.WithExtension(".plsx"); - File.WriteAllText(_illformedXmlTempFile.Path, "" + Environment.NewLine + ""); + File.WriteAllText(_illformedXmlTempFile.Path, + $"{nl}"); _goodXmlButNotProjectLexiconSettingsTempFile = TempFile.WithExtension(".plsx"); - File.WriteAllText(_goodXmlButNotProjectLexiconSettingsTempFile.Path, "" + Environment.NewLine + ""); + File.WriteAllText(_goodXmlButNotProjectLexiconSettingsTempFile.Path, + $"{nl}"); _nonXmlTempFile = TempFile.WithExtension(".txt"); - File.WriteAllText(_nonXmlTempFile.Path, "This is not a project lexicon settings file." + Environment.NewLine); + File.WriteAllText(_nonXmlTempFile.Path, + $"This is not a project lexicon settings file.{nl}"); } - [TestFixtureTearDown] + [OneTimeTearDown] public void FixtureTearDown() { _handler = null; @@ -61,61 +64,61 @@ public void FixtureTearDown() [Test] public void Cannot_Validate_Nonexistant_File() { - Assert.IsFalse(_handler.CanValidateFile("bogusPathname")); + Assert.That(_handler.CanValidateFile("bogusPathname"), Is.False); } [Test] public void Cannot_Validate_Null_File() { - Assert.IsFalse(_handler.CanValidateFile(null)); + Assert.That(_handler.CanValidateFile(null), Is.False); } [Test] public void Cannot_Validate_Empty_String_File() { - Assert.IsFalse(_handler.CanValidateFile(String.Empty)); + Assert.That(_handler.CanValidateFile(string.Empty), Is.False); } [Test] public void Cannot_Validate_Nonxml_File() { - Assert.IsFalse(_handler.CanValidateFile(_nonXmlTempFile.Path)); + Assert.That(_handler.CanValidateFile(_nonXmlTempFile.Path), Is.False); } [Test] public void Can_Validate_Fw_Xml_File() { - Assert.IsTrue(_handler.CanValidateFile(_goodXmlTempFile.Path)); + Assert.That(_handler.CanValidateFile(_goodXmlTempFile.Path), Is.True); } [Test] public void ValidateFile_Returns_Message_For_Empty_Pathname() { - Assert.IsNotNull(_handler.ValidateFile("", null)); + Assert.That(_handler.ValidateFile("", null), Is.Not.Null); } [Test] public void ValidateFile_Returns_Message_For_Null_Pathname() { - Assert.IsNotNull(_handler.ValidateFile(null, null)); + Assert.That(_handler.ValidateFile(null, null), Is.Not.Null); } [Test] public void ValidateFile_Returns_Null_For_Good_File() { - Assert.IsNull(_handler.ValidateFile(_goodXmlTempFile.Path, null)); + Assert.That(_handler.ValidateFile(_goodXmlTempFile.Path, null), Is.Null); } [Test] public void ValidateFile_Returns_Message_For_Crummy_ProjectLexiconSettings_File() { - Assert.IsNotNull(_handler.ValidateFile(_illformedXmlTempFile.Path, null)); + Assert.That(_handler.ValidateFile(_illformedXmlTempFile.Path, null), Is.Not.Null); } [Test] public void ValidateFile_Returns_Message_For_Good_But_Not_ProjectLexiconSettings_File() { - Assert.IsNotNull(_handler.ValidateFile(_goodXmlButNotProjectLexiconSettingsTempFile.Path, null)); + Assert.That(_handler.ValidateFile(_goodXmlButNotProjectLexiconSettingsTempFile.Path, null), Is.Not.Null); } } } \ No newline at end of file diff --git a/src/LibChorusTests/FileHandlers/LexiconSettings/UserLexiconSettingsFileHandlerTests.cs b/src/LibChorusTests/FileHandlers/LexiconSettings/UserLexiconSettingsFileHandlerTests.cs index 5864b6c28..36d555aa3 100644 --- a/src/LibChorusTests/FileHandlers/LexiconSettings/UserLexiconSettingsFileHandlerTests.cs +++ b/src/LibChorusTests/FileHandlers/LexiconSettings/UserLexiconSettingsFileHandlerTests.cs @@ -14,14 +14,14 @@ public class UserLexiconSettingsFileHandlerTests { private IChorusFileTypeHandler _userLexiconSettingsFileHandler; - [TestFixtureSetUp] + [OneTimeSetUp] public void FixtureSetup() { _userLexiconSettingsFileHandler = (ChorusFileTypeHandlerCollection.CreateWithInstalledHandlers().Handlers.Where( handler => handler.GetType().Name == "UserLexiconSettingsFileHandler")).First(); } - [TestFixtureTearDown] + [OneTimeTearDown] public void FixtureTearDown() { _userLexiconSettingsFileHandler = null; @@ -37,7 +37,7 @@ public void HandlerShouldProcessMaximumFileSize() public void HandlerOnlySupportsUserLexiconSettingsExtension() { var extensions = _userLexiconSettingsFileHandler.GetExtensionsOfKnownTextFileTypes(); - Assert.IsTrue(extensions.Count() == 1); + Assert.That(extensions.Count(), Is.EqualTo(1)); Assert.AreEqual("ulsx", extensions.First()); } diff --git a/src/LibChorusTests/FileHandlers/LexiconSettings/UserLexiconSettingsFileMergeTests.cs b/src/LibChorusTests/FileHandlers/LexiconSettings/UserLexiconSettingsFileMergeTests.cs index 91993ee59..3acf74b25 100644 --- a/src/LibChorusTests/FileHandlers/LexiconSettings/UserLexiconSettingsFileMergeTests.cs +++ b/src/LibChorusTests/FileHandlers/LexiconSettings/UserLexiconSettingsFileMergeTests.cs @@ -77,7 +77,7 @@ private static string TheirContentTemplate(string element, string grcValue, stri ".Replace("'", "\""), element, grcValue, sehIpaValue, sehValue); } - [TestFixtureSetUp] + [OneTimeSetUp] public void FixtureSetup() { _userLexiconSettingsFileHandler = @@ -86,7 +86,7 @@ where handler.GetType().Name == "UserLexiconSettingsFileHandler" select handler).First(); } - [TestFixtureTearDown] + [OneTimeTearDown] public void FixtureTearDown() { _userLexiconSettingsFileHandler = null; @@ -96,7 +96,7 @@ public void FixtureTearDown() [Test] public void CannotMergeNonexistantFile() { - Assert.IsFalse(_userLexiconSettingsFileHandler.CanMergeFile("bogusPathname")); + Assert.That(_userLexiconSettingsFileHandler.CanMergeFile("bogusPathname"), Is.False); } [Test] @@ -105,20 +105,20 @@ public void CanMergeGoodUserLexiconSettingsFile() using (var tempFile = TempFile.WithExtension(".ulsx")) { File.WriteAllText(tempFile.Path, "" + Environment.NewLine + ""); - Assert.IsTrue(_userLexiconSettingsFileHandler.CanMergeFile(tempFile.Path)); + Assert.That(_userLexiconSettingsFileHandler.CanMergeFile(tempFile.Path), Is.True); } } [Test] public void CannotMergeEmptyStringFile() { - Assert.IsFalse(_userLexiconSettingsFileHandler.CanMergeFile(String.Empty)); + Assert.That(_userLexiconSettingsFileHandler.CanMergeFile(String.Empty), Is.False); } [Test] public void CannotMergeNullFile() { - Assert.IsFalse(_userLexiconSettingsFileHandler.CanMergeFile(null)); + Assert.That(_userLexiconSettingsFileHandler.CanMergeFile(null), Is.False); } [Test] @@ -145,9 +145,9 @@ public void DuplicateWritingSystemsElementsAreRemoved() XmlMergeService.RemoveAmbiguousChildren(merger.EventListener, merger.MergeStrategies, badRootNode); XmlMergeService.RemoveAmbiguousChildNodes = oldValue; var childNodes = badRootNode.SelectNodes("WritingSystems"); - Assert.IsNotNull(childNodes); - Assert.IsTrue(childNodes.Count == 1); - Assert.IsNull(childNodes[0].Attributes["goner"]); + Assert.That(childNodes, Is.Not.Null); + Assert.That(childNodes.Count, Is.EqualTo(1)); + Assert.That(childNodes[0].Attributes["goner"], Is.Null); } [Test] diff --git a/src/LibChorusTests/FileHandlers/LexiconSettings/UserLexiconSettingsFileValidationTests.cs b/src/LibChorusTests/FileHandlers/LexiconSettings/UserLexiconSettingsFileValidationTests.cs index 1200751d9..453b0e12e 100644 --- a/src/LibChorusTests/FileHandlers/LexiconSettings/UserLexiconSettingsFileValidationTests.cs +++ b/src/LibChorusTests/FileHandlers/LexiconSettings/UserLexiconSettingsFileValidationTests.cs @@ -4,6 +4,7 @@ using Chorus.FileTypeHandlers; using NUnit.Framework; using SIL.IO; +using SIL.PlatformUtilities; namespace LibChorus.Tests.FileHandlers.LexiconSettings { @@ -19,29 +20,31 @@ public class UserLexiconSettingsFileValidationTests private TempFile _goodXmlButNotUserLexiconSettingsTempFile; private TempFile _nonXmlTempFile; - [TestFixtureSetUp] + [OneTimeSetUp] public void FixtureSetup() { _handler = (ChorusFileTypeHandlerCollection.CreateWithInstalledHandlers().Handlers.Where( handler => handler.GetType().Name == "UserLexiconSettingsFileHandler")).First(); _goodXmlTempFile = TempFile.WithExtension(".ulsx"); -#if MONO - File.WriteAllText(_goodXmlTempFile.Path, "" + Environment.NewLine + "" + Environment.NewLine + ""); -#else - File.WriteAllText(_goodXmlTempFile.Path, "" + Environment.NewLine + ""); -#endif + var nl = Environment.NewLine; + File.WriteAllText(_goodXmlTempFile.Path, Platform.IsMono ? + $"{nl}{nl}" : + $"{nl}"); _illformedXmlTempFile = TempFile.WithExtension(".ulsx"); - File.WriteAllText(_illformedXmlTempFile.Path, "" + Environment.NewLine + ""); + File.WriteAllText(_illformedXmlTempFile.Path, + $"{nl}"); _goodXmlButNotUserLexiconSettingsTempFile = TempFile.WithExtension(".ulsx"); - File.WriteAllText(_goodXmlButNotUserLexiconSettingsTempFile.Path, "" + Environment.NewLine + ""); + File.WriteAllText(_goodXmlButNotUserLexiconSettingsTempFile.Path, + $"{nl}"); _nonXmlTempFile = TempFile.WithExtension(".txt"); - File.WriteAllText(_nonXmlTempFile.Path, "This is not a user lexicon settings file." + Environment.NewLine); + File.WriteAllText(_nonXmlTempFile.Path, + $"This is not a user lexicon settings file.{nl}"); } - [TestFixtureTearDown] + [OneTimeTearDown] public void FixtureTearDown() { _handler = null; @@ -61,61 +64,61 @@ public void FixtureTearDown() [Test] public void Cannot_Validate_Nonexistant_File() { - Assert.IsFalse(_handler.CanValidateFile("bogusPathname")); + Assert.That(_handler.CanValidateFile("bogusPathname"), Is.False); } [Test] public void Cannot_Validate_Null_File() { - Assert.IsFalse(_handler.CanValidateFile(null)); + Assert.That(_handler.CanValidateFile(null), Is.False); } [Test] public void Cannot_Validate_Empty_String_File() { - Assert.IsFalse(_handler.CanValidateFile(String.Empty)); + Assert.That(_handler.CanValidateFile(String.Empty), Is.False); } [Test] public void Cannot_Validate_Nonxml_File() { - Assert.IsFalse(_handler.CanValidateFile(_nonXmlTempFile.Path)); + Assert.That(_handler.CanValidateFile(_nonXmlTempFile.Path), Is.False); } [Test] public void Can_Validate_Fw_Xml_File() { - Assert.IsTrue(_handler.CanValidateFile(_goodXmlTempFile.Path)); + Assert.That(_handler.CanValidateFile(_goodXmlTempFile.Path), Is.True); } [Test] public void ValidateFile_Returns_Message_For_Empty_Pathname() { - Assert.IsNotNull(_handler.ValidateFile("", null)); + Assert.That(_handler.ValidateFile("", null), Is.Not.Null); } [Test] public void ValidateFile_Returns_Message_For_Null_Pathname() { - Assert.IsNotNull(_handler.ValidateFile(null, null)); + Assert.That(_handler.ValidateFile(null, null), Is.Not.Null); } [Test] public void ValidateFile_Returns_Null_For_Good_File() { - Assert.IsNull(_handler.ValidateFile(_goodXmlTempFile.Path, null)); + Assert.That(_handler.ValidateFile(_goodXmlTempFile.Path, null), Is.Null); } [Test] public void ValidateFile_Returns_Message_For_Crummy_ProjectLexiconSettings_File() { - Assert.IsNotNull(_handler.ValidateFile(_illformedXmlTempFile.Path, null)); + Assert.That(_handler.ValidateFile(_illformedXmlTempFile.Path, null), Is.Not.Null); } [Test] public void ValidateFile_Returns_Message_For_Good_But_Not_ProjectLexiconSettings_File() { - Assert.IsNotNull(_handler.ValidateFile(_goodXmlButNotUserLexiconSettingsTempFile.Path, null)); + Assert.That(_handler.ValidateFile(_goodXmlButNotUserLexiconSettingsTempFile.Path, null), Is.Not.Null); } } } diff --git a/src/LibChorusTests/FileHandlers/LiftRanges/LiftRangesFileHandlerTests.cs b/src/LibChorusTests/FileHandlers/LiftRanges/LiftRangesFileHandlerTests.cs index d61b882b2..fdf060820 100644 --- a/src/LibChorusTests/FileHandlers/LiftRanges/LiftRangesFileHandlerTests.cs +++ b/src/LibChorusTests/FileHandlers/LiftRanges/LiftRangesFileHandlerTests.cs @@ -19,7 +19,7 @@ public class LiftRangesFileHandlerTests private IChorusFileTypeHandler _liftRangesFileHandler; private ListenerForUnitTests _eventListener; - [TestFixtureSetUp] + [OneTimeSetUp] public void FixtureSetup() { _liftRangesFileHandler = (from handler in ChorusFileTypeHandlerCollection.CreateWithInstalledHandlers().Handlers @@ -27,7 +27,7 @@ where handler.GetType().Name == "LiftRangesFileTypeHandler" select handler).First(); } - [TestFixtureTearDown] + [OneTimeTearDown] public void FixtureTearDown() { _liftRangesFileHandler = null; @@ -54,13 +54,13 @@ public void GetExtensionsOfKnownTextFileTypesIsLiftRanges() [Test] public void CannotDiffAFile() { - Assert.IsFalse(_liftRangesFileHandler.CanDiffFile(null)); + Assert.That(_liftRangesFileHandler.CanDiffFile(null), Is.False); } [Test] public void CannotValidateAFile() { - Assert.IsFalse(_liftRangesFileHandler.CanValidateFile(null)); + Assert.That(_liftRangesFileHandler.CanValidateFile(null), Is.False); } [Test] @@ -69,20 +69,20 @@ public void CanMergeAFile() using (var tempFile = TempFile.WithExtension(".lift-ranges")) { File.WriteAllText(tempFile.Path, "" + Environment.NewLine + ""); - Assert.IsTrue(_liftRangesFileHandler.CanMergeFile(tempFile.Path)); + Assert.That(_liftRangesFileHandler.CanMergeFile(tempFile.Path), Is.True); } } [Test] public void CannotPresentANullFile() { - Assert.IsFalse(_liftRangesFileHandler.CanPresentFile(null)); + Assert.That(_liftRangesFileHandler.CanPresentFile(null), Is.False); } [Test] public void CannotPresentAnEmptyFileName() { - Assert.IsFalse(_liftRangesFileHandler.CanPresentFile("")); + Assert.That(_liftRangesFileHandler.CanPresentFile(""), Is.False); } [Test] @@ -90,7 +90,7 @@ public void CannotPresentAFileWithOtherExtension() { using (var tempFile = TempFile.WithExtension(".ClassData")) { - Assert.IsFalse(_liftRangesFileHandler.CanPresentFile(tempFile.Path)); + Assert.That(_liftRangesFileHandler.CanPresentFile(tempFile.Path), Is.False); } } @@ -99,7 +99,7 @@ public void CanPresentAGoodFile() { using (var tempFile = TempFile.WithExtension(".ClassData")) { - Assert.IsFalse(_liftRangesFileHandler.CanPresentFile(tempFile.Path)); + Assert.That(_liftRangesFileHandler.CanPresentFile(tempFile.Path), Is.False); } } @@ -119,7 +119,7 @@ public void ValidateFileHasNoResultsForValiidFile() "; using (var tempFile = new TempFile(data)) { - Assert.IsNull(_liftRangesFileHandler.ValidateFile(tempFile.Path, new NullProgress())); + Assert.That(_liftRangesFileHandler.ValidateFile(tempFile.Path, new NullProgress()), Is.Null); } } diff --git a/src/LibChorusTests/FileHandlers/audio/AudioFileTypeHandlerTests.cs b/src/LibChorusTests/FileHandlers/audio/AudioFileTypeHandlerTests.cs index 926d1d136..a046a17b8 100644 --- a/src/LibChorusTests/FileHandlers/audio/AudioFileTypeHandlerTests.cs +++ b/src/LibChorusTests/FileHandlers/audio/AudioFileTypeHandlerTests.cs @@ -14,14 +14,14 @@ public class AudioFileTypeHandlerTests { private IChorusFileTypeHandler _audioFileHandler; - [TestFixtureSetUp] + [OneTimeSetUp] public void FixtureSetup() { _audioFileHandler = (ChorusFileTypeHandlerCollection.CreateWithInstalledHandlers().Handlers.Where( handler => handler.GetType().Name == "AudioFileTypeHandler")).First(); } - [TestFixtureTearDown] + [OneTimeTearDown] public void FixtureTearDown() { _audioFileHandler = null; @@ -37,7 +37,7 @@ public void HandlerShouldOnlyProcessMegabyteSizedFiles() public void HandlerSupportsCorrectExtensions() { var extensions = _audioFileHandler.GetExtensionsOfKnownTextFileTypes().ToList(); - Assert.IsTrue(extensions.Count() == 8); + Assert.That(extensions.Count(), Is.EqualTo(8)); var expectedExtensions = new HashSet {"wav", "snd", "au", "aif", "aifc", "aiff", "wma", "mp3"}; foreach (var expectedExtension in expectedExtensions) Assert.Contains(expectedExtension, extensions); diff --git a/src/LibChorusTests/FileHandlers/default/DefaultFileTypeHandlerTests.cs b/src/LibChorusTests/FileHandlers/default/DefaultFileTypeHandlerTests.cs index 59700131a..bfa989c56 100644 --- a/src/LibChorusTests/FileHandlers/default/DefaultFileTypeHandlerTests.cs +++ b/src/LibChorusTests/FileHandlers/default/DefaultFileTypeHandlerTests.cs @@ -13,13 +13,13 @@ public class DefaultFileTypeHandlerTests { private IChorusFileTypeHandler _defaultFileHandler; - [TestFixtureSetUp] + [OneTimeSetUp] public void FixtureSetup() { _defaultFileHandler = new DefaultFileTypeHandler(); } - [TestFixtureTearDown] + [OneTimeTearDown] public void FixtureTearDown() { _defaultFileHandler = null; @@ -35,7 +35,7 @@ public void HandlerShouldOnlyProcessMegabyteSizedFiles() public void HandlerSupportsCorrectExtensions() { var extensions = _defaultFileHandler.GetExtensionsOfKnownTextFileTypes().ToList(); - Assert.IsTrue(extensions.Count == 0); + Assert.That(extensions.Count, Is.EqualTo(0)); } [Test] diff --git a/src/LibChorusTests/FileHandlers/image/ImageFileTypeHandlerTests.cs b/src/LibChorusTests/FileHandlers/image/ImageFileTypeHandlerTests.cs index 2b919e6bd..02fc63d2a 100644 --- a/src/LibChorusTests/FileHandlers/image/ImageFileTypeHandlerTests.cs +++ b/src/LibChorusTests/FileHandlers/image/ImageFileTypeHandlerTests.cs @@ -14,14 +14,14 @@ public class ImageFileTypeHandlerTests { private IChorusFileTypeHandler _imageFileHandler; - [TestFixtureSetUp] + [OneTimeSetUp] public void FixtureSetup() { _imageFileHandler = (ChorusFileTypeHandlerCollection.CreateWithInstalledHandlers().Handlers.Where( handler => handler.GetType().Name == "ImageFileTypeHandler")).First(); } - [TestFixtureTearDown] + [OneTimeTearDown] public void FixtureTearDown() { _imageFileHandler = null; diff --git a/src/LibChorusTests/FileHandlers/ldml/LdmlFileHandlerTests.cs b/src/LibChorusTests/FileHandlers/ldml/LdmlFileHandlerTests.cs index 780320046..a188eb1c4 100644 --- a/src/LibChorusTests/FileHandlers/ldml/LdmlFileHandlerTests.cs +++ b/src/LibChorusTests/FileHandlers/ldml/LdmlFileHandlerTests.cs @@ -14,14 +14,14 @@ public class LdmlFileHandlerTests { private IChorusFileTypeHandler _ldmlFileHandler; - [TestFixtureSetUp] + [OneTimeSetUp] public void FixtureSetup() { _ldmlFileHandler = (ChorusFileTypeHandlerCollection.CreateWithInstalledHandlers().Handlers.Where( handler => handler.GetType().Name == "LdmlFileHandler")).First(); } - [TestFixtureTearDown] + [OneTimeTearDown] public void FixtureTearDown() { _ldmlFileHandler = null; @@ -37,7 +37,7 @@ public void HandlerShouldProcessMaximumFileSize() public void HandlerOnlySupportsldmlExtension() { var extensions = _ldmlFileHandler.GetExtensionsOfKnownTextFileTypes(); - Assert.IsTrue(extensions.Count() == 1); + Assert.That(extensions.Count(), Is.EqualTo(1)); Assert.AreEqual("ldml", extensions.First()); } diff --git a/src/LibChorusTests/FileHandlers/ldml/LdmlFileMergeTests.cs b/src/LibChorusTests/FileHandlers/ldml/LdmlFileMergeTests.cs index e757fdce5..8c616fb05 100644 --- a/src/LibChorusTests/FileHandlers/ldml/LdmlFileMergeTests.cs +++ b/src/LibChorusTests/FileHandlers/ldml/LdmlFileMergeTests.cs @@ -28,7 +28,7 @@ public class LdmlFileMergeTests private ListenerForUnitTests _eventListener; private DateTime _expectedUtcDateTime; - [TestFixtureSetUp] + [OneTimeSetUp] public void FixtureSetup() { _ldmlFileHandler = (from handler in ChorusFileTypeHandlerCollection.CreateWithInstalledHandlers().Handlers @@ -39,7 +39,7 @@ where handler.GetType().Name == "LdmlFileHandler" } - [TestFixtureTearDown] + [OneTimeTearDown] public void FixtureTearDown() { _ldmlFileHandler = null; @@ -49,13 +49,13 @@ public void FixtureTearDown() [Test] public void CannotMergeNonexistantFile() { - Assert.IsFalse(_ldmlFileHandler.CanMergeFile("bogusPathname")); + Assert.That(_ldmlFileHandler.CanMergeFile("bogusPathname"), Is.False); } [Test] public void CannotMergeEmptyStringFile() { - Assert.IsFalse(_ldmlFileHandler.CanMergeFile(String.Empty)); + Assert.That(_ldmlFileHandler.CanMergeFile(String.Empty), Is.False); } [Test] @@ -64,14 +64,14 @@ public void CanMergeGoodFwXmlFile() using (var tempFile = TempFile.WithExtension(".ldml")) { File.WriteAllText(tempFile.Path, "" + Environment.NewLine + ""); - Assert.IsTrue(_ldmlFileHandler.CanMergeFile(tempFile.Path)); + Assert.That(_ldmlFileHandler.CanMergeFile(tempFile.Path), Is.True); } } [Test] public void CannotMergeNullFile() { - Assert.IsFalse(_ldmlFileHandler.CanMergeFile(null)); + Assert.That(_ldmlFileHandler.CanMergeFile(null), Is.False); } [Test] @@ -104,26 +104,26 @@ public void DuplicateSpecialElementsAreRemoved() XmlMergeService.RemoveAmbiguousChildren(merger.EventListener, merger.MergeStrategies, badRootNode); XmlMergeService.RemoveAmbiguousChildNodes = oldValue; var childNodes = badRootNode.SelectNodes("special"); - Assert.IsTrue(childNodes.Count == 4); + Assert.That(childNodes.Count, Is.EqualTo(4)); for (var idx = 0; idx < 4; ++idx) { XmlNode currentNode = childNodes[idx]; switch (idx) { case 0: - Assert.IsNotNull(currentNode.Attributes["xmlns:palaso"]); + Assert.That(currentNode.Attributes["xmlns:palaso"], Is.Not.Null); break; case 1: - Assert.IsNotNull(currentNode.Attributes["xmlns:palaso2"]); + Assert.That(currentNode.Attributes["xmlns:palaso2"], Is.Not.Null); break; case 2: - Assert.IsNotNull(currentNode.Attributes["xmlns:fw"]); + Assert.That(currentNode.Attributes["xmlns:fw"], Is.Not.Null); break; case 3: - Assert.IsNotNull(currentNode.Attributes["xmlns:sil"]); + Assert.That(currentNode.Attributes["xmlns:sil"], Is.Not.Null); break; } - Assert.IsNull(currentNode.Attributes["goner"]); + Assert.That(currentNode.Attributes["goner"], Is.Null); } } @@ -438,7 +438,7 @@ public void Merging_Different_Characters_Changes_Works() [á à ă â å ä ã ā æ ç é è ĕ ê ë ē í ì ĭ î ï ī ñ ó ò ŏ ô ö ø ō œ ú ù ŭ û ü ū ÿ] - [A B C D E F G H I J K L M N O P Q R S T U V W X Y Z] + [A B C D E F G H I J K L M N O P Q R S T U V W X Y Z] [a b c d e f g h i j k l m n o p q r s t u v w x y z] …{ 0} @@ -457,7 +457,7 @@ public void Merging_Different_Characters_Changes_Works() [á à ă â å ä ã ā æ ç é è ĕ ê ë ē í ì ĭ î ï ī ñ ó ò ŏ ô ö ø ō œ ú ù ŭ û ü ū ÿ] - [A B C D E F G H I J K L N O P Q R S T U V W X Y Z] + [A B C D E F G H I J K L N O P Q R S T U V W X Y Z] [a b c d e f g h i j k l m n o p q r s t u v w x y z] {0}… …{ 0} @@ -477,7 +477,7 @@ public void Merging_Different_Characters_Changes_Works() [á à ă â å ä ã ā æ ç é è ĕ ê ë ē í ì ĭ î ï ī ñ ó ò ŏ ô ö ø ō œ ú ù ŭ û ü ū ÿ] - [A B C D E F G H I J K L M N O P Q R S T U V W X Y Z] + [A B C D E F G H I J K L M N O P Q R S T U V W X Y Z] [a b c [ch] d e f g h i j k l m n o p q r s t u v w x y z] {0}… …{ 0} @@ -582,7 +582,7 @@ public void Merging_Both_Change_AttributelessExemplar_Works() @"ldml/characters/exemplarCharacters[text()='[a b c d e f g h i j k l m n o p q r s t u v w x y z]']", // original is gone @"ldml/characters/exemplarCharacters[text()='[a b c d e f g h i j k l n o p q r s t u v w x y z]']" // theirs loses and is gone }, - 1, new List { typeof(BothEditedTheSameAtomicElement) }, + 1, new List { typeof(BothEditedTheSameAtomicElement) }, 1, new List { typeof(XmlAttributeBothMadeSameChangeReport) }); } @@ -668,7 +668,7 @@ public void DelimitersAreMerged() [Test] public void LayoutIsMerged() { - string commonAncestor = + string commonAncestor = @" @@ -892,9 +892,9 @@ public void KnownKeyboards_AreMergedV3() typeof(AmbiguousInsertConflict), typeof(BothEditedTheSameAtomicElement) }, - 6, new List - { - typeof(XmlAttributeBothMadeSameChangeReport), + 6, new List + { + typeof(XmlAttributeBothMadeSameChangeReport), typeof(XmlBothDeletionChangeReport), typeof(XmlAdditionChangeReport), typeof(XmlAdditionChangeReport), @@ -983,12 +983,12 @@ public void FontsAreMerged() { typeof(BothEditedTheSameAtomicElement), }, - 4, new List - { - typeof(XmlAttributeBothMadeSameChangeReport), + 4, new List + { + typeof(XmlAttributeBothMadeSameChangeReport), typeof(XmlBothDeletionChangeReport), typeof(XmlAdditionChangeReport), - typeof(XmlAdditionChangeReport) + typeof(XmlAdditionChangeReport) }); } @@ -1080,9 +1080,7 @@ public void FontsAndCollationChangesMergeCleanly() @"/ldml/collations/collation/cr[contains(text(), 'c(0), - 0, new List - { - }, + 0, new List(), 3, new List { @@ -1172,12 +1170,12 @@ public void SpellchecksAreMerged() { typeof(BothEditedTheSameAtomicElement), }, - 4, new List - { - typeof(XmlAttributeBothMadeSameChangeReport), + 4, new List + { + typeof(XmlAttributeBothMadeSameChangeReport), typeof(XmlBothDeletionChangeReport), typeof(XmlAdditionChangeReport), - typeof(XmlAdditionChangeReport) + typeof(XmlAdditionChangeReport) }); } @@ -1245,15 +1243,15 @@ public void TransformsAreMerged() }, new List(0), 0, new List(0), - 7, new List - { - typeof(XmlAttributeBothMadeSameChangeReport), + 7, new List + { + typeof(XmlAttributeBothMadeSameChangeReport), typeof(XmlBothDeletionChangeReport), typeof(XmlBothAddedSameChangeReport), typeof(XmlAdditionChangeReport), typeof(XmlAdditionChangeReport), typeof(XmlAdditionChangeReport), - typeof(XmlAdditionChangeReport) + typeof(XmlAdditionChangeReport) }); } @@ -1573,7 +1571,7 @@ public void PreMerge_DoesNotCrashIfChangesAreMissingCollation() namespaces, new List(), new List(), - 0, null, + 0, null, 3, new List { typeof(XmlBothDeletionChangeReport), typeof(XmlAttributeBothMadeSameChangeReport) , typeof(XmlBothAddedSameChangeReport) })); } diff --git a/src/LibChorusTests/FileHandlers/ldml/LdmlFileValidationTests.cs b/src/LibChorusTests/FileHandlers/ldml/LdmlFileValidationTests.cs index 1ef9b8287..31bd2fb0a 100644 --- a/src/LibChorusTests/FileHandlers/ldml/LdmlFileValidationTests.cs +++ b/src/LibChorusTests/FileHandlers/ldml/LdmlFileValidationTests.cs @@ -4,6 +4,7 @@ using Chorus.FileTypeHandlers; using NUnit.Framework; using SIL.IO; +using SIL.PlatformUtilities; namespace LibChorus.Tests.FileHandlers.ldml { @@ -19,29 +20,31 @@ public class LdmlFileValidationTests private TempFile _goodXmlButNotLdmlTempFile; private TempFile _nonXmlTempFile; - [TestFixtureSetUp] + [OneTimeSetUp] public void FixtureSetup() { _handler = (ChorusFileTypeHandlerCollection.CreateWithInstalledHandlers().Handlers.Where( handler => handler.GetType().Name == "LdmlFileHandler")).First(); _goodXmlTempFile = TempFile.WithExtension(".ldml"); -#if MONO - File.WriteAllText(_goodXmlTempFile.Path, "" + Environment.NewLine + "" + Environment.NewLine + ""); -#else - File.WriteAllText(_goodXmlTempFile.Path, "" + Environment.NewLine + ""); -#endif + var nl = Environment.NewLine; + File.WriteAllText(_goodXmlTempFile.Path, Platform.IsMono ? + $"{nl}{nl}" : + $"{nl}"); _illformedXmlTempFile = TempFile.WithExtension(".ldml"); - File.WriteAllText(_illformedXmlTempFile.Path, "" + Environment.NewLine + ""); + File.WriteAllText(_illformedXmlTempFile.Path, + $"{nl}"); _goodXmlButNotLdmlTempFile = TempFile.WithExtension(".ldml"); - File.WriteAllText(_goodXmlButNotLdmlTempFile.Path, "" + Environment.NewLine + ""); + File.WriteAllText(_goodXmlButNotLdmlTempFile.Path, + $"{nl}"); _nonXmlTempFile = TempFile.WithExtension(".txt"); - File.WriteAllText(_nonXmlTempFile.Path, "This is not an ldml file." + Environment.NewLine); + File.WriteAllText(_nonXmlTempFile.Path, + $"This is not an ldml file.{nl}"); } - [TestFixtureTearDown] + [OneTimeTearDown] public void FixtureTearDown() { _handler = null; @@ -61,61 +64,61 @@ public void FixtureTearDown() [Test] public void Cannot_Validate_Nonexistant_File() { - Assert.IsFalse(_handler.CanValidateFile("bogusPathname")); + Assert.That(_handler.CanValidateFile("bogusPathname"), Is.False); } [Test] public void Cannot_Validate_Null_File() { - Assert.IsFalse(_handler.CanValidateFile(null)); + Assert.That(_handler.CanValidateFile(null), Is.False); } [Test] public void Cannot_Validate_Empty_String_File() { - Assert.IsFalse(_handler.CanValidateFile(String.Empty)); + Assert.That(_handler.CanValidateFile(String.Empty), Is.False); } [Test] public void Cannot_Validate_Nonxml_File() { - Assert.IsFalse(_handler.CanValidateFile(_nonXmlTempFile.Path)); + Assert.That(_handler.CanValidateFile(_nonXmlTempFile.Path), Is.False); } [Test] public void Can_Validate_Fw_Xml_File() { - Assert.IsTrue(_handler.CanValidateFile(_goodXmlTempFile.Path)); + Assert.That(_handler.CanValidateFile(_goodXmlTempFile.Path), Is.True); } [Test] public void ValidateFile_Returns_Message_For_Empty_Pathname() { - Assert.IsNotNull(_handler.ValidateFile("", null)); + Assert.That(_handler.ValidateFile("", null), Is.Not.Null); } [Test] public void ValidateFile_Returns_Message_For_Null_Pathname() { - Assert.IsNotNull(_handler.ValidateFile(null, null)); + Assert.That(_handler.ValidateFile(null, null), Is.Not.Null); } [Test] public void ValidateFile_Returns_Null_For_Good_File() { - Assert.IsNull(_handler.ValidateFile(_goodXmlTempFile.Path, null)); + Assert.That(_handler.ValidateFile(_goodXmlTempFile.Path, null), Is.Null); } [Test] public void ValidateFile_Returns_Message_For_Crummy_Ldml_File() { - Assert.IsNotNull(_handler.ValidateFile(_illformedXmlTempFile.Path, null)); + Assert.That(_handler.ValidateFile(_illformedXmlTempFile.Path, null), Is.Not.Null); } [Test] public void ValidateFile_Returns_Message_For_Good_But_Not_Ldml_File() { - Assert.IsNotNull(_handler.ValidateFile(_goodXmlButNotLdmlTempFile.Path, null)); + Assert.That(_handler.ValidateFile(_goodXmlButNotLdmlTempFile.Path, null), Is.Not.Null); } } } \ No newline at end of file diff --git a/src/LibChorusTests/LibChorus.Tests.csproj b/src/LibChorusTests/LibChorus.Tests.csproj index cb3a5b917..134e44109 100644 --- a/src/LibChorusTests/LibChorus.Tests.csproj +++ b/src/LibChorusTests/LibChorus.Tests.csproj @@ -1,309 +1,49 @@ - - + + - Debug - AnyCPU - 9.0.21022 - 2.0 - {F9671F8B-8556-44EA-81A7-C236D871B471} - Library - Properties + net461 LibChorus.Tests - LibChorus.Tests - - - 3.5 - - - v4.6.1 - - - - True - full - False - ..\..\output\Debug - DEBUG;TRACE - prompt - 4 - True - AnyCPU - false - 6 + LibChorus.Tests + Debug;Release + Unit tests for LibChorus.dll + SIL International + SIL International + chorus + Copyright © 2010-2020 SIL International + ../../output/$(Configuration) + true + ../FieldWorks.snk + true 1591 - - - pdbonly - True - ..\..\output\Release - TRACE - prompt - 4 - True - True - AnyCPU - false - 6 - - - True - ..\..\output\DebugMono - DEBUG;TRACE;MONO - True - full - AnyCPU - prompt - 4 - False - false - 6 - - - True - ..\..\output\ReleaseMono - TRACE;MONO - True - True - pdbonly - AnyCPU - prompt - 4 - false - 6 - - - true - ..\..\output\Debug\ - DEBUG;TRACE - true - full - AnyCPU - 6 - prompt - MinimumRecommendedRules.ruleset - - - true - ..\..\output\Release\ - TRACE - true - true - pdbonly + false + false + AnyCPU - 6 - prompt - MinimumRecommendedRules.ruleset + win7-x86;win7-x64 - - - False - ..\..\lib\Debug\SIL.Core.dll - - - False - ..\..\lib\Debug\SIL.TestUtilities.dll - - - False - ..\..\lib\Debug\SIL.WritingSystems.dll - - - False - ..\..\lib\Debug\SIL.WritingSystems.Tests.dll - - - - - False - ..\..\lib\Release\SIL.Core.dll - - - False - ..\..\lib\Release\SIL.TestUtilities.dll - - - False - ..\..\lib\Release\SIL.WritingSystems.dll - - - False - ..\..\lib\Release\SIL.WritingSystems.Tests.dll - - - - - False - ..\..\lib\DebugMono\SIL.Core.dll - - - False - ..\..\lib\DebugMono\SIL.TestUtilities.dll - - - False - ..\..\lib\DebugMono\SIL.WritingSystems.dll - - - False - ..\..\lib\DebugMono\SIL.WritingSystems.Tests.dll - - - - - False - ..\..\lib\ReleaseMono\SIL.Core.dll - - - False - ..\..\lib\ReleaseMono\SIL.TestUtilities.dll - - - False - ..\..\lib\ReleaseMono\SIL.WritingSystems.dll - - - False - ..\..\lib\ReleaseMono\SIL.WritingSystems.Tests.dll - - + - - ..\..\packages\Autofac.2.6.3.862\lib\NET40\Autofac.dll - - - ..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll - - - ..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll - - - False - ..\..\lib\Debug\SIL.Core.Desktop.dll - - - - - - - False - ..\..\packages\ICSharpCode.SharpZipLib.Patched.0.86.5\lib\net20\ICSharpCode.SharpZipLib.dll - - + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {0681E722-1856-44A1-B585-220E6AEC85CB} - LibChorus.TestUtilities - - - {94245366-8F1E-475C-810D-FE89BB3948E0} - LibChorus - - - {1264E294-F719-491C-863A-703CB48385D8} - ChorusMerge - + + + + PreserveNewest @@ -311,17 +51,11 @@ PreserveNewest - - - - - - + + + + $(AssemblySearchPaths);{GAC} + + \ No newline at end of file diff --git a/src/LibChorusTests/Model/InternetCloneSettingsModelTests.cs b/src/LibChorusTests/Model/InternetCloneSettingsModelTests.cs index 1804d7eaf..584c5a776 100644 --- a/src/LibChorusTests/Model/InternetCloneSettingsModelTests.cs +++ b/src/LibChorusTests/Model/InternetCloneSettingsModelTests.cs @@ -16,7 +16,7 @@ public void InitFromUri_GivenCompleteUri_AllPropertiesCorrect() var model = new InternetCloneSettingsModel(testFolder.Path); model.InitFromUri("https://john:myPassword@hg-languageforge.org/tpi?localFolder=tokPisin"); Assert.AreEqual("tokPisin", model.LocalFolderName); - Assert.IsTrue(model.ReadyToDownload); + Assert.That(model.ReadyToDownload, Is.True); Assert.AreEqual("https://hg-languageforge.org/tpi", model.URL); Assert.AreEqual("john", model.Username); Assert.AreEqual("myPassword", model.Password); diff --git a/src/LibChorusTests/Model/ServerSettingsModelTests.cs b/src/LibChorusTests/Model/ServerSettingsModelTests.cs index 5e514c31d..f8c6e4bcb 100644 --- a/src/LibChorusTests/Model/ServerSettingsModelTests.cs +++ b/src/LibChorusTests/Model/ServerSettingsModelTests.cs @@ -292,7 +292,7 @@ public void RememberPassword(string cachedPassword, string savedPassword, bool e } else { - Assert.IsNullOrEmpty(sut.Password); + Assert.That(sut.Password, Is.Null.Or.Empty); } } @@ -316,8 +316,8 @@ public void SaveSettings_NoHgFolderExists_CreatesOneWithCorrectPath() m.InitFromProjectPath(folder.Path); m.SetUrlToUseIfSettingsAreEmpty(url); m.SaveSettings(); - Assert.IsTrue(Directory.Exists(folder.Combine(".hg"))); - Assert.IsTrue(File.Exists(folder.Combine(".hg","hgrc"))); + Assert.That(folder.Combine(".hg"), Does.Exist); + Assert.That(folder.Combine(".hg","hgrc"), Does.Exist); var repo = HgRepository.CreateOrUseExisting(folder.Path, new NullProgress()); var address = repo.GetDefaultNetworkAddress(); Assert.AreEqual(new ServerSettingsModel.BandwidthItem(ServerSettingsModel.BandwidthEnum.High), m.Bandwidth); @@ -353,8 +353,8 @@ public void SaveSettings_PreexistsAndWeSave_MovesCredentials([Values(true, false m.SaveSettings(); Assert.AreEqual(user, Settings.Default.LanguageForgeUser); Assert.AreEqual(pass, ServerSettingsModel.DecryptPassword(Settings.Default.LanguageForgePass)); - Assert.IsTrue(Directory.Exists(folder.Combine(".hg"))); - Assert.IsTrue(File.Exists(folder.Combine(".hg", "hgrc"))); + Assert.That(folder.Combine(".hg"), Does.Exist); + Assert.That(folder.Combine(".hg", "hgrc"), Does.Exist); var repo = HgRepository.CreateOrUseExisting(folder.Path, new NullProgress()); var address = repo.GetDefaultNetworkAddress(); Assert.AreEqual(newUrl, address.URI); @@ -379,7 +379,7 @@ public void SaveSettings_ForgetsPassword() Assert.AreEqual(pass, ServerSettingsModel.PasswordForSession); var repo = HgRepository.CreateOrUseExisting(folder.Path, new NullProgress()); var address = repo.GetDefaultNetworkAddress(); - Assert.That(address.URI, Is.Not.StringContaining(pass)); + Assert.That(address.URI, Does.Not.Contain(pass)); } } @@ -396,7 +396,7 @@ public void SetUrlToUseIfSettingsAreEmpty_RepoAlreadyExistsWithAServerAddress_Ig var url = "https://joe:pass@hg-public.languageforge.org/tpi"; m.InitFromProjectPath(folder.Path); m.SetUrlToUseIfSettingsAreEmpty(url); - Assert.AreEqual(existing, m.URL); + Assert.AreEqual(existing,m.URL); } } diff --git a/src/LibChorusTests/Properties/AssemblyInfo.cs b/src/LibChorusTests/Properties/AssemblyInfo.cs deleted file mode 100644 index 08bda6e54..000000000 --- a/src/LibChorusTests/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Chorus.Tests")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("SIL")] -[assembly: AssemblyProduct("Chorus.Tests")] -[assembly: AssemblyCopyright("Copyright © 2008")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("c5536da8-086c-477d-8a7a-fa257718130e")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/LibChorusTests/VcsDrivers/Mercurial/HgRepositoryTests.cs b/src/LibChorusTests/VcsDrivers/Mercurial/HgRepositoryTests.cs index f24145eef..ec344d0c1 100644 --- a/src/LibChorusTests/VcsDrivers/Mercurial/HgRepositoryTests.cs +++ b/src/LibChorusTests/VcsDrivers/Mercurial/HgRepositoryTests.cs @@ -142,12 +142,12 @@ public void RemoveCredentialsFromIniIfNecessary_PreservesOtherData(string savedU Assert.AreEqual("shibboleth", ServerSettingsModel.PasswordForSession, "should have read password from file"); if (string.IsNullOrEmpty(newSavedPass)) { - Assert.IsNullOrEmpty(Chorus.Properties.Settings.Default.LanguageForgePass); + Assert.That(Chorus.Properties.Settings.Default.LanguageForgePass, Is.Null.Or.Empty); } else { - Assert.AreEqual(newSavedPass, ServerSettingsModel.DecryptPassword(Chorus.Properties.Settings.Default.LanguageForgePass), - "should have saved the password to user settings"); + Assert.That(ServerSettingsModel.DecryptPassword(Chorus.Properties.Settings.Default.LanguageForgePass), + Is.EqualTo(newSavedPass), "should have saved the password to user settings"); } } } diff --git a/src/LibChorusTests/VcsDrivers/Mercurial/HgSettingsTests.cs b/src/LibChorusTests/VcsDrivers/Mercurial/HgSettingsTests.cs index db37983ff..4a8293a31 100644 --- a/src/LibChorusTests/VcsDrivers/Mercurial/HgSettingsTests.cs +++ b/src/LibChorusTests/VcsDrivers/Mercurial/HgSettingsTests.cs @@ -112,7 +112,7 @@ public void GetIsReadyForInternetSendReceive_NoPaths_ReturnsFalse() { using (new MercurialIniForTests()) { - Assert.IsFalse(GetIsReady(@"")); + Assert.That(GetIsReady(@""), Is.False); } } @@ -123,7 +123,7 @@ public void GetIsReadyForInternetSendReceive_MissingUsername_ReturnsFalse() { Settings.Default.LanguageForgeUser = string.Empty; ServerSettingsModel.PasswordForSession = "password"; - Assert.IsFalse(GetIsReady(@"LanguageForge = https://hg-public.languageforge.org/xyz")); + Assert.That(GetIsReady(@"LanguageForge = https://hg-public.languageforge.org/xyz"), Is.False); } } @@ -134,7 +134,7 @@ public void GetIsReadyForInternetSendReceive_MissingPassword_ReturnsFalse() { Settings.Default.LanguageForgeUser = "username"; ServerSettingsModel.PasswordForSession = Settings.Default.LanguageForgePass = string.Empty; - Assert.IsFalse(GetIsReady(@"LanguageForge = https://hg-public.languageforge.org/xyz")); + Assert.That(GetIsReady(@"LanguageForge = https://hg-public.languageforge.org/xyz"), Is.False); } } @@ -348,7 +348,7 @@ public void SetTheOnlyAddressOfThisType_SettingInternetPathHadSameType_IsReplace private void AssertHgrcNowContainsUri(HgRepository repository, string uri) { - Assert.IsNotNull(repository.GetRepositoryPathsInHgrc().FirstOrDefault(a=>a.URI == uri)); + Assert.That(repository.GetRepositoryPathsInHgrc().FirstOrDefault(a=>a.URI == uri), Is.Not.Null); } [Test] @@ -438,7 +438,8 @@ public void EnsureTheseExtensionAreEnabled_AddingToExistingExtensions_NewAddedAn // This test won't throw as expected because the HgRepository code attempts to write // a good ini file, and we can't make it bad without it fixing it again. - [Test, Ignore] + [Test] + [Ignore("HgRepository code attempts to write a good ini file, and we can't make it bad without it fixing it again")] public void BadMercurialIni_Throws() { using (new MercurialIniHider()) diff --git a/src/LibChorusTests/VcsDrivers/Mercurial/HgVersionBranchingTests.cs b/src/LibChorusTests/VcsDrivers/Mercurial/HgVersionBranchingTests.cs index 038e9060b..2d7c71f83 100644 --- a/src/LibChorusTests/VcsDrivers/Mercurial/HgVersionBranchingTests.cs +++ b/src/LibChorusTests/VcsDrivers/Mercurial/HgVersionBranchingTests.cs @@ -93,7 +93,7 @@ public void DoesNewBranchExist_Yes() bool result = branchingHelper.IsLatestBranchDifferent(myVersion, out revNum); // Verification - Assert.IsTrue(result, "The only branch should be default."); + Assert.That(result, Is.True, "The only branch should be default."); var revision = repoWithFiles.Repository.GetRevision(revNum); Assert.AreEqual(newBranchName, revision.Branch, "Wrong branch name in new branch."); var revisions = repoWithFiles.Repository.GetAllRevisions(); @@ -123,7 +123,7 @@ public void DoesNewBranchExist_No() bool result = branchingHelper.IsLatestBranchDifferent(myVersion, out revNum); // Verification - Assert.IsFalse(result, "The only branch should be default."); + Assert.That(result, Is.False, "The only branch should be default."); } } diff --git a/src/LibChorusTests/VcsDrivers/Mercurial/HgWrappingTests.cs b/src/LibChorusTests/VcsDrivers/Mercurial/HgWrappingTests.cs index 7224cb2bd..4893096b5 100644 --- a/src/LibChorusTests/VcsDrivers/Mercurial/HgWrappingTests.cs +++ b/src/LibChorusTests/VcsDrivers/Mercurial/HgWrappingTests.cs @@ -32,7 +32,7 @@ public void Setup() public void GetEnvironmentReadinessMessageIsNull() { var s = HgRepository.GetEnvironmentReadinessMessage("en"); - Assert.IsNullOrEmpty(s); + Assert.That(s, Is.Null.Or.Empty); } [Test, Ignore("By Hand only")] @@ -49,7 +49,7 @@ public void RemoveOldLocks_NoLocks_ReturnsTrue() { using (var setup = new HgTestSetup()) { - Assert.IsTrue(setup.Repository.RemoveOldLocks()); + Assert.That(setup.Repository.RemoveOldLocks(), Is.True); } } @@ -59,8 +59,8 @@ public void RemoveOldLocks_WLockButNotRunningHg_LockRemoved() using (var setup = new HgTestSetup()) { var file = TempFileFromFolder.CreateAt(setup.Root.Combine(".hg", "wlock"), "blah"); - Assert.IsTrue(setup.Repository.RemoveOldLocks()); - Assert.IsFalse(File.Exists(file.Path)); + Assert.That(setup.Repository.RemoveOldLocks(), Is.True); + Assert.That(File.Exists(file.Path), Is.False); } } @@ -71,9 +71,9 @@ public void RemoveOldLocks_WLockAndLockButNotRunningHg_BothLocksRemoved() { var file1 = TempFileFromFolder.CreateAt(setup.Root.Combine(".hg", "wlock"), "blah"); var file2 = TempFileFromFolder.CreateAt(setup.Root.Combine(".hg", "store", "lock"), "blah"); - Assert.IsTrue(setup.Repository.RemoveOldLocks()); - Assert.IsFalse(File.Exists(file1.Path)); - Assert.IsFalse(File.Exists(file2.Path)); + Assert.That(setup.Repository.RemoveOldLocks(), Is.True); + Assert.That(File.Exists(file1.Path), Is.False); + Assert.That(File.Exists(file2.Path), Is.False); } } @@ -87,7 +87,7 @@ public void RemoveOldLocks_WLockAndHgIsRunning_ReturnsFalse() using(var file = TempFileFromFolder.CreateAt(setup.Root.Combine(".hg", "wlock"), "blah")) { - Assert.IsFalse(setup.Repository.RemoveOldLocks(ourName, true)); + Assert.That(setup.Repository.RemoveOldLocks(ourName, true), Is.False); } } } @@ -102,7 +102,7 @@ public void RemoveOldLocks_LockAndHgIsRunning_ReturnsFalse() using(var file = TempFileFromFolder.CreateAt(setup.Root.Combine(".hg", "store", "lock"), "blah")) { - Assert.IsFalse(setup.Repository.RemoveOldLocks(ourName, true)); + Assert.That(setup.Repository.RemoveOldLocks(ourName, true), Is.False); } } } @@ -141,7 +141,7 @@ public void GetRevisionWorkingSetIsBasedOn_NoCheckinsYet_GivesNull() HgRepository.CreateRepositoryInExistingDir(testRoot.Path, _progress); var repo = new HgRepository(testRoot.Path, new NullProgress()); var rev = repo.GetRevisionWorkingSetIsBasedOn(); - Assert.IsNull(rev); + Assert.That(rev, Is.Null); } } @@ -228,7 +228,7 @@ public void GetRevision_RevisionDoesntExist_GivesNull() { using (var setup = new RepositorySetup("Dan")) { - Assert.IsNull(setup.Repository.GetRevision("1")); + Assert.That(setup.Repository.GetRevision("1"), Is.Null); } } @@ -238,7 +238,7 @@ public void EnsureRepoIdIsCorrect() using (var setup = new RepositorySetup("Dan")) { var id = setup.Repository.Identifier; - Assert.IsTrue(String.IsNullOrEmpty(id)); + Assert.That(id, Is.Null.Or.Empty); var path = setup.ProjectFolder.Combine("test.1w1"); File.WriteAllText(path, "hello"); @@ -248,7 +248,7 @@ public void EnsureRepoIdIsCorrect() setup.AddAndCheckIn(); // Need to have one commit. id = setup.Repository.Identifier; - Assert.IsFalse(String.IsNullOrEmpty(id)); + Assert.That(id, Is.Not.Null.And.Not.Empty); var results = HgRunner.Run("log -r0 --template " + "\"{node}\"", setup.Repository.PathToRepo, 10, setup.Progress); // This will probably fail, if some other version of Hg is used, @@ -264,7 +264,7 @@ public void GetRevision_RevisionDoesExist_Ok() using (var setup = new RepositorySetup("Dan")) { setup.AddAndCheckinFile("test.txt", "hello"); - Assert.IsNotNull(setup.Repository.GetRevision("0")); + Assert.That(setup.Repository.GetRevision("0"), Is.Not.Null); } } @@ -457,7 +457,7 @@ public void BackoutHead_BackingOutTheCurrentHead_LeaveUsOnTheNewHead() // var progress = new StringBuilderProgress(); // var hg = new HgRepository(Path.GetTempPath(), progress); // hg.GetTip(); -// Assert.IsTrue(progress.Text.Contains("Error")); +// Assert.That(progress.Text, Does.Contain("Error")); // } diff --git a/src/LibChorusTests/VcsDrivers/Mercurial/HistoryTests.cs b/src/LibChorusTests/VcsDrivers/Mercurial/HistoryTests.cs index 142b10083..6d24061ff 100644 --- a/src/LibChorusTests/VcsDrivers/Mercurial/HistoryTests.cs +++ b/src/LibChorusTests/VcsDrivers/Mercurial/HistoryTests.cs @@ -80,7 +80,7 @@ public void GetTip_BeforeAnySyncing_EmptyString() { using (var setup = new RepositorySetup("Dan")) { - Assert.IsNull(setup.Repository.GetTip()); + Assert.That(setup.Repository.GetTip(), Is.Null); } } diff --git a/src/LibChorusTests/VcsDrivers/Mercurial/MercurialTestUtilities.cs b/src/LibChorusTests/VcsDrivers/Mercurial/MercurialTestUtilities.cs index 4fb26436f..b572ad09c 100644 --- a/src/LibChorusTests/VcsDrivers/Mercurial/MercurialTestUtilities.cs +++ b/src/LibChorusTests/VcsDrivers/Mercurial/MercurialTestUtilities.cs @@ -4,6 +4,7 @@ using Chorus.VcsDrivers.Mercurial; using Nini.Ini; using SIL.IO; +using SIL.PlatformUtilities; namespace LibChorus.Tests.VcsDrivers.Mercurial { @@ -29,9 +30,8 @@ public void Dispose() private static void UpdateExtensions() { var extensions = new Dictionary(); -#if !MONO - extensions.Add("eol", ""); //for converting line endings on windows machines -#endif + if (!Platform.IsMono) + extensions.Add("eol", ""); //for converting line endings on windows machines extensions.Add("hgext.graphlog", ""); //for more easily readable diagnostic logs extensions.Add("convert", ""); //for catastrophic repair in case of repo corruption string fixUtfFolder = FileLocationUtilities.GetDirectoryDistributedWithApplication(false, "MercurialExtensions", "fixutf8"); @@ -61,16 +61,7 @@ public class MercurialIniHider : IDisposable public MercurialIniHider() { -//#if MONO -// var home = Environment.GetEnvironmentVariable("HOME"); -// if (home == null) -// { -// throw new ApplicationException("The HOME environment variable is not set."); -// } -// _mercurialIniFilePath = Path.Combine(home, ".hgrc"); -//#else _mercurialIniFilePath = Path.Combine(Chorus.MercurialLocation.PathToMercurialFolder, "mercurial.ini"); -//#endif _mercurialIniBackupFilePath = _mercurialIniFilePath + ".bak"; File.Copy(_mercurialIniFilePath, _mercurialIniBackupFilePath, true); } diff --git a/src/LibChorusTests/VcsDrivers/Mercurial/RepositoryTests.cs b/src/LibChorusTests/VcsDrivers/Mercurial/RepositoryTests.cs index bdba44b75..fc5f084f6 100644 --- a/src/LibChorusTests/VcsDrivers/Mercurial/RepositoryTests.cs +++ b/src/LibChorusTests/VcsDrivers/Mercurial/RepositoryTests.cs @@ -156,7 +156,7 @@ public void CloneToUsbWithoutUpdateFollowedByIdentifierDoesNotAffectHgrc() HgHighLevel.MakeCloneFromLocalToUsb(repo.ProjectFolder.Path, f.Path, new NullProgress()); var cloneRepo = new HgRepository(f.Path, new NullProgress()); var hgFolderPath = Path.Combine(f.Path, ".hg"); - Assert.IsTrue(Directory.Exists(hgFolderPath)); + Assert.That(hgFolderPath, Does.Exist); var hgrcLines = File.ReadAllLines(Path.Combine(hgFolderPath, "hgrc")); //SUT CollectionAssert.DoesNotContain(hgrcLines, "[extensions]", "extensions section created in bare clone"); diff --git a/src/LibChorusTests/VcsDrivers/Mercurial/Utf8Tests.cs b/src/LibChorusTests/VcsDrivers/Mercurial/Utf8Tests.cs index 7454357eb..0d2d3e64f 100644 --- a/src/LibChorusTests/VcsDrivers/Mercurial/Utf8Tests.cs +++ b/src/LibChorusTests/VcsDrivers/Mercurial/Utf8Tests.cs @@ -5,6 +5,7 @@ using LibChorus.TestUtilities; using NUnit.Framework; using SIL.IO; +using SIL.PlatformUtilities; using SIL.Progress; using SIL.TestUtilities; @@ -72,8 +73,8 @@ public void ChangedUtf8File_FileCanBePulledAndUpdated() } } -#if !MONO [Test] + [Platform(Exclude = "Linux")] public void Utf8ExtensionNotPresent_MercurialOperationReportsError() { using (new MercurialExtensionHider()) @@ -90,10 +91,9 @@ public void Utf8ExtensionNotPresent_MercurialOperationReportsError() //setup.ProjectFolderConfig.IncludePatterns.Add("*.wav"); //setup.AddAndCheckIn(); //setup.AssertFileDoesNotExistInRepository(utf8FilePath); - //Assert.IsTrue(setup.GetProgressString().Contains("Failed to set up extensions")); + //Assert.That(setup.GetProgressString(), Does.Contain("Failed to set up extensions")); } } -#endif [Test] public void Utf8ExtensionNotPresent_CloneLocalWithoutUpdateThrows() @@ -108,10 +108,13 @@ public void Utf8ExtensionNotPresent_CloneLocalWithoutUpdateThrows() var exception = Assert.Throws( () => setup.Repository.CloneLocalWithoutUpdate(other.ProjectFolder.Path) ); -#if !MONO - // On mono a different exception is thrown, which is fine, the rest of this test is still useful - Assert.That(exception.Message.Contains("fixutf8"), "Expected fixutf8 in:" + exception.Message); -#endif + + if (!Platform.IsMono) + { + // On mono a different exception is thrown, which is fine, the rest of this test is still useful + Assert.That(exception.Message.Contains("fixutf8"), + "Expected fixutf8 in:" + exception.Message); + } } } } @@ -137,8 +140,6 @@ public void Utf8ExtensionPresent_CloneLocalWithUpdateDoesNotHaveBogusFiles() other.AssertFileExists(utf8FilePath); string[] fileNames = Directory.GetFiles(other.ProjectFolder.Path, "*.wav"); Assert.AreEqual(1, fileNames.Length); - - //Assert.IsTrue(setup.GetProgressString().Contains()); } } @@ -166,8 +167,6 @@ public void Utf8ExtensionPresent_CloneDoesNotHaveBogusFiles() other.AssertFileExists(utf8FilePath); string[] fileNames = Directory.GetFiles(other.ProjectFolder.Path, "*.wav"); Assert.AreEqual(1, fileNames.Length); - - //Assert.IsTrue(setup.GetProgressString().Contains()); } } @@ -241,7 +240,7 @@ public void CreateOrLocate_FolderHasAccentedLetterAbeBooks_FindsIt() // Regression: http://jira.palaso.org/issues/browse/CHR-32 /* When applications are passed to windows console apps they are passed as CP1252 strings if at all possible, * failing that they are passed as UCS2. e.g. projéct would be CP1252 and ไก่ would be UCS2. - * + * * The CreateOrLocate tests did not capture this distinction, so these 'Recover' tests have been added. */ [Test] @@ -252,7 +251,7 @@ public void Recover_UnicodeProject_NoThrow() repo.Repository.RecoverFromInterruptedTransactionIfNeeded(); Assert.True(File.Exists(repo.PathToHgrc)); } - + } // Regression: http://jira.palaso.org/issues/browse/CHR-32 diff --git a/src/LibChorusTests/VcsDrivers/RepositoryAddressTests.cs b/src/LibChorusTests/VcsDrivers/RepositoryAddressTests.cs index df4ad9f70..75f07efa6 100644 --- a/src/LibChorusTests/VcsDrivers/RepositoryAddressTests.cs +++ b/src/LibChorusTests/VcsDrivers/RepositoryAddressTests.cs @@ -52,16 +52,16 @@ private static bool InvokeIsMatchingName(RepositoryInformation repoInfo, string null, null, new object[] { repoInfo, projectName }); } - [Test] - public void TestIsMatchingName() + [TestCase("1", ExpectedResult = true)] + [TestCase("2", ExpectedResult = true)] + [TestCase("3", ExpectedResult = true)] + [TestCase("54", ExpectedResult = true)] + [TestCase("NaN", ExpectedResult = false)] + public bool TestIsMatchingName(string num) { - string name = "RepoName"; - string id = "RepoID"; - foreach (string num in new List {"1", "2", "3", "54"}) - { - Assert.IsTrue(InvokeIsMatchingName(new RepositoryInformation(name + num, id), name)); - } - Assert.IsFalse(InvokeIsMatchingName(new RepositoryInformation(name + "NaN", id), name)); + const string name = "RepoName"; + const string id = "RepoID"; + return InvokeIsMatchingName(new RepositoryInformation(name + num, id), name); } // Allows us to access and test the private method @@ -84,33 +84,28 @@ public void TestTryGetBestRepoMatch() string matchName, warningMessage; // Case 1: Repo name and ID both match - Assert.IsTrue(InvokeTryGetBestRepoMatch( - _normalRepo.RepoID, _normalRepo.RepoName, out matchName, out warningMessage)); + Assert.That(InvokeTryGetBestRepoMatch(_normalRepo.RepoID, _normalRepo.RepoName, out matchName, out warningMessage), Is.True); Assert.AreEqual(_normalRepo.RepoName, matchName); - Assert.IsNull(warningMessage); + Assert.That(warningMessage, Is.Null); // Case 2: Repo ID matches, but name does not - Assert.IsTrue(InvokeTryGetBestRepoMatch( - _normalRepo.RepoID, "DifferentProjectName", out matchName, out warningMessage)); + Assert.That(InvokeTryGetBestRepoMatch(_normalRepo.RepoID, "DifferentProjectName", out matchName, out warningMessage), Is.True); Assert.AreEqual(_normalRepo.RepoName, matchName); - Assert.IsNull(warningMessage); + Assert.That(warningMessage, Is.Null); // Case 3: There is a new repo with the correct name - Assert.IsTrue(InvokeTryGetBestRepoMatch( - "AnyIDWillDo", _newRepo.RepoName, out matchName, out warningMessage)); + Assert.That(InvokeTryGetBestRepoMatch("AnyIDWillDo", _newRepo.RepoName, out matchName, out warningMessage), Is.True); Assert.AreEqual(_newRepo.RepoName, matchName); - Assert.IsNull(warningMessage); + Assert.That(warningMessage, Is.Null); // Case 4: There is a new repo with a properly-derived name - Assert.IsTrue(InvokeTryGetBestRepoMatch( - "AnyIDWillDo", _duplicateRepo.RepoName, out matchName, out warningMessage)); + Assert.That(InvokeTryGetBestRepoMatch("AnyIDWillDo", _duplicateRepo.RepoName, out matchName, out warningMessage), Is.True); Assert.AreEqual(_newRepo.RepoName, matchName); - Assert.IsNotNullOrEmpty(warningMessage); + Assert.That(warningMessage, Is.Not.Null.Or.Empty); // Case 5: There is no matching repo - Assert.IsFalse(InvokeTryGetBestRepoMatch( - "DoesNotExist", "DoesNotExist", out matchName, out warningMessage)); - Assert.IsNotNullOrEmpty(warningMessage); + Assert.That(InvokeTryGetBestRepoMatch("DoesNotExist", "DoesNotExist", out matchName, out warningMessage), Is.False); + Assert.That(warningMessage, Is.Not.Null.Or.Empty); } [Test] diff --git a/src/LibChorusTests/app.config b/src/LibChorusTests/app.config new file mode 100644 index 000000000..6f4f0d033 --- /dev/null +++ b/src/LibChorusTests/app.config @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/LibChorusTests/merge/XmlLogMergeEventListenerTests.cs b/src/LibChorusTests/merge/XmlLogMergeEventListenerTests.cs index 6eedc427a..19ecdb278 100644 --- a/src/LibChorusTests/merge/XmlLogMergeEventListenerTests.cs +++ b/src/LibChorusTests/merge/XmlLogMergeEventListenerTests.cs @@ -94,7 +94,7 @@ public void FileDidNotExist_NoConflicts_DoesNotCreatesEmptyNotesFile() using (ChorusNotesMergeEventListener log = new ChorusNotesMergeEventListener(tempFile)) { } - Assert.IsFalse(File.Exists(tempFile)); + Assert.That(tempFile, Does.Not.Exist); } } diff --git a/src/LibChorusTests/merge/xml/FindByKeyAttributeTests.cs b/src/LibChorusTests/merge/xml/FindByKeyAttributeTests.cs index f4eff2bda..31114d9fe 100644 --- a/src/LibChorusTests/merge/xml/FindByKeyAttributeTests.cs +++ b/src/LibChorusTests/merge/xml/FindByKeyAttributeTests.cs @@ -59,7 +59,7 @@ public void GetNodeToMerge_WithoutKeyAttr_ReturnsNull() var finder = new FindByKeyAttribute("id"); var node = doc1.SelectSingleNode("//b"); - Assert.IsNull(finder.GetNodeToMerge(node, doc1.DocumentElement, SetFromChildren.Get(doc1.DocumentElement))); + Assert.That(finder.GetNodeToMerge(node, doc1.DocumentElement, SetFromChildren.Get(doc1.DocumentElement)), Is.Null); } [Test] diff --git a/src/LibChorusTests/merge/xml/generic/ConflictIOTest.cs b/src/LibChorusTests/merge/xml/generic/ConflictIOTest.cs index c2bffeaa0..cf6c567c7 100644 --- a/src/LibChorusTests/merge/xml/generic/ConflictIOTest.cs +++ b/src/LibChorusTests/merge/xml/generic/ConflictIOTest.cs @@ -82,7 +82,7 @@ public void ConflictWithInvalidUtf8DetailsWorks() var annotationXml = XmlTestHelper.WriteConflictAnnotation(conflict); Conflict.RegisterContextClass(typeof(DemoConflict)); var regurgitated = Conflict.CreateFromChorusNotesAnnotation(annotationXml); - Assert.That(regurgitated.HtmlDetails, Is.StringContaining("Badegg"));// the /uDB80 should have dropped + Assert.That(regurgitated.HtmlDetails, Does.Contain("Badegg"));// the /uDB80 should have dropped } [Test] @@ -140,7 +140,7 @@ public void CreateFromConflictElement_ProducesDifferentConflictReports() var conflict2 = Conflict.CreateFromConflictElement(node2); //verify - Assert.IsFalse(ReferenceEquals(conflict1, conflict2), "Two different conflicts of the same type but different istances."); + Assert.That(ReferenceEquals(conflict1, conflict2), Is.False, "Two different conflicts of the same type but different istances."); Assert.AreNotEqual(conflict1.Guid, conflict2.Guid); } } diff --git a/src/LibChorusTests/merge/xml/generic/ConflictTests.cs b/src/LibChorusTests/merge/xml/generic/ConflictTests.cs index f4057adfa..c6ce49be6 100644 --- a/src/LibChorusTests/merge/xml/generic/ConflictTests.cs +++ b/src/LibChorusTests/merge/xml/generic/ConflictTests.cs @@ -10,12 +10,12 @@ public class ConflictTests public void EnsureConflictClassHasContext() { var randomConflict = new MergeWarning(string.Empty); - Assert.IsNotNull(randomConflict.Context); + Assert.That(randomConflict.Context, Is.Not.Null); Assert.IsInstanceOf(randomConflict.Context); // Try to set it to null. randomConflict.Context = null; - Assert.IsNotNull(randomConflict.Context); + Assert.That(randomConflict.Context, Is.Not.Null); Assert.IsInstanceOf(randomConflict.Context); } } diff --git a/src/LibChorusTests/merge/xml/generic/ElementStrategyTests.cs b/src/LibChorusTests/merge/xml/generic/ElementStrategyTests.cs index d8a5c2174..b2c826631 100644 --- a/src/LibChorusTests/merge/xml/generic/ElementStrategyTests.cs +++ b/src/LibChorusTests/merge/xml/generic/ElementStrategyTests.cs @@ -15,13 +15,13 @@ public void DefaultNumberOfChildren_Is_NumberOfChildrenAllowed_ZeroOrMore() [Test] public void DefaultIsImmutable_Is_False() { - Assert.IsFalse(new ElementStrategy(false).IsImmutable); + Assert.That(new ElementStrategy(false).IsImmutable, Is.False); } [Test] public void DefaultIsAtomic_Is_False() { - Assert.IsFalse(new ElementStrategy(false).IsAtomic); + Assert.That(new ElementStrategy(false).IsAtomic, Is.False); } [Test] diff --git a/src/LibChorusTests/merge/xml/generic/FindNodeToMergeTests.cs b/src/LibChorusTests/merge/xml/generic/FindNodeToMergeTests.cs index c30f19773..017b46fc6 100644 --- a/src/LibChorusTests/merge/xml/generic/FindNodeToMergeTests.cs +++ b/src/LibChorusTests/merge/xml/generic/FindNodeToMergeTests.cs @@ -2,6 +2,7 @@ using System.Xml; using Chorus.merge.xml.generic; using NUnit.Framework; +using SIL.PlatformUtilities; namespace LibChorus.Tests.merge.xml.generic { @@ -55,16 +56,14 @@ public void MultipleAttributeKeyedElement_WithDoubleAndSingleQuoteInAttribute_Is otherDoc.LoadXml(otherXml); var nodeMatcher = new FindByMultipleKeyAttributes(new List { "name", "class" }); -#if !MONO - if (otherDoc.DocumentElement != null) - { - var acceptableTargets = new HashSet(); - foreach (XmlNode node in otherDoc.DocumentElement.ChildNodes) - acceptableTargets.Add(node); - var result = nodeMatcher.GetNodeToMerge(nodeToMatch, otherDoc.DocumentElement, acceptableTargets); - Assert.AreSame(otherDoc.DocumentElement.ChildNodes[1], result); - } -#endif + if (Platform.IsMono || otherDoc.DocumentElement == null) + return; + + var acceptableTargets = new HashSet(); + foreach (XmlNode node in otherDoc.DocumentElement.ChildNodes) + acceptableTargets.Add(node); + var result = nodeMatcher.GetNodeToMerge(nodeToMatch, otherDoc.DocumentElement, acceptableTargets); + Assert.AreSame(otherDoc.DocumentElement.ChildNodes[1], result); } [Test] @@ -91,7 +90,8 @@ public void CanFindByMatchingAttributeNames() var nodeMatcher = new FindByMatchingAttributeNames(new HashSet { "xmlns:palaso" }); Assert.AreSame(otherDoc.DocumentElement.ChildNodes[1], - nodeMatcher.GetNodeToMerge(nodeToMatch, otherDoc.DocumentElement, SetFromChildren.Get(otherDoc.DocumentElement))); + nodeMatcher.GetNodeToMerge(nodeToMatch, otherDoc.DocumentElement, + SetFromChildren.Get(otherDoc.DocumentElement))); } [Test] diff --git a/src/LibChorusTests/merge/xml/generic/ImmutableElementMergeServiceTests.cs b/src/LibChorusTests/merge/xml/generic/ImmutableElementMergeServiceTests.cs index 6520a2399..7d71cb962 100644 --- a/src/LibChorusTests/merge/xml/generic/ImmutableElementMergeServiceTests.cs +++ b/src/LibChorusTests/merge/xml/generic/ImmutableElementMergeServiceTests.cs @@ -18,7 +18,7 @@ public void AllElementsNullCausesNoTrouble() { XmlNode ours; XmlNode theirs; - Assert.IsNull(DoMerge(null, null, null, new NullMergeSituation(), new ListenerForUnitTests(), out ours, out theirs)); + Assert.That(DoMerge(null, null, null, new NullMergeSituation(), new ListenerForUnitTests(), out ours, out theirs), Is.Null); } [Test] @@ -28,7 +28,7 @@ public void AncestorNull_OursNull_TheirsNotNull_HasChangeReport_AndTheirsIsKeptI XmlNode ours; XmlNode theirs; var resultNode = DoMerge(null, null, "", new NullMergeSituation(), listener, out ours, out theirs); - Assert.IsNotNull(resultNode); + Assert.That(resultNode, Is.Not.Null); Assert.AreEqual("", resultNode.OuterXml); listener.AssertExpectedChangesCount(1); listener.AssertFirstChangeType(); @@ -45,7 +45,7 @@ public void AncestorNull_OursNotNull_TheirsNull_HasChangeReport_AndOursIsKeptInM XmlNode ours; XmlNode theirs; var resultNode = DoMerge(null, "", null, new NullMergeSituation(), listener, out ours, out theirs); - Assert.IsNotNull(resultNode); + Assert.That(resultNode, Is.Not.Null); Assert.AreEqual("", resultNode.OuterXml); listener.AssertExpectedChangesCount(1); listener.AssertFirstChangeType(); @@ -61,7 +61,7 @@ public void AncestorNull_BothAddSameElementAndContent_HasChangeReport() XmlNode ours; XmlNode theirs; var resultNode = DoMerge(null, "", "", new NullMergeSituation(), listener, out ours, out theirs); - Assert.IsNotNull(resultNode); + Assert.That(resultNode, Is.Not.Null); Assert.AreEqual("", resultNode.OuterXml); listener.AssertExpectedChangesCount(1); listener.AssertFirstChangeType(); @@ -77,7 +77,7 @@ public void BothAdded_ButNotTheSame_HasConflictForWeWin_OurChangeIsKept() XmlNode ours; XmlNode theirs; var resultNode = DoMerge(null, "", "", new NullMergeSituation(), listener, out ours, out theirs); - Assert.IsNotNull(resultNode); + Assert.That(resultNode, Is.Not.Null); Assert.AreEqual("", resultNode.OuterXml); listener.AssertExpectedChangesCount(0); listener.AssertExpectedConflictCount(1); @@ -93,7 +93,7 @@ public void BothAdded_ButNotTheSame_HasConflictForTheyWin_TheirChangeIsKept() XmlNode ours; XmlNode theirs; var resultNode = DoMerge(null, "", "", new NullMergeSituationTheyWin(), listener, out ours, out theirs); - Assert.IsNotNull(resultNode); + Assert.That(resultNode, Is.Not.Null); Assert.AreEqual("", resultNode.OuterXml); listener.AssertExpectedChangesCount(0); listener.AssertExpectedConflictCount(1); @@ -110,9 +110,9 @@ public void BothDeletedElement_HasChangeReport() XmlNode ours; XmlNode theirs; var resultNode = DoMerge("", null, null, new NullMergeSituation(), listener, out ours, out theirs); - Assert.IsNull(resultNode); - Assert.IsNull(ours); - Assert.IsNull(theirs); + Assert.That(resultNode, Is.Null); + Assert.That(ours, Is.Null); + Assert.That(theirs, Is.Null); listener.AssertExpectedChangesCount(1); listener.AssertFirstChangeType(); listener.AssertExpectedConflictCount(0); @@ -125,9 +125,9 @@ public void WeDeleted_HasChangeReport() XmlNode ours; XmlNode theirs; var resultNode = DoMerge("", null, "", new NullMergeSituation(), listener, out ours, out theirs); - Assert.IsNull(resultNode); - Assert.IsNull(ours); - Assert.IsNotNull(theirs); + Assert.That(resultNode, Is.Null); + Assert.That(ours, Is.Null); + Assert.That(theirs, Is.Not.Null); listener.AssertExpectedChangesCount(1); listener.AssertFirstChangeType(); listener.AssertExpectedConflictCount(0); @@ -140,9 +140,9 @@ public void TheyDeleted_HasChangeReport() XmlNode ours; XmlNode theirs; var resultNode = DoMerge("", "", null, new NullMergeSituation(), listener, out ours, out theirs); - Assert.IsNull(resultNode); - Assert.IsNull(ours); - Assert.IsNull(theirs); + Assert.That(resultNode, Is.Null); + Assert.That(ours, Is.Null); + Assert.That(theirs, Is.Null); listener.AssertExpectedChangesCount(1); listener.AssertFirstChangeType(); listener.AssertExpectedConflictCount(0); @@ -155,10 +155,10 @@ public void WeMadeIllegalChange_ButAncestorHasBeenRetored_HasNoReports() XmlNode ours; XmlNode theirs; var resultNode = DoMerge("", "", "", new NullMergeSituation(), listener, out ours, out theirs); - Assert.IsNotNull(resultNode); + Assert.That(resultNode, Is.Not.Null); Assert.AreEqual("", resultNode.OuterXml); - Assert.IsNotNull(ours); - Assert.IsNotNull(theirs); + Assert.That(ours, Is.Not.Null); + Assert.That(theirs, Is.Not.Null); Assert.AreSame(resultNode, ours); listener.AssertExpectedChangesCount(0); listener.AssertExpectedConflictCount(0); diff --git a/src/LibChorusTests/merge/xml/generic/MergeAtomicElementServiceTests.cs b/src/LibChorusTests/merge/xml/generic/MergeAtomicElementServiceTests.cs index e414a1fe4..76378a2fa 100644 --- a/src/LibChorusTests/merge/xml/generic/MergeAtomicElementServiceTests.cs +++ b/src/LibChorusTests/merge/xml/generic/MergeAtomicElementServiceTests.cs @@ -151,7 +151,7 @@ private static XmlMerger GetMerger(out ListenerForUnitTests listener, bool isAto public void DefaultIsFalse() { var elementStrategy = new ElementStrategy(false); - Assert.IsFalse(elementStrategy.IsAtomic); + Assert.That(elementStrategy.IsAtomic, Is.False); } [Test] @@ -161,7 +161,7 @@ public void CanSetToTrue() { IsAtomic = true }; - Assert.IsTrue(elementStrategy.IsAtomic); + Assert.That(elementStrategy.IsAtomic, Is.True); } [Test] diff --git a/src/LibChorusTests/merge/xml/generic/XmlMergerTests.cs b/src/LibChorusTests/merge/xml/generic/XmlMergerTests.cs index e496102e6..3d8161f2a 100644 --- a/src/LibChorusTests/merge/xml/generic/XmlMergerTests.cs +++ b/src/LibChorusTests/merge/xml/generic/XmlMergerTests.cs @@ -446,13 +446,13 @@ public string HtmlContextStyles(XmlNode mergeElement) private static void CheckEditVsDeleteDetails(string html) { - Assert.That(html, Is.StringContaining("changes:")); - Assert.That(html, Is.Not.StringContaining("version"), + Assert.That(html, Does.Contain("changes:")); + Assert.That(html, Does.Not.Contain("version"), "This appears if we try to do HTML diffs on the representation of "); Assert.That(html.IndexOf("changes", StringComparison.InvariantCulture), Is.EqualTo(html.LastIndexOf("changes", StringComparison.InvariantCulture)), "On EditVsDelete, we should display only one set of changes in details"); - Assert.That(html, Is.StringContaining("my html"), "Should have used the custom HTML generator we configured for B"); + Assert.That(html, Does.Contain("my html"), "Should have used the custom HTML generator we configured for B"); } [Test] @@ -591,7 +591,7 @@ public void OneAddedSomethingDeep() "; - Assert.IsFalse(XmlUtilities.AreXmlElementsEqual(red, blue)); + Assert.That(XmlUtilities.AreXmlElementsEqual(red, blue), Is.False); CheckBothWaysNoConflicts(red, blue, ancestor, "a/b[@key='one']/c[text()='first']"); @@ -1369,7 +1369,7 @@ public void AncestorIsEmptyFileAndBothAddedSameThingHasOneChangeReport() EventListener = listener }; var result = merger.MergeFiles(ours.Path, theirs.Path, ancestor.Path); - Assert.IsNotNull(result); + Assert.That(result, Is.Not.Null); listener.AssertExpectedChangesCount(1); listener.AssertFirstChangeType(); listener.AssertExpectedConflictCount(0); @@ -1395,7 +1395,7 @@ public void AncestorAndOursAreEmptyFileAndTheyAddedHasOneChangeReport() EventListener = listener }; var result = merger.MergeFiles(ours.Path, theirs.Path, ancestor.Path); - Assert.IsNotNull(result); + Assert.That(result, Is.Not.Null); listener.AssertExpectedChangesCount(1); listener.AssertFirstChangeType(); listener.AssertExpectedConflictCount(0); @@ -1421,7 +1421,7 @@ public void AncestorAndTheirsAreEmptyFileAndWeAddedHasOneChangeReport() EventListener = listener }; var result = merger.MergeFiles(ours.Path, theirs.Path, ancestor.Path); - Assert.IsNotNull(result); + Assert.That(result, Is.Not.Null); listener.AssertExpectedChangesCount(1); listener.AssertFirstChangeType(); listener.AssertExpectedConflictCount(0); @@ -1447,11 +1447,11 @@ public void AncestorIsEmptyFileAndWeBothAddedDifferentContentHasOneConflictRepor EventListener = listener }; var result = merger.MergeFiles(ours.Path, theirs.Path, ancestor.Path); - Assert.IsNotNull(result); + Assert.That(result, Is.Not.Null); listener.AssertExpectedChangesCount(0); listener.AssertExpectedConflictCount(1); listener.AssertFirstConflictType(); - Assert.IsTrue(result.MergedNode.OuterXml.Contains("our addition")); + Assert.That(result.MergedNode.OuterXml, Does.Contain("our addition")); } } @@ -1474,11 +1474,11 @@ public void AncestorIsEmptyFileAndWeBothAddedDifferentContentWithTheyWinHasOneCo EventListener = listener }; var result = merger.MergeFiles(ours.Path, theirs.Path, ancestor.Path); - Assert.IsNotNull(result); + Assert.That(result, Is.Not.Null); listener.AssertExpectedChangesCount(0); listener.AssertExpectedConflictCount(1); listener.AssertFirstConflictType(); - Assert.IsTrue(result.MergedNode.OuterXml.Contains("their addition")); + Assert.That(result.MergedNode.OuterXml, Does.Contain("their addition")); } } @@ -1501,11 +1501,11 @@ public void AncestorHasDataAndWeBothDeletedFileHasOneChangeReport() EventListener = listener }; var result = merger.MergeFiles(ours.Path, theirs.Path, ancestor.Path); - Assert.IsNotNull(result); + Assert.That(result, Is.Not.Null); listener.AssertExpectedChangesCount(1); listener.AssertFirstChangeType(); listener.AssertExpectedConflictCount(0); - Assert.IsNull(result.MergedNode); + Assert.That(result.MergedNode, Is.Null); } } @@ -1528,11 +1528,11 @@ public void WeDeletedFileTheyDidNothingHasOneChangeReport() EventListener = listener }; var result = merger.MergeFiles(ours.Path, theirs.Path, ancestor.Path); - Assert.IsNotNull(result); + Assert.That(result, Is.Not.Null); listener.AssertExpectedChangesCount(1); listener.AssertFirstChangeType(); listener.AssertExpectedConflictCount(0); - Assert.IsNull(result.MergedNode); + Assert.That(result.MergedNode, Is.Null); } } @@ -1555,11 +1555,11 @@ public void TheyChangedWeDeletedFileHasOneConflictReport() EventListener = listener }; var result = merger.MergeFiles(ours.Path, theirs.Path, ancestor.Path); - Assert.IsNotNull(result); + Assert.That(result, Is.Not.Null); listener.AssertExpectedChangesCount(0); listener.AssertExpectedConflictCount(1); listener.AssertFirstConflictType(); - Assert.IsTrue(result.MergedNode.OuterXml.Contains("their change")); + Assert.That(result.MergedNode.OuterXml, Does.Contain("their change")); } } @@ -1582,11 +1582,11 @@ public void TheyDeletedFileWeDidNothingHasOneChangeReport() EventListener = listener }; var result = merger.MergeFiles(ours.Path, theirs.Path, ancestor.Path); - Assert.IsNotNull(result); + Assert.That(result, Is.Not.Null); listener.AssertExpectedChangesCount(1); listener.AssertFirstChangeType(); listener.AssertExpectedConflictCount(0); - Assert.IsNull(result.MergedNode); + Assert.That(result.MergedNode, Is.Null); } } @@ -1609,11 +1609,11 @@ public void WeChangedTheyDeletedFileHasOneConflictReport() EventListener = listener }; var result = merger.MergeFiles(ours.Path, theirs.Path, ancestor.Path); - Assert.IsNotNull(result); + Assert.That(result, Is.Not.Null); listener.AssertExpectedChangesCount(0); listener.AssertExpectedConflictCount(1); listener.AssertFirstConflictType(); - Assert.IsTrue(result.MergedNode.OuterXml.Contains("our change")); + Assert.That(result.MergedNode.OuterXml, Does.Contain("our change")); } } } diff --git a/src/LibChorusTests/merge/xml/lift/FileLevelMergeTests.cs b/src/LibChorusTests/merge/xml/lift/FileLevelMergeTests.cs index 8bb78dab2..5dd497136 100644 --- a/src/LibChorusTests/merge/xml/lift/FileLevelMergeTests.cs +++ b/src/LibChorusTests/merge/xml/lift/FileLevelMergeTests.cs @@ -95,7 +95,7 @@ public void ResultIsUtf8() "header", "entry", "guid"); var result = File.ReadAllText(mergeOrder.pathToOurs); - Assert.IsTrue(result.ToLower().Contains("utf-8")); + Assert.That(result, Does.Contain("utf-8").IgnoreCase); } } @@ -499,7 +499,7 @@ public void OldStyle_DoomedByUsEditedByThem_HasOneConflict() "header", "entry", "guid"); var result = File.ReadAllText(mergeOrder.pathToOurs); - Assert.IsTrue(result.ToLower().Contains("utf-8")); + Assert.That(result, Does.Contain("utf-8").IgnoreCase); } listener.AssertExpectedChangesCount(0); listener.AssertExpectedConflictCount(1); @@ -570,7 +570,7 @@ public void OldStyle_DoomedByThemEditedByUs_HasOneConflict() "header", "entry", "guid"); var result = File.ReadAllText(mergeOrder.pathToOurs); - Assert.IsTrue(result.ToLower().Contains("utf-8")); + Assert.That(result, Does.Contain("utf-8").IgnoreCase); } listener.AssertExpectedChangesCount(0); listener.AssertExpectedConflictCount(1); @@ -640,7 +640,7 @@ public void NewStyle_DoomedByUsEditedByThem_HasOneConflict() "header", "entry", "guid"); var result = File.ReadAllText(mergeOrder.pathToOurs); - Assert.IsTrue(result.ToLower().Contains("utf-8")); + Assert.That(result, Does.Contain("utf-8").IgnoreCase); } listener.AssertExpectedChangesCount(0); listener.AssertExpectedConflictCount(1); @@ -709,7 +709,7 @@ public void NewStyle_DoomedByThemEditedByUs_HasOneConflict() "header", "entry", "guid"); var result = File.ReadAllText(mergeOrder.pathToOurs); - Assert.IsTrue(result.ToLower().Contains("utf-8")); + Assert.That(result, Does.Contain("utf-8").IgnoreCase); } listener.AssertExpectedChangesCount(0); listener.AssertExpectedConflictCount(1); @@ -772,7 +772,7 @@ public void DoomedByUs_NewWay_AndByThem_OldWay_HasNoChangeReports() "header", "entry", "guid"); var result = File.ReadAllText(mergeOrder.pathToOurs); - Assert.IsTrue(result.ToLower().Contains("utf-8")); + Assert.That(result, Does.Contain("utf-8").IgnoreCase); } listener.AssertExpectedConflictCount(0); listener.AssertExpectedChangesCount(0); @@ -834,7 +834,7 @@ public void DoomedByUs_OldWay_AndByThem_NewWay_HasNoChangeReports() "header", "entry", "guid"); var result = File.ReadAllText(mergeOrder.pathToOurs); - Assert.IsTrue(result.ToLower().Contains("utf-8")); + Assert.That(result, Does.Contain("utf-8").IgnoreCase); } listener.AssertExpectedConflictCount(0); listener.AssertExpectedChangesCount(0); @@ -894,9 +894,9 @@ public void BothAddedHeaderButWithDifferentContentInEach() "entry", "guid"); var result = File.ReadAllText(mergeOrder.pathToOurs); - Assert.IsTrue(result.Contains("
")); - Assert.IsTrue(result.Contains("")); - Assert.IsTrue(result.Contains("")); + Assert.That(result, Does.Contain("
")); + Assert.That(result, Does.Contain("")); + Assert.That(result, Does.Contain("")); listener.AssertExpectedChangesCount(2); } } @@ -929,7 +929,7 @@ public void WinnerEditedLoserDidNothing() "header", "entry", "guid"); var result = File.ReadAllText(mergeOrder.pathToOurs); - Assert.IsTrue(result.Contains("form alpha")); + Assert.That(result, Does.Contain("form alpha")); listener.AssertExpectedChangesCount(0); } } @@ -962,7 +962,7 @@ public void LoserEditedWinnerDidNothing() "header", "entry", "guid"); var result = File.ReadAllText(mergeOrder.pathToOurs); - Assert.IsTrue(result.Contains("form beta")); + Assert.That(result, Does.Contain("form beta")); listener.AssertExpectedChangesCount(0); } } diff --git a/src/LibChorusTests/merge/xml/lift/LexEntryMergingTests.cs b/src/LibChorusTests/merge/xml/lift/LexEntryMergingTests.cs index 12ab90563..56d7f3f70 100644 --- a/src/LibChorusTests/merge/xml/lift/LexEntryMergingTests.cs +++ b/src/LibChorusTests/merge/xml/lift/LexEntryMergingTests.cs @@ -137,7 +137,7 @@ public void Merge_EditAndDeleteEntry_GeneratesConflictWithContext() var result = File.ReadAllText(mergeOrder.pathToOurs); var conflict = listener.Conflicts[0]; Assert.That(conflict, Is.InstanceOf()); - Assert.That(conflict.HtmlDetails, Is.StringContaining("my silly context"), "merger should have used the context generator to make the html details"); + Assert.That(conflict.HtmlDetails, Does.Contain("my silly context"), "merger should have used the context generator to make the html details"); Assert.That(conflict.HtmlDetails.IndexOf("my silly context"), Is.EqualTo(conflict.HtmlDetails.LastIndexOf("my silly context")), "since one change is a delete, the details should only be present once"); @@ -194,7 +194,7 @@ public void Merge_DeleteAndEditEntry_GeneratesConflictWithContext() var result = File.ReadAllText(mergeOrder.pathToOurs); var conflict = listener.Conflicts[0]; Assert.That(conflict, Is.InstanceOf()); - Assert.That(conflict.HtmlDetails, Is.StringContaining("my silly context"), "merger should have used the context generator to make the html details"); + Assert.That(conflict.HtmlDetails, Does.Contain("my silly context"), "merger should have used the context generator to make the html details"); Assert.That(conflict.HtmlDetails.IndexOf("my silly context"), Is.EqualTo(conflict.HtmlDetails.LastIndexOf("my silly context")), "since one change is a delete, the details should only be present once"); diff --git a/src/LibChorusTests/merge/xml/lift/MultiTextMergingTests.cs b/src/LibChorusTests/merge/xml/lift/MultiTextMergingTests.cs index b8f63362e..5c78a6b80 100644 --- a/src/LibChorusTests/merge/xml/lift/MultiTextMergingTests.cs +++ b/src/LibChorusTests/merge/xml/lift/MultiTextMergingTests.cs @@ -32,8 +32,8 @@ public void ConvertBogusElementToTextElementInLiftFile() XmlMergeService.RemoveAmbiguousChildNodes = true; var result = XmlMergeService.RemoveAmbiguousChildren(new ListenerForUnitTests(), new MergeStrategies(), data, "some.lift"); XmlMergeService.RemoveAmbiguousChildNodes = originalValue; - Assert.IsFalse(result.Contains("first"), "Still has bogus element."); - Assert.IsTrue(result.Contains("myStuff"), "Converted element is not present."); + Assert.That(result, Does.Not.Contain("first"), "Still has bogus element."); + Assert.That(result, Does.Contain("myStuff"), "Converted element is not present."); } [Test] @@ -55,8 +55,8 @@ public void ConvertBogusElementToTextElementInLiftRangesFile() doc.LoadXml(data); var results = XmlMergeService.RemoveAmbiguousChildren(new ListenerForUnitTests(), new MergeStrategies(), data, "some.lift-ranges"); XmlMergeService.RemoveAmbiguousChildNodes = originalValue; - Assert.IsFalse(results.Contains("first"), "Still has bogus element."); - Assert.IsTrue(results.Contains("myStuff"), "Converted element is not present."); + Assert.That(results, Does.Not.Contain("first"), "Still has bogus element."); + Assert.That(results, Does.Contain("myStuff"), "Converted element is not present."); } [Test] @@ -81,8 +81,8 @@ public void SkipConvertingElementToTextElementInAnotherFile() doc.LoadXml(data); XmlMergeService.RemoveAmbiguousChildren(new ListenerForUnitTests(), new MergeStrategies(), doc.DocumentElement); XmlMergeService.RemoveAmbiguousChildNodes = originalValue; - Assert.IsFalse(doc.DocumentElement.OuterXml.Contains("myStuff"), "Converted element to , but should not have."); - Assert.IsTrue(doc.DocumentElement.OuterXml.Contains("myStuff"), "Element went away, but should have been present."); + Assert.That(doc.DocumentElement.OuterXml, Does.Not.Contain("myStuff"), "Converted element to , but should not have."); + Assert.That(doc.DocumentElement.OuterXml, Does.Contain("myStuff"), "Element went away, but should have been present."); } /* [Test] @@ -188,7 +188,7 @@ public void MergeMultiTextNodes_OnePutSomethingInPreviouslyEmptyForm() "; - Assert.IsFalse(Utilities.AreXmlElementsEqual(red, blue)); + Assert.That(Utilities.AreXmlElementsEqual(red, blue), Is.False); CheckBothWays(red, blue, ancestor, "lexical-unit/form[@lang='one']/text[text()='first']"); diff --git a/src/LibChorusTests/merge/xml/lift/ValidationTests.cs b/src/LibChorusTests/merge/xml/lift/ValidationTests.cs index b7785eef3..9d1a3e752 100644 --- a/src/LibChorusTests/merge/xml/lift/ValidationTests.cs +++ b/src/LibChorusTests/merge/xml/lift/ValidationTests.cs @@ -12,11 +12,11 @@ public class ValidationTests public void CanValidateFile_AcceptsCorrectSet() { var handler = new LiftFileHandler(); - Assert.IsTrue(handler.CanValidateFile("foo.lift")); - Assert.IsTrue(handler.CanValidateFile("foo.LiFt")); - Assert.IsFalse(handler.CanValidateFile("foo.WeSayConfig")); - Assert.IsFalse(handler.CanValidateFile("foo.xml")); - Assert.IsFalse(handler.CanValidateFile("foo.abc")); + Assert.That(handler.CanValidateFile("foo.lift"), Is.True); + Assert.That(handler.CanValidateFile("foo.LiFt"), Is.True); + Assert.That(handler.CanValidateFile("foo.WeSayConfig"), Is.False); + Assert.That(handler.CanValidateFile("foo.xml"), Is.False); + Assert.That(handler.CanValidateFile("foo.abc"), Is.False); } [Test] @@ -26,7 +26,7 @@ public void ValidateFile_SimpleLift_ReturnsNull() using(var file = new TempFile("")) { var result = handler.ValidateFile(file.Path, new ConsoleProgress()); - Assert.IsNull(result); + Assert.That(result, Is.Null); } } @@ -37,7 +37,7 @@ public void ValidateFile_IllFormedXml_ReturnsProblem() using (var file = new TempFile("")) { var result = handler.ValidateFile(file.Path, new ConsoleProgress()); - Assert.IsNotNull(result); + Assert.That(result, Is.Not.Null); } } @@ -48,7 +48,7 @@ public void ValidateFile_BadLift_ReturnsProblem() using (var file = new TempFile("")) { var result = handler.ValidateFile(file.Path, new ConsoleProgress()); - Assert.IsNotNull(result); + Assert.That(result, Is.Not.Null); } } } diff --git a/src/LibChorusTests/notes/AnnotationRepositoryTests.cs b/src/LibChorusTests/notes/AnnotationRepositoryTests.cs index f1ee68d8e..7d3307f62 100644 --- a/src/LibChorusTests/notes/AnnotationRepositoryTests.cs +++ b/src/LibChorusTests/notes/AnnotationRepositoryTests.cs @@ -35,7 +35,7 @@ public void FromPath_DoesntExistYet_Creates() File.Delete(f.Path); var repo = AnnotationRepository.FromFile("id", f.Path, new ConsoleProgress()); repo.Save(new ConsoleProgress()); - Assert.IsTrue(File.Exists(f.Path)); + Assert.That(f.Path, Does.Exist); } } @@ -347,9 +347,9 @@ public void SaveAndLoad_10KRecords_CompletesQuickly() { Console.WriteLine("Building File..."); var r = AnnotationRepository.FromFile("id", f.Path, new NullProgress()); - for (int i = 0; i < 10000; i++) + for (var i = 0; i < 10000; i++) { - var annotation = new Annotation("question", string.Format("nowhere://blah?id={0}", Guid.NewGuid().ToString()), f.Path); + var annotation = new Annotation("question", $"nowhere://blah?id={Guid.NewGuid().ToString()}", f.Path); r.AddAnnotation(annotation); annotation.AddMessage("test", "open", "blah blah"); } @@ -358,16 +358,16 @@ public void SaveAndLoad_10KRecords_CompletesQuickly() w.Start(); r.Save(new NullProgress()); w.Stop(); - Console.WriteLine("Elapsed Time:"+w.ElapsedMilliseconds.ToString()+" milliseconds"); - Assert.IsTrue(w.ElapsedMilliseconds < 250); //it's around 70 on my laptop, and around 225 on mono desktop + Console.WriteLine($"Elapsed Time:{w.ElapsedMilliseconds} milliseconds"); + Assert.That(w.ElapsedMilliseconds, Is.LessThan(250)); //it's around 70 on my laptop, and around 225 on mono desktop w.Reset(); Console.WriteLine("Reading Large File..."); w.Start(); var rToRead = AnnotationRepository.FromFile("id", f.Path, new NullProgress()); w.Stop(); - Console.WriteLine("Elapsed Time:"+w.ElapsedMilliseconds.ToString()+" milliseconds"); - Assert.IsTrue(w.ElapsedMilliseconds < 1000); //it's around 240 on my laptop, and around 800 on mono desktop + Console.WriteLine($"Elapsed Time:{w.ElapsedMilliseconds} milliseconds"); + Assert.That(w.ElapsedMilliseconds, Is.LessThan(1000)); //it's around 240 on my laptop, and around 800 on mono desktop } } diff --git a/src/LibChorusTests/notes/MessageTests.cs b/src/LibChorusTests/notes/MessageTests.cs index 5c715c4aa..f87071d69 100644 --- a/src/LibChorusTests/notes/MessageTests.cs +++ b/src/LibChorusTests/notes/MessageTests.cs @@ -73,14 +73,14 @@ public void HtmlText_HasOnlyData_GetEmptyString() public void Message_AuthorWithXmlChars_DoesNotThrow() { var msg = new Message("Jack & Jill';<", "status", "contents"); - Assert.IsNotNullOrEmpty(msg.Author); + Assert.That(msg.Author, Is.Not.Null.Or.Empty); } [Test] public void Message_StatusWithXmlChars_DoesNotThrow() { var msg = new Message("author", "status & bad things'<&;/", "contents"); - Assert.IsNotNullOrEmpty(msg.Status); + Assert.That(msg.Status, Is.Not.Null.Or.Empty); } } diff --git a/src/LibChorusTests/packages.config b/src/LibChorusTests/packages.config deleted file mode 100644 index a3e91ab0f..000000000 --- a/src/LibChorusTests/packages.config +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/src/LibChorusTests/sync/ChorusMLFileSyncTests.cs b/src/LibChorusTests/sync/ChorusMLFileSyncTests.cs index 62fa298ff..5f7497353 100644 --- a/src/LibChorusTests/sync/ChorusMLFileSyncTests.cs +++ b/src/LibChorusTests/sync/ChorusMLFileSyncTests.cs @@ -29,8 +29,8 @@ public void ConflictFileIsCheckedIn() string notesFile = ChorusNotesMergeEventListener.GetChorusNotesFilePath(sally.UserFile.Path); Console.WriteLine("notesFile '{0}'", notesFile); - Assert.IsTrue(File.Exists(notesFile), "Conflict file should have been in working set"); - Assert.IsTrue(sally.Synchronizer.Repository.GetFileIsInRepositoryFromFullPath(notesFile),"Notes file should have been added to repository"); + Assert.That(notesFile, Does.Exist, "Conflict file should have been in working set"); + Assert.That(sally.Synchronizer.Repository.GetFileIsInRepositoryFromFullPath (notesFile), Is.True, "Notes file should have been added to repository"); } } diff --git a/src/LibChorusTests/sync/CommitCopTests.cs b/src/LibChorusTests/sync/CommitCopTests.cs index 40499e26e..e8483c5cd 100644 --- a/src/LibChorusTests/sync/CommitCopTests.cs +++ b/src/LibChorusTests/sync/CommitCopTests.cs @@ -19,7 +19,7 @@ public void NoMatchingFileHandlers_DoesNothing() using(var cop = new CommitCop(bob.Repository , ChorusFileTypeHandlerCollection.CreateWithTestHandlerOnly(), bob.Progress)) { bob.AddAndCheckinFile("test.abc", "hello"); - Assert.IsNullOrEmpty(cop.ValidationResult); + Assert.That(cop.ValidationResult, Is.Null.Or.Empty); } bob.AssertLocalRevisionNumber(0); } @@ -34,7 +34,7 @@ public void HasFileHandlers_Validates_DoesNothing() { bob.AddAndCheckinFile("test.chorusTest", "hello"); // SUT - Assert.IsNullOrEmpty(cop.ValidationResult); + Assert.That(cop.ValidationResult, Is.Null.Or.Empty); } bob.AssertLocalRevisionNumber(0); } @@ -49,7 +49,7 @@ public void SecondCheckin_Invalid_BacksOut() bob.ChangeFile("test.chorusTest",ChorusTestFileHandler.GetInvalidContents()); using (var cop = new CommitCop(bob.Repository, ChorusFileTypeHandlerCollection.CreateWithTestHandlerOnly(), bob.Progress)) { - Assert.IsFalse(string.IsNullOrEmpty(cop.ValidationResult)); + Assert.That(cop.ValidationResult, Is.Not.Null.And.Not.Empty); bob.Repository.Commit(false, "bad data"); } Debug.WriteLine(bob.Repository.GetLog(-1)); @@ -69,7 +69,7 @@ public void HasFileHandlers_ValidCommit_Validates_DoesNothing() { bob.ChangeFile("test.chorusTest", "aloha"); bob.AddAndCheckinFile("test2.chorusTest", "hi"); - Assert.IsNullOrEmpty(cop.ValidationResult); + Assert.That(cop.ValidationResult, Is.Null.Or.Empty); } bob.AssertHeadCount(1); bob.AssertLocalRevisionNumber(1); @@ -89,7 +89,7 @@ public void InitialFileCommit_Invalid_BacksOut() using(var cop = new CommitCop(bob.Repository, ChorusFileTypeHandlerCollection.CreateWithTestHandlerOnly(), bob.Progress)) { bob.Repository.AddAndCheckinFile("test.chorusTest"); - Assert.That(cop.ValidationResult, Is.StringContaining("Failed")); + Assert.That(cop.ValidationResult, Does.Contain("Failed")); } Debug.WriteLine(bob.Repository.GetLog(-1)); bob.AssertHeadCount(1); @@ -116,7 +116,7 @@ public void VeryFirstCommit_Invalid_Throws() } } }); - Assert.That(validationResult, Is.StringContaining("Failed")); + Assert.That(validationResult, Does.Contain("Failed")); } } } diff --git a/src/LibChorusTests/sync/LargeFileFilterTests.cs b/src/LibChorusTests/sync/LargeFileFilterTests.cs index 7792f4243..df0279a99 100644 --- a/src/LibChorusTests/sync/LargeFileFilterTests.cs +++ b/src/LibChorusTests/sync/LargeFileFilterTests.cs @@ -19,8 +19,8 @@ public class LargeFileFilterTests private string _longData; private ChorusFileTypeHandlerCollection _handlersColl; - [TestFixtureSetUp] - public void TestFixtureSetup() + [OneTimeSetUp] + public void OneTimeSetUp() { _handlersColl = ChorusFileTypeHandlerCollection.CreateWithTestHandlerOnly(); var testHandler = (from handler in _handlersColl.Handlers @@ -52,10 +52,10 @@ public void LongUnknownFileIsfilteredOut() bob.Repository, config, _handlersColl); - Assert.IsFalse(string.IsNullOrEmpty(result)); + Assert.That(result, Is.Not.Null.And.Not.Empty); var shortpath = fullPathname.Replace(pathToRepo, ""); - Assert.IsTrue(config.ExcludePatterns.Contains(shortpath)); - Assert.IsFalse(config.IncludePatterns.Contains(shortpath)); + Assert.That(config.ExcludePatterns.Contains(shortpath), Is.True); + Assert.That(config.IncludePatterns.Contains(shortpath), Is.False); } } @@ -79,10 +79,10 @@ public void LongAddedFileIsfilteredOut() bob.Repository, config, _handlersColl); - Assert.IsFalse(string.IsNullOrEmpty(result)); + Assert.That(result, Is.Not.Null.And.Not.Empty); var shortpath = fullPathname.Replace(pathToRepo, ""); - Assert.IsTrue(config.ExcludePatterns.Contains(shortpath)); - Assert.IsFalse(config.IncludePatterns.Contains(shortpath)); + Assert.That(config.ExcludePatterns.Contains(shortpath), Is.True); + Assert.That(config.IncludePatterns.Contains(shortpath), Is.False); } } @@ -115,10 +115,10 @@ public void LongModifiedFileIsfilteredOut() bob.AssertLocalRevisionNumber(1); // 'forget' marks it as deleted in the repo. bob.AssertFileContents(fullPathname, _longData); - Assert.IsFalse(string.IsNullOrEmpty(result)); + Assert.That(result, Is.Not.Null.And.Not.Empty); var shortpath = fullPathname.Replace(pathToRepo, ""); - Assert.IsTrue(config.ExcludePatterns.Contains(shortpath)); - Assert.IsFalse(config.IncludePatterns.Contains(shortpath)); + Assert.That(config.ExcludePatterns, Does.Contain(shortpath)); + Assert.That(config.IncludePatterns, Does.Not.Contain(shortpath)); } } @@ -141,10 +141,10 @@ public void ShortAddedFileIsAllowed() bob.Repository, config, _handlersColl); - Assert.IsTrue(string.IsNullOrEmpty(result)); + Assert.That(result, Is.Null.Or.Empty); var shortpath = fullPathname.Replace(pathToRepo, ""); - Assert.IsFalse(config.ExcludePatterns.Contains(shortpath)); - Assert.IsFalse(config.IncludePatterns.Contains(shortpath)); + Assert.That(config.ExcludePatterns, Does.Not.Contain(shortpath)); + Assert.That(config.IncludePatterns, Does.Not.Contain(shortpath)); } } @@ -166,10 +166,10 @@ public void ShortUnknownFileIsAllowed() bob.Repository, config, _handlersColl); - Assert.IsTrue(string.IsNullOrEmpty(result)); + Assert.That(result, Is.Null.Or.Empty); var shortpath = fullPathname.Replace(pathToRepo, ""); - Assert.IsFalse(config.ExcludePatterns.Contains(shortpath)); - Assert.IsFalse(config.IncludePatterns.Contains(shortpath)); + Assert.That(config.ExcludePatterns, Does.Not.Contain(shortpath)); + Assert.That(config.IncludePatterns, Does.Not.Contain(shortpath)); } } @@ -201,10 +201,10 @@ public void FileWithSpecialCharacterIsAllowed() bob.Repository, config, _handlersColl); - Assert.IsTrue(string.IsNullOrEmpty(result)); + Assert.That(result, Is.Null.Or.Empty); var shortpath = fullPathname.Replace(pathToRepo, ""); - Assert.IsFalse(config.ExcludePatterns.Contains(shortpath)); - Assert.IsFalse(config.IncludePatterns.Contains(shortpath)); + Assert.That(config.ExcludePatterns, Does.Not.Contain(shortpath)); + Assert.That(config.IncludePatterns, Does.Not.Contain(shortpath)); } } @@ -231,10 +231,10 @@ public void LongWavFileIsFilteredOutAndNotInRepo() bob.Repository, config, ChorusFileTypeHandlerCollection.CreateWithInstalledHandlers()); - Assert.IsFalse(string.IsNullOrEmpty(result)); + Assert.That(result, Is.Not.Null.And.Not.Empty); var shortpath = fullPathname.Replace(pathToRepo, ""); - Assert.IsTrue(config.ExcludePatterns.Contains(shortpath)); - Assert.IsFalse(config.IncludePatterns.Contains(shortpath)); + Assert.That(config.ExcludePatterns, Does.Contain(shortpath)); + Assert.That(config.IncludePatterns, Does.Not.Contain(shortpath)); bob.Repository.AddAndCheckinFiles(config.IncludePatterns, config.ExcludePatterns, "Some commit"); bob.AssertFileDoesNotExistInRepository("big.wav"); } @@ -265,11 +265,11 @@ public void NormallyExcludedFwdataFileIsNotAddedByLargeFileFilter() bob.Repository, config, ChorusFileTypeHandlerCollection.CreateWithInstalledHandlers()); - Assert.IsTrue(string.IsNullOrEmpty(result)); + Assert.That(result, Is.Null.Or.Empty); var shortpath = largeFwdataPathname.Replace(pathToRepo, ""); - Assert.IsFalse(config.ExcludePatterns.Contains(shortpath)); - Assert.IsFalse(config.IncludePatterns.Contains(shortpath)); + Assert.That(config.ExcludePatterns, Does.Not.Contain(shortpath)); + Assert.That(config.IncludePatterns, Does.Not.Contain(shortpath)); } } @@ -301,11 +301,11 @@ public void LargeFileInExcludedPathIsNotFilteredOut() bob.Repository, config, ChorusFileTypeHandlerCollection.CreateWithInstalledHandlers()); - Assert.IsTrue(string.IsNullOrEmpty(result)); + Assert.That(result, Is.Null.Or.Empty); var shortpath = largeVideoPathname.Replace(pathToRepo, ""); - Assert.IsFalse(config.ExcludePatterns.Contains(shortpath)); - Assert.IsFalse(config.IncludePatterns.Contains(shortpath)); + Assert.That(config.ExcludePatterns, Does.Not.Contain(shortpath)); + Assert.That(config.IncludePatterns, Does.Not.Contain(shortpath)); } } @@ -339,11 +339,11 @@ public void LargeFileInExcludedNestedPathIsNotFilteredOut() bob.Repository, config, ChorusFileTypeHandlerCollection.CreateWithInstalledHandlers()); - Assert.IsTrue(string.IsNullOrEmpty(result)); + Assert.That(result, Is.Null.Or.Empty); var shortpath = largeVideoPathname.Replace(pathToRepo, ""); - Assert.IsFalse(config.ExcludePatterns.Contains(shortpath)); - Assert.IsFalse(config.IncludePatterns.Contains(shortpath)); + Assert.That(config.ExcludePatterns, Does.Not.Contain(shortpath)); + Assert.That(config.IncludePatterns, Does.Not.Contain(shortpath)); } } @@ -393,12 +393,12 @@ public void SmallFileInNonExcludedFolderNotFilteredByExclusionAtDeeperNesting() Assert.True(string.IsNullOrEmpty(result), @"Cache folder at root was improperly filtered by foo\**\Cache"); var shortpath = largeNestedVideoPathname.Replace(pathToRepo, null); - Assert.IsFalse(config.ExcludePatterns.Contains(shortpath)); - Assert.IsFalse(config.IncludePatterns.Contains(shortpath)); + Assert.That(config.ExcludePatterns, Does.Not.Contain(shortpath)); + Assert.That(config.IncludePatterns, Does.Not.Contain(shortpath)); shortpath = smallNestedVideoPathname.Replace(pathToRepo, null); - Assert.IsFalse(config.ExcludePatterns.Contains(shortpath)); - Assert.IsFalse(config.IncludePatterns.Contains(shortpath)); + Assert.That(config.ExcludePatterns, Does.Not.Contain(shortpath)); + Assert.That(config.IncludePatterns, Does.Not.Contain(shortpath)); } } @@ -441,15 +441,14 @@ public void LargeFileInNonExcludedFolderFiltered() bob.Repository, config, ChorusFileTypeHandlerCollection.CreateWithInstalledHandlers()); - Assert.IsFalse(string.IsNullOrEmpty(result), @"Cache folder at root wasn't properly filtered by large file filer in [repo]\Cache\biggie.mov"); - + Assert.That(result, Is.Not.Null.And.Not.Empty, @"Cache folder at root wasn't properly filtered by large file filer in [repo]\Cache\biggie.mov"); var shortpath = largeNestedVideoPathname.Replace(pathToRepo, null); - Assert.IsFalse(config.ExcludePatterns.Contains(shortpath)); - Assert.IsFalse(config.IncludePatterns.Contains(shortpath)); + Assert.That(config.ExcludePatterns, Does.Not.Contain(shortpath)); + Assert.That(config.IncludePatterns, Does.Not.Contain(shortpath)); shortpath = biggieNestedNonExcludedVideoPathname.Replace(pathToRepo, null); - Assert.IsTrue(config.ExcludePatterns.Contains(shortpath)); - Assert.IsFalse(config.IncludePatterns.Contains(shortpath)); + Assert.That(config.ExcludePatterns, Does.Contain(shortpath)); + Assert.That(config.IncludePatterns, Does.Not.Contain(shortpath)); } } @@ -484,11 +483,11 @@ public void LargeFileInExcludedDeeplyNestedPathIsNotFilteredOut() bob.Repository, config, ChorusFileTypeHandlerCollection.CreateWithInstalledHandlers()); - Assert.IsTrue(string.IsNullOrEmpty(result)); + Assert.That(result, Is.Null.Or.Empty); var shortpath = largeVideoPathname.Replace(pathToRepo, ""); - Assert.IsFalse(config.ExcludePatterns.Contains(shortpath)); - Assert.IsFalse(config.IncludePatterns.Contains(shortpath)); + Assert.That(config.ExcludePatterns, Does.Not.Contain(shortpath)); + Assert.That(config.IncludePatterns, Does.Not.Contain(shortpath)); } } @@ -519,11 +518,11 @@ public void NormallyExcludedNestedFileIsNotAddedByLargeFileFilter() bob.Repository, config, ChorusFileTypeHandlerCollection.CreateWithInstalledHandlers()); - Assert.IsTrue(string.IsNullOrEmpty(result)); + Assert.That(result, Is.Null.Or.Empty); var shortpath = largeVideoPathname.Replace(pathToRepo, ""); - Assert.IsFalse(config.ExcludePatterns.Contains(shortpath)); - Assert.IsFalse(config.IncludePatterns.Contains(shortpath)); + Assert.That(config.ExcludePatterns, Does.Not.Contain(shortpath)); + Assert.That(config.IncludePatterns, Does.Not.Contain(shortpath)); } } @@ -556,10 +555,10 @@ public void NormallyExcludedNestedLargeFileIsNotAddedByLargeFileFilter() bob.Repository, config, ChorusFileTypeHandlerCollection.CreateWithInstalledHandlers()); - Assert.IsTrue(string.IsNullOrEmpty(result)); + Assert.That(result, Is.Null.Or.Empty); var shortpath = fullDictionaryPathname.Replace(pathToRepo, ""); - Assert.IsTrue(config.ExcludePatterns.Contains(shortpath)); - Assert.IsFalse(config.IncludePatterns.Contains(shortpath)); + Assert.That(config.ExcludePatterns, Does.Contain(shortpath)); + Assert.That(config.IncludePatterns, Does.Not.Contain(shortpath)); } } @@ -587,14 +586,14 @@ public void ExplicitlyExcludedNonexistantFileNotFiltered() bob.Repository, config, ChorusFileTypeHandlerCollection.CreateWithInstalledHandlers()); - Assert.IsTrue(string.IsNullOrEmpty(result)); + Assert.That(result, Is.Null.Or.Empty); var shortpath = fullDictionaryPathname.Replace(pathToRepo, ""); - Assert.IsTrue(config.ExcludePatterns.Contains(shortpath)); - Assert.IsFalse(config.IncludePatterns.Contains(shortpath)); + Assert.That(config.ExcludePatterns, Does.Contain(shortpath)); + Assert.That(config.IncludePatterns, Does.Not.Contain(shortpath)); shortpath = fullRandomPathname.Replace(pathToRepo, ""); - Assert.IsFalse(config.ExcludePatterns.Contains(shortpath)); - Assert.IsFalse(config.IncludePatterns.Contains(shortpath)); + Assert.That(config.ExcludePatterns, Does.Not.Contain(shortpath)); + Assert.That(config.IncludePatterns, Does.Not.Contain(shortpath)); } } @@ -636,18 +635,18 @@ public void NormallyExcludedFileIsNotAddedByLargeFileFilter() bob.Repository, config, ChorusFileTypeHandlerCollection.CreateWithInstalledHandlers()); - Assert.IsTrue(string.IsNullOrEmpty(result)); + Assert.That(result, Is.Null.Or.Empty); var shortpath = fullDictionaryPathname.Replace(pathToRepo, ""); - Assert.IsTrue(config.ExcludePatterns.Contains(shortpath)); - Assert.IsFalse(config.IncludePatterns.Contains(shortpath)); + Assert.That(config.ExcludePatterns, Does.Contain(shortpath)); + Assert.That(config.IncludePatterns, Does.Not.Contain(shortpath)); shortpath = fullOldDictionaryPathname.Replace(pathToRepo, ""); - Assert.IsFalse(config.ExcludePatterns.Contains(shortpath)); - Assert.IsFalse(config.IncludePatterns.Contains(shortpath)); + Assert.That(config.ExcludePatterns, Does.Not.Contain(shortpath)); + Assert.That(config.IncludePatterns, Does.Not.Contain(shortpath)); shortpath = fullLargeVideoPathname.Replace(pathToRepo, ""); - Assert.IsFalse(config.ExcludePatterns.Contains(shortpath)); - Assert.IsFalse(config.IncludePatterns.Contains(shortpath)); + Assert.That(config.ExcludePatterns, Does.Not.Contain(shortpath)); + Assert.That(config.IncludePatterns, Does.Not.Contain(shortpath)); } } @@ -673,10 +672,10 @@ public void LargeMp3FileIsNotAllowed() bob.Repository, config, ChorusFileTypeHandlerCollection.CreateWithInstalledHandlers()); - Assert.IsFalse(string.IsNullOrEmpty(result)); + Assert.That(result, Is.Not.Null.And.Not.Empty); var shortpath = fullPathname.Replace(pathToRepo, ""); - Assert.IsTrue(config.ExcludePatterns.Contains(shortpath)); - Assert.IsFalse(config.IncludePatterns.Contains(shortpath)); + Assert.That(config.ExcludePatterns, Does.Contain(shortpath)); + Assert.That(config.IncludePatterns, Does.Not.Contain(shortpath)); } } @@ -715,15 +714,15 @@ public void GetFilteredStatusForFilesHasExpectedResults() var results = LargeFileFilter.GetStatusOfFilesOfInterest(repo.Repository, repo.ProjectFolderConfig); Assert.AreEqual(3, results.Keys.Count); - Assert.IsTrue(results.ContainsKey("M")); // tracked and modifed - Assert.IsTrue(results.ContainsKey("A")); // Added with hg add - Assert.IsTrue(results.ContainsKey("?")); // untracked + Assert.That(results, Does.ContainKey("M")); // tracked and modified + Assert.That(results, Does.ContainKey("A")); // Added with hg add + Assert.That(results, Does.ContainKey("?")); // untracked foreach (var resultKvp in results) { var resultValue = resultKvp.Value; Assert.AreEqual(1, resultValue.Keys.Count); - Assert.IsTrue(resultValue.ContainsKey("txt")); + Assert.That(resultValue, Does.ContainKey("txt")); Assert.AreEqual(1, resultValue.Values.Count); switch (resultKvp.Key) { diff --git a/src/LibChorusTests/sync/ProxyTests.cs b/src/LibChorusTests/sync/ProxyTests.cs index ae5c0dda5..2cc48921a 100644 --- a/src/LibChorusTests/sync/ProxyTests.cs +++ b/src/LibChorusTests/sync/ProxyTests.cs @@ -32,7 +32,7 @@ public void Clone_Test() using (var f = new TemporaryFolder("clonetest")) { HgRepository.Clone(new HttpRepositoryPath("cloneableTestProjectUrl", CloneableTestProjectUrl, false), f.Path, _progress); - Assert.IsTrue(Directory.Exists(f.Combine(f.Path, ".hg"))); + Assert.That(f.Combine(f.Path, ".hg"), Does.Exist); } } @@ -46,7 +46,7 @@ public void Pull_Test() var repo = HgRepository.CreateOrUseExisting(f.Path, _progress); var address = new HttpRepositoryPath("default", CloneableTestProjectUrl, false); repo.Pull(address, CloneableTestProjectUrl); - Assert.IsTrue(Directory.Exists(f.Combine(f.Path, ".hg"))); + Assert.That(f.Combine(f.Path, ".hg"), Does.Exist); } } @@ -59,7 +59,7 @@ public void PullThenPush_Test() var repo = HgRepository.CreateOrUseExisting(f.Path, _progress); var address = new HttpRepositoryPath("default", CloneableTestProjectUrl, false); repo.Pull(address, CloneableTestProjectUrl); - Assert.IsTrue(Directory.Exists(f.Combine(f.Path, ".hg"))); + Assert.That(f.Combine(f.Path, ".hg"), Does.Exist); //nb: this is safe to do over an over, because it will just say "no changes found", never actually add a changeset diff --git a/src/LibChorusTests/sync/SychronizerAdjunctTests.cs b/src/LibChorusTests/sync/SychronizerAdjunctTests.cs index 83c14b0f3..742ff2a28 100644 --- a/src/LibChorusTests/sync/SychronizerAdjunctTests.cs +++ b/src/LibChorusTests/sync/SychronizerAdjunctTests.cs @@ -44,11 +44,11 @@ public void SettingSychronizerAdjunctToNullEndsWithDoNothingDefaultInterfaceImpl using (var bob = new RepositorySetup("bob", true)) { var synchronizer = bob.CreateSynchronizer(); - Assert.IsNotNull(synchronizer.SynchronizerAdjunct); + Assert.That(synchronizer.SynchronizerAdjunct, Is.Not.Null); Assert.IsInstanceOf(synchronizer.SynchronizerAdjunct); synchronizer.SynchronizerAdjunct = null; - Assert.IsNotNull(synchronizer.SynchronizerAdjunct); + Assert.That(synchronizer.SynchronizerAdjunct, Is.Not.Null); Assert.IsInstanceOf(synchronizer.SynchronizerAdjunct); } } @@ -83,9 +83,7 @@ public void CommitWithMergeDoesNotThrowTryingNullSychronizerAdjunct() /// The presence or absence of the two files tells us whether the Synchronizer class called the new interface methods. ///
[Test] -#if MONO - [Ignore] -#endif + [Platform(Exclude = "Linux")] public void BasicCommitHasCommitFileButNotMergeFile() { using (var bob = new RepositorySetup("bob", true)) @@ -103,7 +101,7 @@ public void BasicCommitHasCommitFileButNotMergeFile() synchronizer.SynchronizerAdjunct = syncAdjunct; var syncResults = bob.SyncWithOptions(options, synchronizer); - Assert.IsFalse(syncResults.DidGetChangesFromOthers); + Assert.That(syncResults.DidGetChangesFromOthers, Is.False); CheckExistanceOfAdjunctFiles(syncAdjunct, true, false, false, false, true, false); } } @@ -113,9 +111,7 @@ public void BasicCommitHasCommitFileButNotMergeFile() /// Then it does a Sync which should find no changes and result in no pull (or pull file) /// [Test] -#if MONO - [Ignore] -#endif + [Platform(Exclude = "Linux")] public void SendReceiveWithNoRemoteChangesGetsNoFiles() { using (var bob = RepositoryWithFilesSetup.CreateWithLiftFile("bob")) @@ -131,7 +127,7 @@ public void SendReceiveWithNoRemoteChangesGetsNoFiles() var synchronizer = bob.Synchronizer; synchronizer.SynchronizerAdjunct = syncAdjunct; var syncResults = bob.SyncWithOptions(options, synchronizer); - Assert.IsFalse(syncResults.DidGetChangesFromOthers); + Assert.That(syncResults.DidGetChangesFromOthers, Is.False); CheckExistanceOfAdjunctFiles(syncAdjunct, true, false, false, false, true, true); } } @@ -141,9 +137,7 @@ public void SendReceiveWithNoRemoteChangesGetsNoFiles() /// This should result in a SimpleUpdate call, sally made a change so it should have a commmit file and a pull file and a merge file /// [Test] -#if MONO - [Ignore] -#endif + [Platform(Exclude = "Linux")] public void SendReceiveWithTrivialMergeCallsSimpleUpdate() { using (var alistair = RepositoryWithFilesSetup.CreateWithLiftFile("alistair")) @@ -170,7 +164,7 @@ public void SendReceiveWithTrivialMergeCallsSimpleUpdate() alistair.SyncWithOptions(options); susanna.ReplaceSomethingElse("no problems."); var syncResults = susanna.SyncWithOptions(bobOptions, synchronizer); - Assert.IsTrue(syncResults.DidGetChangesFromOthers); + Assert.That(syncResults.DidGetChangesFromOthers, Is.True); CheckExistanceOfAdjunctFiles(syncAdjunct, true, true, false, true, true, true); } } @@ -204,7 +198,7 @@ public void CommitWithMergeHasCommitFileAndMergeFile() synchronizer.SynchronizerAdjunct = syncAdjunct; var syncResults = sally.SyncWithOptions(options, synchronizer); - Assert.IsTrue(syncResults.DidGetChangesFromOthers); + Assert.That(syncResults.DidGetChangesFromOthers, Is.True); CheckExistanceOfAdjunctFiles(syncAdjunct, true, true, false, true, true, true); } } @@ -237,7 +231,7 @@ public void EachOneChangedOrAddedFileButNotSameFile_HasCommitAndPullAndMergeFile synchronizer.SynchronizerAdjunct = syncAdjunct; var syncResults = sally.SyncWithOptions(options, synchronizer); - Assert.IsTrue(syncResults.DidGetChangesFromOthers); + Assert.That(syncResults.DidGetChangesFromOthers, Is.True); CheckExistanceOfAdjunctFiles(syncAdjunct, true, true, false, true, true, true); } } @@ -268,7 +262,7 @@ public void TheyMadeChanges_WeDidNothing_Fires_SimpleUpdate_WithFalse() synchronizer.SynchronizerAdjunct = syncAdjunct; var syncResults = sally.SyncWithOptions(options, synchronizer); - Assert.IsTrue(syncResults.DidGetChangesFromOthers); + Assert.That(syncResults.DidGetChangesFromOthers, Is.True); CheckExistanceOfAdjunctFiles(syncAdjunct, true, true, false, false, true, true); } } @@ -302,9 +296,9 @@ public void BothMadeChanges_MergeFailure_Fires_SimpleUpdate_WithTrue() using (new FailureSimulator("SychronizerAdjunct")) { var syncResults = sally.SyncWithOptions(options, synchronizer); - Assert.IsTrue(syncResults.DidGetChangesFromOthers); - Assert.IsFalse(syncResults.Cancelled); - Assert.IsFalse(syncResults.Succeeded); + Assert.That(syncResults.DidGetChangesFromOthers, Is.True); + Assert.That(syncResults.Cancelled, Is.False); + Assert.That(syncResults.Succeeded, Is.False); CheckExistanceOfAdjunctFiles(syncAdjunct, true, false, true, false, true, false); } } @@ -334,7 +328,7 @@ public void CheckBranchesGetsRightNumberOfBranches() synchronizer.SynchronizerAdjunct = syncAdjunct; var syncResults = sally.SyncWithOptions(options, synchronizer); - Assert.IsTrue(syncResults.DidGetChangesFromOthers); + Assert.That(syncResults.DidGetChangesFromOthers, Is.True); CheckExistanceOfAdjunctFiles(syncAdjunct, true, true, false, false, true, true); var lines = File.ReadAllLines(syncAdjunct.CheckRepoBranchesPathName); Assert.AreEqual(lines.Length, 2, "Wrong number of branches on CheckBranches call"); @@ -364,9 +358,9 @@ public void OurCommitOnlyFailsCommitCopCheck() synchronizer.SynchronizerAdjunct = syncAdjunct; var syncResults = bob.SyncWithOptions(options, synchronizer); - Assert.IsFalse(syncResults.Cancelled); - Assert.IsFalse(syncResults.DidGetChangesFromOthers); - Assert.IsFalse(syncResults.Succeeded); + Assert.That(syncResults.Cancelled, Is.False); + Assert.That(syncResults.DidGetChangesFromOthers, Is.False); + Assert.That(syncResults.Succeeded, Is.False); CheckExistanceOfAdjunctFiles(syncAdjunct, true, false, true, false, true, false); } } @@ -400,7 +394,7 @@ public void Synchronizer_ReportsNewChangeOnOtherBranch() var rev2 = new Revision(null, "default", "Fred", "1235", "hash1235", "change something else"); revs = new[] { rev2 }; - Assert.That(LiftSynchronizerAdjunct.GetRepositoryBranchCheckData(revs, "7.2.1", ref savedSettings), Is.StringContaining("Fred")); + Assert.That(LiftSynchronizerAdjunct.GetRepositoryBranchCheckData(revs, "7.2.1", ref savedSettings), Does.Contain("Fred")); } [Test] @@ -471,44 +465,44 @@ private static void CheckExistanceOfAdjunctFiles(FileWriterSychronizerAdjunct sy bool branchesFileShouldExist) { if (commitFileShouldExist) - Assert.IsTrue(File.Exists(syncAdjunct.CommitPathname), "CommitFile should exist."); + Assert.That(syncAdjunct.CommitPathname, Does.Exist, "CommitFile should exist."); else - Assert.IsFalse(File.Exists(syncAdjunct.CommitPathname), "CommitFile should not exist."); + Assert.That(syncAdjunct.CommitPathname, Does.Not.Exist, "CommitFile should not exist."); if (pullFileShouldExist) - Assert.IsTrue(File.Exists(syncAdjunct.PullPathname), "PullFile should exist."); + Assert.That(syncAdjunct.PullPathname, Does.Exist, "PullFile should exist."); else - Assert.IsFalse(File.Exists(syncAdjunct.PullPathname), "PullFile should not exist."); + Assert.That(syncAdjunct.PullPathname, Does.Not.Exist, "PullFile should not exist."); if (rollbackFileShouldExist) - Assert.IsTrue(File.Exists(syncAdjunct.RollbackPathname), "RollbackFile should exist."); + Assert.That(syncAdjunct.RollbackPathname, Does.Exist, "RollbackFile should exist."); else - Assert.IsFalse(File.Exists(syncAdjunct.RollbackPathname), "RollbackFile shouldn't exist."); + Assert.That(syncAdjunct.RollbackPathname, Does.Not.Exist, "RollbackFile shouldn't exist."); if (mergeFileShouldExist) - Assert.IsTrue(File.Exists(syncAdjunct.MergePathname), "MergeFile should exist."); + Assert.That(syncAdjunct.MergePathname, Does.Exist, "MergeFile should exist."); else - Assert.IsFalse(File.Exists(syncAdjunct.MergePathname), "MergeFile shouldn't exist."); + Assert.That(syncAdjunct.MergePathname, Does.Not.Exist, "MergeFile shouldn't exist."); if (branchNameFileShouldExist) - Assert.IsTrue(File.Exists(syncAdjunct.BranchNamePathName), "BranchNameFile should exist."); + Assert.That(syncAdjunct.BranchNamePathName, Does.Exist, "BranchNameFile should exist."); else - Assert.IsFalse(File.Exists(syncAdjunct.BranchNamePathName), "BranchNameFile shouldn't exist."); + Assert.That(syncAdjunct.BranchNamePathName, Does.Not.Exist, "BranchNameFile shouldn't exist."); if (branchesFileShouldExist) - Assert.IsTrue(File.Exists(syncAdjunct.CheckRepoBranchesPathName), "CheckRepoBranchesFile should exist."); + Assert.That(syncAdjunct.CheckRepoBranchesPathName, Does.Exist, "CheckRepoBranchesFile should exist."); else - Assert.IsFalse(File.Exists(syncAdjunct.CheckRepoBranchesPathName), "CheckRepoBranchesFile shouldn't exist."); + Assert.That(syncAdjunct.CheckRepoBranchesPathName, Does.Not.Exist, "CheckRepoBranchesFile shouldn't exist."); } private static void CheckNoFilesExist(FileWriterSychronizerAdjunct syncAdjunct) { - Assert.IsFalse(File.Exists(syncAdjunct.CommitPathname)); - Assert.IsFalse(File.Exists(syncAdjunct.PullPathname)); - Assert.IsFalse(File.Exists(syncAdjunct.RollbackPathname)); - Assert.IsFalse(File.Exists(syncAdjunct.MergePathname)); - Assert.IsFalse(File.Exists(syncAdjunct.BranchNamePathName)); - Assert.IsFalse(File.Exists(syncAdjunct.CheckRepoBranchesPathName)); + Assert.That(syncAdjunct.CommitPathname, Does.Not.Exist); + Assert.That(syncAdjunct.PullPathname, Does.Not.Exist); + Assert.That(syncAdjunct.RollbackPathname, Does.Not.Exist); + Assert.That(syncAdjunct.MergePathname, Does.Not.Exist); + Assert.That(syncAdjunct.BranchNamePathName, Does.Not.Exist); + Assert.That(syncAdjunct.CheckRepoBranchesPathName, Does.Not.Exist); } private class FileWriterSychronizerAdjunct : ISychronizerAdjunct diff --git a/src/LibChorusTests/sync/SyncScenarioTests.cs b/src/LibChorusTests/sync/SyncScenarioTests.cs index ea659cbff..86f305f5c 100644 --- a/src/LibChorusTests/sync/SyncScenarioTests.cs +++ b/src/LibChorusTests/sync/SyncScenarioTests.cs @@ -17,7 +17,7 @@ public class SyncScenarioTests private string _pathToTestRootBase; private string _pathToTestRoot; - [TestFixtureSetUp] + [OneTimeSetUp] public void FixtureSetup() { _pathToTestRootBase = Path.Combine(Path.GetTempPath(), "ChorusSyncScenarioTests"); @@ -26,7 +26,7 @@ public void FixtureSetup() Directory.CreateDirectory(_pathToTestRootBase); } - [TestFixtureTearDown] + [OneTimeTearDown] public void FixtureTearDown() { Directory.Delete(_pathToTestRootBase, true); @@ -156,7 +156,7 @@ public void ChangeTextFile(Synchronizer sync) public string SetupClone(string targetPath) { //return GetSynchronizer().MakeClone(Path.Combine(targetPath, BobSetup.ProjectFolderName), true); - return HgHighLevel.MakeCloneFromUsbToLocal(_languageProjectPath, + return HgHighLevel.MakeCloneFromUsbToLocal(_languageProjectPath, Path.Combine(targetPath, BobSetup.ProjectFolderName), _progress); } @@ -198,7 +198,7 @@ public void CanGetNewFileFromAnotherRep() options.DoSendToOthers = false; options.RepositorySourcesToTry.Add(otherDirPath); bob.SyncNow(options); - Assert.IsTrue(File.Exists(Path.Combine(bobSetup._languageProjectPath, "incoming.abc"))); + Assert.That(Path.Combine(bobSetup._languageProjectPath, "incoming.abc"), Does.Exist); } [Test] @@ -248,21 +248,21 @@ public void TestNewVersion_SallyUpgrades_BobNotYet() // Verification var bobContents = File.ReadAllText(bobSetup._pathToLift); - Assert.IsFalse(bobContents.Contains("cat"), "'cat' should only be on Sally's branch."); - Assert.IsTrue(bobContents.Contains("dog")); + Assert.That(bobContents, Does.Not.Contain("cat"), "'cat' should only be on Sally's branch."); + Assert.That(bobContents, Does.Contain("dog")); var sallyContents = File.ReadAllText(sallyPathToLift); //Debug.WriteLine("sally's: " + sallyContents); - Assert.IsTrue(sallyContents.Contains("cat")); - Assert.IsFalse(sallyContents.Contains("dog"), "'dog' should only be in Bob's repo."); + Assert.That(sallyContents, Does.Contain("cat")); + Assert.That(sallyContents, Does.Not.Contain("dog"), "'dog' should only be in Bob's repo."); // Verify Bob is still on the default branch (empty string) string dummy; var result = bobSyncer.Repository.BranchingHelper.IsLatestBranchDifferent("", out dummy); - Assert.IsFalse(result, "Bob should be on default branch."); + Assert.That(result, Is.False, "Bob should be on default branch."); // Verify Sally is on the right branch result = synchronizer.Repository.BranchingHelper.IsLatestBranchDifferent(sallyNewVersion, out dummy); - Assert.IsFalse(result, "Sally should be on LIFT0.13 branch."); + Assert.That(result, Is.False, "Sally should be on LIFT0.13 branch."); } [Test] @@ -319,12 +319,12 @@ public void TestNewVersion_SallyUpgradesToBobVersion() // Verification stage 1 var bobContents = File.ReadAllText(bobSetup._pathToLift); - Assert.IsFalse(bobContents.Contains("cat"), "'cat' should only be on Sally's branch."); - Assert.IsTrue(bobContents.Contains("dog")); + Assert.That(bobContents, Does.Not.Contain("cat"), "'cat' should only be on Sally's branch."); + Assert.That(bobContents, Does.Contain("dog")); var sallyContents = File.ReadAllText(sallyPathToLift); - Assert.IsTrue(sallyContents.Contains("cat")); - Assert.IsTrue(sallyContents.Contains("dog"), "Sally should have merged in older branch to hers."); - Assert.IsFalse(sallyContents.Contains("herring"), "The red herring is only in Bob's repo; 2nd branch."); + Assert.That(sallyContents, Does.Contain("cat")); + Assert.That(sallyContents, Does.Contain("dog"), "Sally should have merged in older branch to hers."); + Assert.That(sallyContents, Does.Not.Contain("herring"), "The red herring is only in Bob's repo; 2nd branch."); // Now Sally upgrades her LIFT-capable program to Bob's version! File.WriteAllText(sallyPathToLift, LiftFileStrings.lift13PigDogCat); @@ -344,24 +344,24 @@ public void TestNewVersion_SallyUpgradesToBobVersion() // Verification stage 2 bobContents = File.ReadAllText(bobSetup._pathToLift); //Debug.Print("Bob's: " + bobContents); - Assert.IsTrue(bobContents.Contains("cat"), "'cat' survived the upgrade to Bob's repo."); - Assert.IsTrue(bobContents.Contains("dog")); - Assert.IsTrue(bobContents.Contains("pig"), "'pig' survived the upgrade to Bob's repo."); + Assert.That(bobContents, Does.Contain("cat"), "'cat' survived the upgrade to Bob's repo."); + Assert.That(bobContents, Does.Contain("dog")); + Assert.That(bobContents, Does.Contain("pig"), "'pig' survived the upgrade to Bob's repo."); sallyContents = File.ReadAllText(sallyPathToLift); //Debug.Print("Sally's: " + sallyContents); - Assert.IsTrue(sallyContents.Contains("cat")); - Assert.IsTrue(sallyContents.Contains("dog"), "'dog' should be from Bob's older repo."); - Assert.IsTrue(sallyContents.Contains("herring"), "Now we should have everything from Bob's repo."); - Assert.IsTrue(sallyContents.Contains("pig"), "'pig' should have survived the upgrade."); + Assert.That(sallyContents, Does.Contain("cat")); + Assert.That(sallyContents, Does.Contain("dog"), "'dog' should be from Bob's older repo."); + Assert.That(sallyContents, Does.Contain("herring"), "Now we should have everything from Bob's repo."); + Assert.That(sallyContents, Does.Contain("pig"), "'pig' should have survived the upgrade."); // Verify Bob is on the latest branch string dummy; var result = bobsyncer.Repository.BranchingHelper.IsLatestBranchDifferent(lift13version, out dummy); - Assert.IsFalse(result, "Bob should be on the latest LIFT0.13 branch."); + Assert.That(result, Is.False, "Bob should be on the latest LIFT0.13 branch."); // Verify Sally is on the right branch result = synchronizer.Repository.BranchingHelper.IsLatestBranchDifferent(lift13version, out dummy); - Assert.IsFalse(result, "Sally should be on the latest LIFT0.13 branch."); + Assert.That(result, Is.False, "Sally should be on the latest LIFT0.13 branch."); } [Test] @@ -408,9 +408,9 @@ public void TestNewVersion_SallyAndBobUpgradeButFredDelays() var sallyPathToLift = Path.Combine(sallyProject.FolderPath, "lexicon/foo.lift"); var fredPathToLift = Path.Combine(fredProject.FolderPath, "lexicon/foo.lift"); var sallyContents = File.ReadAllText(sallyPathToLift); - Assert.IsTrue(sallyContents.Contains("dog"), "'dog' should be in Sally repo."); + Assert.That(sallyContents, Does.Contain("dog"), "'dog' should be in Sally repo."); var fredContents = File.ReadAllText(fredPathToLift); - Assert.IsTrue(fredContents.Contains("dog"), "'dog' should be in Fred repo."); + Assert.That(fredContents, Does.Contain("dog"), "'dog' should be in Fred repo."); // bob makes another change and syncs to new version File.WriteAllText(bobSetup._pathToLift, LiftFileStrings.lift13DogCat); @@ -433,20 +433,20 @@ public void TestNewVersion_SallyAndBobUpgradeButFredDelays() // Verification Step 2 fredContents = File.ReadAllText(fredPathToLift); - Assert.IsFalse(fredContents.Contains("cat"), "'cat' should only be on Bob's branch."); - Assert.IsTrue(fredContents.Contains("ant")); + Assert.That(fredContents, Does.Not.Contain("cat"), "'cat' should only be on Bob's branch."); + Assert.That(fredContents, Does.Contain("ant")); sallyContents = File.ReadAllText(sallyPathToLift); - Assert.IsTrue(sallyContents.Contains("ant"), "'ant' was propogated to Sally's branch."); - Assert.IsFalse(sallyContents.Contains("cat"), "'cat' should only be on Bob's branch."); + Assert.That(sallyContents, Does.Contain("ant"), "'ant' was propogated to Sally's branch."); + Assert.That(sallyContents, Does.Not.Contain("cat"), "'cat' should only be on Bob's branch."); var bobContents = File.ReadAllText(bobSetup._pathToLift); - Assert.IsFalse(bobContents.Contains("ant"), "'ant' is only on 'default' branch."); + Assert.That(bobContents, Does.Not.Contain("ant"), "'ant' is only on 'default' branch."); // Verify Bob is on the latest branch string dummy; var result = bobSyncer.Repository.BranchingHelper.IsLatestBranchDifferent(lift13version, out dummy); - Assert.IsFalse(result, "Bob should be on the new LIFT0.13 branch."); + Assert.That(result, Is.False, "Bob should be on the new LIFT0.13 branch."); // And Fred isn't result = fredSyncer.Repository.BranchingHelper.IsLatestBranchDifferent(lift13version, out dummy); - Assert.IsTrue(result, "Fred should still be on the 'default' branch."); + Assert.That(result, Is.True, "Fred should still be on the 'default' branch."); // Now Sally modifies the file, not having seen Bob's changes yet, but having seen Fred's changes. // She adds 'herring' and has upgraded to Bob's version of LIFT @@ -464,20 +464,20 @@ public void TestNewVersion_SallyAndBobUpgradeButFredDelays() // Verification Step 3 bobContents = File.ReadAllText(bobSetup._pathToLift); - Assert.IsTrue(bobContents.Contains("herring"), "'herring' should be pulled in from Sally's branch."); - Assert.IsTrue(bobContents.Contains("ant"), "'ant' should be pulled in from Sally's branch."); + Assert.That(bobContents, Does.Contain("herring"), "'herring' should be pulled in from Sally's branch."); + Assert.That(bobContents, Does.Contain("ant"), "'ant' should be pulled in from Sally's branch."); sallyContents = File.ReadAllText(sallyPathToLift); - Assert.IsTrue(sallyContents.Contains("cat"), "'cat' should be pulled in from Bob's branch."); - Assert.IsTrue(sallyContents.Contains("dog"), "Everybody should have 'dog' from before."); + Assert.That(sallyContents, Does.Contain("cat"), "'cat' should be pulled in from Bob's branch."); + Assert.That(sallyContents, Does.Contain("dog"), "Everybody should have 'dog' from before."); fredContents = File.ReadAllText(fredPathToLift); - Assert.IsFalse(fredContents.Contains("herring"), "The red herring is only in the new version for now."); - Assert.IsFalse(fredContents.Contains("cat"), "'cat' is only in the new version for now."); + Assert.That(fredContents, Does.Not.Contain("herring"), "The red herring is only in the new version for now."); + Assert.That(fredContents, Does.Not.Contain("cat"), "'cat' is only in the new version for now."); // Verify Sally is now on the latest branch result = sallySyncer.Repository.BranchingHelper.IsLatestBranchDifferent(lift13version, out dummy); - Assert.IsFalse(result, "Sally should be on the new LIFT0.13 branch."); + Assert.That(result, Is.False, "Sally should be on the new LIFT0.13 branch."); // And Fred still shouldn't be result = fredSyncer.Repository.BranchingHelper.IsLatestBranchDifferent(lift13version, out dummy); - Assert.IsTrue(result, "Fred should still be on the 'default' branch."); + Assert.That(result, Is.True, "Fred should still be on the 'default' branch."); // Now Fred checks in 'pig' to the 'default' branch File.WriteAllText(fredPathToLift, LiftFileStrings.lift12DogAntPig); @@ -488,14 +488,14 @@ public void TestNewVersion_SallyAndBobUpgradeButFredDelays() // Verification Step 4 bobContents = File.ReadAllText(bobSetup._pathToLift); - Assert.IsFalse(bobContents.Contains("pig"), "'pig' should only be on 'default' branch."); + Assert.That(bobContents, Does.Not.Contain("pig"), "'pig' should only be on 'default' branch."); sallyContents = File.ReadAllText(sallyPathToLift); - Assert.IsFalse(sallyContents.Contains("pig"), "'pig' should only be on 'default' branch."); + Assert.That(sallyContents, Does.Not.Contain("pig"), "'pig' should only be on 'default' branch."); fredContents = File.ReadAllText(fredPathToLift); - Assert.IsFalse(fredContents.Contains("herring"), "'herring' should still only be in the new version."); + Assert.That(fredContents, Does.Not.Contain("herring"), "'herring' should still only be in the new version."); // Just check Fred hasn't changed branches result = fredSyncer.Repository.BranchingHelper.IsLatestBranchDifferent(lift13version, out dummy); - Assert.IsTrue(result, "Fred should still be on the 'default' branch."); + Assert.That(result, Is.True, "Fred should still be on the 'default' branch."); // Now Bob checks in 'deer' in the new version File.WriteAllText(bobSetup._pathToLift, LiftFileStrings.lift13DogCatHerringAntDeer); @@ -505,14 +505,14 @@ public void TestNewVersion_SallyAndBobUpgradeButFredDelays() // Verification Step 5 // Check that Fred hasn't changed fredContents = File.ReadAllText(fredPathToLift); - Assert.IsFalse(fredContents.Contains("deer"), "'deer' should only be on new version."); + Assert.That(fredContents, Does.Not.Contain("deer"), "'deer' should only be on new version."); result = fredSyncer.Repository.BranchingHelper.IsLatestBranchDifferent(lift13version, out dummy); - Assert.IsTrue(result, "Fred should still be on the 'default' branch."); + Assert.That(result, Is.True, "Fred should still be on the 'default' branch."); // Check that Sally got her 'deer' sallyContents = File.ReadAllText(sallyPathToLift); - Assert.IsTrue(sallyContents.Contains("deer"), "'deer' should have propagated to Sally."); + Assert.That(sallyContents, Does.Contain("deer"), "'deer' should have propagated to Sally."); // Make sure that 'pig' hasn't migrated to the new version - Assert.IsFalse(sallyContents.Contains("pig"), "'pig' should still only be on 'default' branch."); + Assert.That(sallyContents, Does.Not.Contain("pig"), "'pig' should still only be on 'default' branch."); // Now Fred has finally upgraded and will check in 'fox' -- LAST CHECK-IN FOR THIS TEST! File.WriteAllText(fredPathToLift, LiftFileStrings.lift13DogAntPigFox); @@ -522,41 +522,41 @@ public void TestNewVersion_SallyAndBobUpgradeButFredDelays() // Verification Step 6 (Last) bobContents = File.ReadAllText(bobSetup._pathToLift); - Assert.IsTrue(bobContents.Contains("cat"), "'cat' should survive the big hairy test in Bob's repo."); - Assert.IsTrue(bobContents.Contains("dog"), "'dog' should survive the big hairy test in Bob's repo."); - Assert.IsTrue(bobContents.Contains("pig"), "'pig' should survive the big hairy test in Bob's repo."); - Assert.IsTrue(bobContents.Contains("herring"), "'herring' should survive the big hairy test in Bob's repo."); - Assert.IsTrue(bobContents.Contains("deer"), "'deer' should survive the big hairy test in Bob's repo."); - Assert.IsTrue(bobContents.Contains("ant"), "'ant' should survive the big hairy test in Bob's repo."); - Assert.IsTrue(bobContents.Contains("fox"), "'fox' should survive the big hairy test in Bob's repo."); + Assert.That(bobContents, Does.Contain("cat"), "'cat' should survive the big hairy test in Bob's repo."); + Assert.That(bobContents, Does.Contain("dog"), "'dog' should survive the big hairy test in Bob's repo."); + Assert.That(bobContents, Does.Contain("pig"), "'pig' should survive the big hairy test in Bob's repo."); + Assert.That(bobContents, Does.Contain("herring"), "'herring' should survive the big hairy test in Bob's repo."); + Assert.That(bobContents, Does.Contain("deer"), "'deer' should survive the big hairy test in Bob's repo."); + Assert.That(bobContents, Does.Contain("ant"), "'ant' should survive the big hairy test in Bob's repo."); + Assert.That(bobContents, Does.Contain("fox"), "'fox' should survive the big hairy test in Bob's repo."); sallyContents = File.ReadAllText(sallyPathToLift); - Assert.IsTrue(sallyContents.Contains("cat"), "'cat' should survive the big hairy test in Sally's repo."); - Assert.IsTrue(sallyContents.Contains("dog"), "'dog' should survive the big hairy test in Sally's repo."); - Assert.IsTrue(sallyContents.Contains("herring"), "'herring' should survive the big hairy test in Sally's repo."); - Assert.IsTrue(sallyContents.Contains("pig"), "'pig' should survive the big hairy test in Sally's repo."); - Assert.IsTrue(sallyContents.Contains("deer"), "'deer' should survive the big hairy test in Sally's repo."); - Assert.IsTrue(sallyContents.Contains("ant"), "'ant' should survive the big hairy test in Sally's repo."); - Assert.IsTrue(sallyContents.Contains("fox"), "'fox' should survive the big hairy test in Sally's repo."); + Assert.That(sallyContents, Does.Contain("cat"), "'cat' should survive the big hairy test in Sally's repo."); + Assert.That(sallyContents, Does.Contain("dog"), "'dog' should survive the big hairy test in Sally's repo."); + Assert.That(sallyContents, Does.Contain("herring"), "'herring' should survive the big hairy test in Sally's repo."); + Assert.That(sallyContents, Does.Contain("pig"), "'pig' should survive the big hairy test in Sally's repo."); + Assert.That(sallyContents, Does.Contain("deer"), "'deer' should survive the big hairy test in Sally's repo."); + Assert.That(sallyContents, Does.Contain("ant"), "'ant' should survive the big hairy test in Sally's repo."); + Assert.That(sallyContents, Does.Contain("fox"), "'fox' should survive the big hairy test in Sally's repo."); fredContents = File.ReadAllText(fredPathToLift); - Assert.IsTrue(fredContents.Contains("cat"), "'cat' should survive the big hairy test in Fred's repo."); - Assert.IsTrue(fredContents.Contains("dog"), "'dog' should survive the big hairy test in Fred's repo."); - Assert.IsTrue(fredContents.Contains("herring"), "'herring' should survive the big hairy test in Fred's repo."); - Assert.IsTrue(fredContents.Contains("pig"), "'pig' should survive the big hairy test in Fred's repo."); - Assert.IsTrue(fredContents.Contains("deer"), "'deer' should survive the big hairy test in Fred's repo."); - Assert.IsTrue(fredContents.Contains("ant"), "'ant' should survive the big hairy test in Fred's repo."); - Assert.IsTrue(fredContents.Contains("fox"), "'fox' should survive the big hairy test in Fred's repo."); + Assert.That(fredContents, Does.Contain("cat"), "'cat' should survive the big hairy test in Fred's repo."); + Assert.That(fredContents, Does.Contain("dog"), "'dog' should survive the big hairy test in Fred's repo."); + Assert.That(fredContents, Does.Contain("herring"), "'herring' should survive the big hairy test in Fred's repo."); + Assert.That(fredContents, Does.Contain("pig"), "'pig' should survive the big hairy test in Fred's repo."); + Assert.That(fredContents, Does.Contain("deer"), "'deer' should survive the big hairy test in Fred's repo."); + Assert.That(fredContents, Does.Contain("ant"), "'ant' should survive the big hairy test in Fred's repo."); + Assert.That(fredContents, Does.Contain("fox"), "'fox' should survive the big hairy test in Fred's repo."); // Verify Bob is on the latest branch result = bobSyncer.Repository.BranchingHelper.IsLatestBranchDifferent(lift13version, out dummy); - Assert.IsFalse(result, "Bob should be on the new LIFT0.13 branch."); + Assert.That(result, Is.False, "Bob should be on the new LIFT0.13 branch."); // Verify Sally is on the right branch result = sallySyncer.Repository.BranchingHelper.IsLatestBranchDifferent(lift13version, out dummy); - Assert.IsFalse(result, "Sally should be on the new LIFT0.13 branch."); + Assert.That(result, Is.False, "Sally should be on the new LIFT0.13 branch."); // Verify Fred is finally on the new branch result = fredSyncer.Repository.BranchingHelper.IsLatestBranchDifferent(lift13version, out dummy); - Assert.IsFalse(result, "Fred should finally be on the new LIFT0.13 branch."); + Assert.That(result, Is.False, "Fred should finally be on the new LIFT0.13 branch."); } #if forscreenshot @@ -717,8 +717,8 @@ public void CanCollaborateOnLift() //Debug.WriteLine("bob's: " + File.ReadAllText(bobSetup._pathToLift)); var contents = File.ReadAllText(sallyPathToLift); //Debug.WriteLine("sally's: " + contents); - Assert.IsTrue(contents.Contains("cat")); - Assert.IsTrue(contents.Contains("dog")); + Assert.That(contents, Does.Contain("cat")); + Assert.That(contents, Does.Contain("dog")); } /// @@ -785,8 +785,8 @@ public void TipUpdatedPostMerge() //Debug.WriteLine("bob's: " + File.ReadAllText(bobSetup._pathToLift)); var contents = File.ReadAllText(sallyPathToLift); //Debug.WriteLine("sally's: " + contents); - Assert.IsTrue(contents.Contains("ant")); - Assert.IsTrue(contents.Contains("dog")); + Assert.That(contents, Does.Contain("ant")); + Assert.That(contents, Does.Contain("dog")); } public void AssertLineOfFile(string filePath, int lineNumber1Based, string shouldEqual) diff --git a/src/LibChorusTests/sync/Synchronizer.BadSituationTests.cs b/src/LibChorusTests/sync/Synchronizer.BadSituationTests.cs index 27f34565f..c40af5ec0 100644 --- a/src/LibChorusTests/sync/Synchronizer.BadSituationTests.cs +++ b/src/LibChorusTests/sync/Synchronizer.BadSituationTests.cs @@ -50,7 +50,7 @@ public void Sync_HgrcInUseByOther_FailsGracefully() using (new StreamWriter(stream)) { var results = setup.CheckinAndPullAndMerge(); - Assert.IsFalse(results.Succeeded); + Assert.That(results.Succeeded, Is.False); } } } @@ -69,7 +69,7 @@ public void Sync_ExceptionInMergeCode_LeftWith2HeadsAndErrorOutputToProgress() { sally.CheckinAndPullAndMerge(bob); } - Assert.IsTrue(sally.ProgressString.Contains("InduceChorusFailure")); + Assert.That(sally.ProgressString, Does.Contain("InduceChorusFailure")); sally.AssertHeadCount(2); //ok, Bob's the tip, but... @@ -77,13 +77,13 @@ public void Sync_ExceptionInMergeCode_LeftWith2HeadsAndErrorOutputToProgress() //make sure we didn't move up to that tip, because we weren't able to merge with it var currentRevision = sally.GetRepository().GetRevisionWorkingSetIsBasedOn(); Assert.AreEqual("sally", sally.GetRepository().GetRevision(currentRevision.Number.Hash).UserId); - Assert.IsTrue(File.ReadAllText(sally.UserFile.Path).Contains("sallyWasHere")); + Assert.That(File.ReadAllText(sally.UserFile.Path), Does.Contain("sallyWasHere")); //and over at Bob's house, it's as if Sally had never connected bob.AssertHeadCount(1); Assert.AreEqual("bob", bob.Repository.GetTip().UserId); - Assert.IsTrue(File.ReadAllText(bob.UserFile.Path).Contains("bobWasHere")); + Assert.That(File.ReadAllText(bob.UserFile.Path), Does.Contain("bobWasHere")); } } File.Delete(Path.Combine(Path.GetTempPath(), "LiftMerger.FindEntryById")); @@ -146,7 +146,7 @@ public void Sync_MergeFailure_NoneOfTheOtherGuysFilesMakeItIntoWorkingDirectory( sally.AddAndCheckinFile("aaa.txt", "sally-apple"); sally.AddAndCheckinFile("bbb.txt", "sally-bread"); sally.AddAndCheckinFile("zzz.txt", "sally-zipper"); - Assert.IsFalse(sally.CheckinAndPullAndMerge(bob).Succeeded); + Assert.That(sally.CheckinAndPullAndMerge(bob).Succeeded, Is.False); //make sure we ended up on Sally's revision, even though Bob's are newer var currentRevision = sally.Repository.GetRevisionWorkingSetIsBasedOn(); @@ -159,7 +159,7 @@ public void Sync_MergeFailure_NoneOfTheOtherGuysFilesMakeItIntoWorkingDirectory( // sally.ShowInTortoise(); sally.AssertHeadCount(2); - Assert.IsFalse(sally.GetProgressString().Contains("creates new remote heads")); + Assert.That(sally.GetProgressString(), Does.Not.Contain("creates new remote heads")); } } } @@ -173,7 +173,7 @@ public void Sync_FirstCheckInButNoFilesAdded_NoProblem() using (var bob = new RepositorySetup("bob")) { var result = bob.CheckinAndPullAndMerge(); - Assert.IsTrue(result.Succeeded, result.ErrorEncountered==null?"":result.ErrorEncountered.Message); + Assert.That(result.Succeeded, Is.True, result.ErrorEncountered?.Message); } } @@ -192,7 +192,7 @@ public void Sync_RepeatedMergeFailure_WeAreLeftOnOurOwnWorkingDefault() bob.AddAndCheckIn(); sally.WriteNewContentsToTestFile("sallyWasHere"); var result = sally.CheckinAndPullAndMerge(bob); - Assert.IsFalse(result.Succeeded); + Assert.That(result.Succeeded, Is.False); //make sure we ended up on Sally's revision, even though Bob's are newer var currentRevision = sally.Repository.GetRevisionWorkingSetIsBasedOn(); @@ -205,7 +205,7 @@ public void Sync_RepeatedMergeFailure_WeAreLeftOnOurOwnWorkingDefault() Assert.AreEqual("bob", sally.Repository.GetTip().UserId,"if bob's not the tip, we're not testing the right situation"); result = sally.CheckinAndPullAndMerge(bob); - Assert.IsFalse(result.Succeeded); + Assert.That(result.Succeeded, Is.False); result = sally.CheckinAndPullAndMerge(bob); Assert.AreEqual("sally",sally.Repository.GetRevisionWorkingSetIsBasedOn().UserId); @@ -218,9 +218,8 @@ public void Sync_RepeatedMergeFailure_WeAreLeftOnOurOwnWorkingDefault() } [Test] -#if MONO - [Ignore] // I (CP) can't get MONO to get an exclusive lock for write. See RepositorySetup::GetFileLockForWriting -#endif + [Platform(Exclude = "Linux", + Reason = "I (CP) can't get MONO to get an exclusive lock for write. See RepositorySetup::GetFileLockForWriting")] [Category("SkipOnTeamCityRandomTestFailure")] public void Sync_FileLockedForWritingDuringUpdate_GetUpdatedFileOnceLockIsGone() { @@ -236,14 +235,14 @@ public void Sync_FileLockedForWritingDuringUpdate_GetUpdatedFileOnceLockIsGone() using (sally.GetFileLockForWriting("one.txt")) { // Note: Mono succeeds here - Assert.IsFalse(sally.CheckinAndPullAndMerge(bob).Succeeded, "CheckinAndPullAndMerge should have failed"); + Assert.That(sally.CheckinAndPullAndMerge(bob).Succeeded, Is.False, "CheckinAndPullAndMerge should have failed"); sally.AssertFileContents("one.txt", "hello"); } sally.AssertSingleHead(); //ok, now whatever was holding that file is done with it, and we try again - Assert.IsTrue(sally.CheckinAndPullAndMerge(bob).Succeeded, "ChecinAndPullAndMerge(bob) should have succeeded"); + Assert.That(sally.CheckinAndPullAndMerge(bob).Succeeded, Is.True, "ChecinAndPullAndMerge(bob) should have succeeded"); sally.AssertFileContents("one.txt", "hello-bob"); } } @@ -292,7 +291,7 @@ public void Sync_BothChangedBinaryFile_FailureReportedOneChosenSingleHead() // nb: this is sally because the conflict handling mode is (at the time of this test // writing) set to WeWin. - Assert.IsTrue(File.ReadAllText(sally.UserFile.Path).Contains("sallyWasHere")); + Assert.That(File.ReadAllText(sally.UserFile.Path), Does.Contain("sallyWasHere")); } } @@ -495,13 +494,13 @@ public void Sync_WeHaveAFileWhichTheyAlsoEditedButHavenotCheckedIn_TheirsIsRenam // { // memoryStream.Write(new byte[]{60},0,1 ); // string xmlString = Encoding.UTF8.GetString(memoryStream.ToArray()); -// Assert.IsFalse(xmlString.Contains("\0")); +// Assert.That(xmlString, Does.Not.Contain("\0")); // // xmlString = Encoding.UTF8.GetString(memoryStream.GetBuffer(), 0, (int)memoryStream.Position); -// Assert.IsFalse(xmlString.Contains("\0")); +// Assert.That(xmlString, Does.Not.Contain("\0")); // // xmlString = Encoding.UTF8.GetString(memoryStream.GetBuffer()); -// Assert.IsFalse(xmlString.Contains("\0")); +// Assert.That(xmlString, Does.Not.Contain("\0")); // } // } diff --git a/src/LibChorusTests/sync/Synchronizer.FileBasedTests.cs b/src/LibChorusTests/sync/Synchronizer.FileBasedTests.cs index 2afd6df0d..6d360ed05 100644 --- a/src/LibChorusTests/sync/Synchronizer.FileBasedTests.cs +++ b/src/LibChorusTests/sync/Synchronizer.FileBasedTests.cs @@ -89,12 +89,12 @@ public void SyncNow_FileMissing_GetsRemoved() _synchronizer.SyncNow(options); string path = Path.Combine(_pathToProjectRoot, "foo.txt"); - Assert.IsTrue(File.Exists(path)); + Assert.That(path, Does.Exist); _synchronizer.SyncNow(options); File.Delete(path); _synchronizer.SyncNow(options); - Assert.IsFalse(File.Exists(path)); + Assert.That(path, Does.Not.Exist); } /// @@ -108,9 +108,9 @@ public void SyncNow_NotSetupBefore_GetsClone() // WriteTestFile("version two"); - Assert.IsTrue(_synchronizer.SyncNow(options).Succeeded); + Assert.That(_synchronizer.SyncNow(options).Succeeded, Is.True); string dir = Path.Combine(_pathToBackupFolder, "foo project.2"); - Assert.IsTrue(Directory.Exists(dir)); + Assert.That(dir, Does.Exist); } [Test] diff --git a/src/LibChorusTests/sync/UsbRepositorySourceTests.cs b/src/LibChorusTests/sync/UsbRepositorySourceTests.cs index 668cdca0f..40ffb6216 100644 --- a/src/LibChorusTests/sync/UsbRepositorySourceTests.cs +++ b/src/LibChorusTests/sync/UsbRepositorySourceTests.cs @@ -69,7 +69,7 @@ public void SyncNow_OnlyABlankFauxUsbAvailable_UsbGetsClone() synchronizer.SyncNow(options); string dir = Path.Combine(UsbKeyRepositorySource.RootDirForUsbSourceDuringUnitTest, "foo project"); - Assert.IsTrue(Directory.Exists(dir)); + Assert.That(dir, Does.Exist); } @@ -86,12 +86,12 @@ public void SyncNow_UsbGetsBackwardCompatibleBareCloneWithReadme() synchronizer.SyncNow(options); var projectDir = Path.Combine(UsbKeyRepositorySource.RootDirForUsbSourceDuringUnitTest, "foo project"); - Assert.IsTrue(Directory.Exists(projectDir)); + Assert.That(projectDir, Does.Exist); // SUT backward compatible clone has no dotencode in the requires file var requiresLines = File.ReadAllLines(Path.Combine(projectDir, ".hg", "requires")); CollectionAssert.DoesNotContain(requiresLines, "dotencode"); // SUT bare clone should get this text file - Assert.IsTrue(File.Exists(projectDir.CombineForPath(projectDir, "~~Folder has an invisible repository.txt"))); + Assert.That(projectDir.CombineForPath(projectDir, "~~Folder has an invisible repository.txt"), Does.Exist); } [Test] diff --git a/src/LibChorusTests/utilities/ChorusDiff3Tests.cs b/src/LibChorusTests/utilities/ChorusDiff3Tests.cs index 2e46a4947..5a572c880 100644 --- a/src/LibChorusTests/utilities/ChorusDiff3Tests.cs +++ b/src/LibChorusTests/utilities/ChorusDiff3Tests.cs @@ -17,7 +17,7 @@ public class ChorusDiff3Tests [Test] public void Diff3IsAccessible() { - Assert.IsTrue(TextMerger.GetVersion().Contains("Copyright")); + Assert.That(TextMerger.GetVersion(), Does.Contain("Copyright")); } [Test] @@ -30,21 +30,21 @@ public void CommonIsEmpty() m.Go(); AssertLeftNoMergeArtifacts(m); Assert.AreEqual(string.Empty, m.LeastCommonDenominator.Trim()); - Assert.IsTrue(m.OurPartial.Contains("bob")); - Assert.IsTrue(m.TheirPartial.Contains("sally")); + Assert.That(m.OurPartial, Does.Contain("bob")); + Assert.That(m.TheirPartial, Does.Contain("sally")); } private void AssertLeftNoMergeArtifacts(Merge m) { - Assert.IsFalse(m.LeastCommonDenominator.Contains("<<<<")); - Assert.IsFalse(m.LeastCommonDenominator.Contains(">>>>")); - Assert.IsFalse(m.LeastCommonDenominator.Contains("====")); - Assert.IsFalse(m.OurPartial.Contains("<<<<")); - Assert.IsFalse(m.OurPartial.Contains("====")); - Assert.IsFalse(m.OurPartial.Contains(">>>>")); - Assert.IsFalse(m.TheirPartial.Contains("<<<<")); - Assert.IsFalse(m.TheirPartial.Contains("====")); - Assert.IsFalse(m.TheirPartial.Contains(">>>>")); + Assert.That(m.LeastCommonDenominator, Does.Not.Contain("<<<<")); + Assert.That(m.LeastCommonDenominator, Does.Not.Contain(">>>>")); + Assert.That(m.LeastCommonDenominator, Does.Not.Contain("====")); + Assert.That(m.OurPartial, Does.Not.Contain("<<<<")); + Assert.That(m.OurPartial, Does.Not.Contain("====")); + Assert.That(m.OurPartial, Does.Not.Contain(">>>>")); + Assert.That(m.TheirPartial, Does.Not.Contain("<<<<")); + Assert.That(m.TheirPartial, Does.Not.Contain("====")); + Assert.That(m.TheirPartial, Does.Not.Contain(">>>>")); } [Test] @@ -57,18 +57,18 @@ public void CanGetPartialMergeForUser() m.Go(); AssertLeftNoMergeArtifacts(m); - Assert.IsTrue(m.LeastCommonDenominator.Contains("two")); - Assert.IsTrue(m.LeastCommonDenominator.Contains("bob4")); - Assert.IsTrue(m.LeastCommonDenominator.Contains("sally6")); + Assert.That(m.LeastCommonDenominator, Does.Contain("two")); + Assert.That(m.LeastCommonDenominator, Does.Contain("bob4")); + Assert.That(m.LeastCommonDenominator, Does.Contain("sally6")); - Assert.IsTrue(m.OurPartial.Contains("bob2")); - Assert.IsTrue(m.OurPartial.Contains("bob4")); - Assert.IsTrue(m.OurPartial.Contains("sally6")); + Assert.That(m.OurPartial, Does.Contain("bob2")); + Assert.That(m.OurPartial, Does.Contain("bob4")); + Assert.That(m.OurPartial, Does.Contain("sally6")); - Assert.IsTrue(m.TheirPartial.Contains("sally2")); - Assert.IsTrue(m.TheirPartial.Contains("bob4")); - Assert.IsTrue(m.TheirPartial.Contains("sally6")); + Assert.That(m.TheirPartial, Does.Contain("sally2")); + Assert.That(m.TheirPartial, Does.Contain("bob4")); + Assert.That(m.TheirPartial, Does.Contain("sally6")); } class Merge diff --git a/src/LibChorusTests/utilities/XmlUtilitiesTests.cs b/src/LibChorusTests/utilities/XmlUtilitiesTests.cs index 4fcf6bcec..35c99a6a4 100644 --- a/src/LibChorusTests/utilities/XmlUtilitiesTests.cs +++ b/src/LibChorusTests/utilities/XmlUtilitiesTests.cs @@ -30,8 +30,8 @@ public void ClosedNodeAndNewTextAreNotEqual() @""; const string theirs = @"New foo text."; - Assert.IsFalse(XmlUtilities.AreXmlElementsEqual(ours, theirs)); - Assert.IsFalse(XmlUtilities.AreXmlElementsEqual(theirs, ours)); + Assert.That(XmlUtilities.AreXmlElementsEqual(ours, theirs), Is.False); + Assert.That(XmlUtilities.AreXmlElementsEqual(theirs, ours), Is.False); } [Test] @@ -52,8 +52,8 @@ public void ClosedNodeAndNewTextWithAttributesAreNotEqual() @""; const string theirs = @"New foo text."; - Assert.IsFalse(XmlUtilities.AreXmlElementsEqual(ours, theirs)); - Assert.IsFalse(XmlUtilities.AreXmlElementsEqual(theirs, ours)); + Assert.That(XmlUtilities.AreXmlElementsEqual(ours, theirs), Is.False); + Assert.That(XmlUtilities.AreXmlElementsEqual(theirs, ours), Is.False); } [Test] @@ -82,8 +82,8 @@ public void NestedClosedNodeAndTextWithAttributesAreNotEqual() @" new stuff. "; - Assert.IsFalse(XmlUtilities.AreXmlElementsEqual(ours, theirs)); - Assert.IsFalse(XmlUtilities.AreXmlElementsEqual(theirs, ours)); + Assert.That(XmlUtilities.AreXmlElementsEqual(ours, theirs), Is.False); + Assert.That(XmlUtilities.AreXmlElementsEqual(theirs, ours), Is.False); } [Test] @@ -168,8 +168,8 @@ public void EquivalentByteArraysAreEqual() "); - Assert.IsTrue(XmlUtilities.AreXmlElementsEqual(ours, theirs), "ours != theirs"); - Assert.IsTrue(XmlUtilities.AreXmlElementsEqual(theirs, ours), "theirs != ours"); + Assert.That(XmlUtilities.AreXmlElementsEqual(ours, theirs), Is.True, "ours != theirs"); + Assert.That(XmlUtilities.AreXmlElementsEqual(theirs, ours), Is.True, "theirs != ours"); } [Test] @@ -178,8 +178,8 @@ public void NonEquivalentByteArraysAreNotEqual() var ours = Encoding.UTF8.GetBytes(@""); var theirs = Encoding.UTF8.GetBytes(@""); - Assert.IsFalse(XmlUtilities.AreXmlElementsEqual(ours, theirs), "ours == theirs"); - Assert.IsFalse(XmlUtilities.AreXmlElementsEqual(theirs, ours), "theirs == ours"); + Assert.That(XmlUtilities.AreXmlElementsEqual(ours, theirs), Is.False, "ours == theirs"); + Assert.That(XmlUtilities.AreXmlElementsEqual(theirs, ours), Is.False, "theirs == ours"); } #region IsTextNodeContainer @@ -245,13 +245,13 @@ public void NonNullElementsWithNoChildNodesIsNotTextlevel() var ours = doc.CreateElement("myelement"); var theirs = doc.CreateElement("myelement"); var ancestor = doc.CreateElement("myelement"); - Assert.IsFalse(XmlUtilities.IsTextLevel(ours, theirs, ancestor)); + Assert.That(XmlUtilities.IsTextLevel(ours, theirs, ancestor), Is.False); } [Test] public void AllNullsIsNotTextlevel() { - Assert.IsFalse(XmlUtilities.IsTextLevel(null, null, null)); + Assert.That(XmlUtilities.IsTextLevel(null, null, null), Is.False); } #endregion IsTextLevel @@ -267,7 +267,7 @@ public void ReplaceOursWithTheirs_OursNullTheirsNot() XmlNode theirs = theirDoc.FirstChild; XmlUtilities.ReplaceOursWithTheirs(ourDoc, ref ours, theirs); Assert.AreSame(ourDoc.OwnerDocument, ours.OwnerDocument); - Assert.IsTrue(XmlUtilities.AreXmlElementsEqual(theirs, ours), "theirs != ours"); + Assert.That(XmlUtilities.AreXmlElementsEqual(theirs, ours), Is.True, "theirs != ours"); } [Test] @@ -279,7 +279,7 @@ public void ReplaceOursWithTheirs_OursNotNullTheirsNotNull() XmlNode theirs = theirDoc.FirstChild; XmlUtilities.ReplaceOursWithTheirs(ourDoc, ref ours, theirs); Assert.AreSame(ourDoc.OwnerDocument, ours.OwnerDocument, "Returned node not in inserted into our parent document"); - Assert.IsTrue(XmlUtilities.AreXmlElementsEqual(theirs, ours), "theirs != ours"); + Assert.That(XmlUtilities.AreXmlElementsEqual(theirs, ours), Is.True, "theirs != ours"); } [Test] diff --git a/src/SampleApp/Properties/AssemblyInfo.cs b/src/SampleApp/Properties/AssemblyInfo.cs deleted file mode 100644 index 561e2cb61..000000000 --- a/src/SampleApp/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("SampleApp")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] -[assembly: AssemblyProduct("SampleApp")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2010")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("4ea00732-b76e-4178-b809-cccb193eadd2")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/SampleApp/Properties/Resources.Designer.cs b/src/SampleApp/Properties/Resources.Designer.cs index 184fd42ac..295e5833e 100644 --- a/src/SampleApp/Properties/Resources.Designer.cs +++ b/src/SampleApp/Properties/Resources.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.17626 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -9,65 +9,65 @@ //------------------------------------------------------------------------------ namespace SampleApp.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SampleApp.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized resource of type System.Byte[]. - /// - internal static byte[] ShoppingList { - get { - object obj = ResourceManager.GetObject("ShoppingList", resourceCulture); - return ((byte[])(obj)); - } - } - } + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SampleApp.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized resource of type System.Byte[]. + /// + internal static byte[] ShoppingList { + get { + object obj = ResourceManager.GetObject("ShoppingList", resourceCulture); + return ((byte[])(obj)); + } + } + } } diff --git a/src/SampleApp/Properties/Settings.Designer.cs b/src/SampleApp/Properties/Settings.Designer.cs index 5ca9bd492..f264c05a1 100644 --- a/src/SampleApp/Properties/Settings.Designer.cs +++ b/src/SampleApp/Properties/Settings.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.17626 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -9,18 +9,18 @@ //------------------------------------------------------------------------------ namespace SampleApp.Properties { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default { - get { - return defaultInstance; - } - } - } + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } } diff --git a/src/SampleApp/SampleApp.csproj b/src/SampleApp/SampleApp.csproj index cdaa7aaa1..327d5bb08 100644 --- a/src/SampleApp/SampleApp.csproj +++ b/src/SampleApp/SampleApp.csproj @@ -1,225 +1,66 @@ - - + + - Debug - AnyCPU - 9.0.21022 - 2.0 - {550854F0-9247-42C5-B41D-08E96CC17F92} - WinExe - Properties + net461 SampleApp - SampleApp - 512 - - - 3.5 - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - v4.6.1 - - - True - full - False - ..\..\output\Debug - DEBUG;TRACE - prompt - 4 - AnyCPU - false - 6 + SampleApp + Debug;Release + Sample app for chorus. + SIL International + SIL International + chorus + Copyright © 2010-2020 SIL International + ../../output/$(Configuration) + true + ../FieldWorks.snk + None + WinExe + false 1591 + false - - pdbonly - True - ..\..\output\Release - TRACE - prompt - 4 - AnyCPU - false - 6 - - - True - ..\..\output\DebugMono - DEBUG;TRACE;MONO - full - AnyCPU - prompt - - - 4 - False - false - 6 - - - ..\..\output\ReleaseMono - TRACE;MONO - True - pdbonly - AnyCPU - prompt - - - 4 - false - 6 - - - true - ..\..\output\Debug\ - DEBUG;TRACE - full - AnyCPU - 6 - prompt - MinimumRecommendedRules.ruleset - - - ..\..\output\Release\ - TRACE - true - pdbonly - AnyCPU - 6 - prompt - MinimumRecommendedRules.ruleset - - - - False - ..\..\lib\Debug\SIL.Core.dll - - - - - False - ..\..\lib\Release\SIL.Core.dll - - - - - False - ..\..\lib\DebugMono\SIL.Core.dll - - - - - False - ..\..\lib\ReleaseMono\SIL.Core.dll - + + + + + + - - ..\..\packages\ICSharpCode.SharpZipLib.Patched.0.86.5\lib\net20\ICSharpCode.SharpZipLib.dll - - - - - - - ..\..\packages\Vulcan.Uczniowie.HelpProvider.1.0.16\lib\net461\Vulcan.Uczniowie.HelpProvider.dll - True - + - - UserControl - - - DataEditor.cs - - - Form - - - Form1.cs - - - - - DataEditor.cs - Designer - - - Form1.cs - Designer - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - + + + + + + True True Resources.resx - True - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - + + True True Settings.settings - True - - - - - {9DA5A655-1881-4BE1-81BA-256E47CF7537} - Chorus - - - {94245366-8F1E-475C-810D-FE89BB3948E0} - LibChorus - + + SettingsSingleFileGenerator + Settings.Designer.cs + + - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - + + ResXFileCodeGenerator + Resources.Designer.cs + - - + + + + $(AssemblySearchPaths);{GAC} + + diff --git a/src/SampleApp/packages.config b/src/SampleApp/packages.config deleted file mode 100644 index 7816339e1..000000000 --- a/src/SampleApp/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/Tests-ChorusPlugin/Properties/AssemblyInfo.cs b/src/Tests-ChorusPlugin/Properties/AssemblyInfo.cs deleted file mode 100644 index 6017b8a8e..000000000 --- a/src/Tests-ChorusPlugin/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Tests-ChorusPlugin")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] -[assembly: AssemblyProduct("Tests-ChorusPlugin")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2011")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("a91aef34-0ee7-4f5b-a3ea-368dfd65de5e")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/Tests-ChorusPlugin/Tests-ChorusPlugin.csproj b/src/Tests-ChorusPlugin/Tests-ChorusPlugin.csproj index 7952a18c3..d3f50501d 100644 --- a/src/Tests-ChorusPlugin/Tests-ChorusPlugin.csproj +++ b/src/Tests-ChorusPlugin/Tests-ChorusPlugin.csproj @@ -1,134 +1,46 @@ - - + + - Debug - AnyCPU - 9.0.21022 - 2.0 - {1E6F4881-AA72-4AC7-B411-7B7E00C30C25} - Library - Properties + net461 Tests_ChorusPlugin - Tests-ChorusPlugin - 512 - v4.6.1 - - - True - full - False - ..\..\output\SamplePlugin\ - DEBUG;TRACE - prompt - 4 - AnyCPU - false - 6 + Tests-ChorusPlugin + Debug;Release + Sample Chorus plugin + SIL International + SIL International + chorus + Copyright © 2010-2020 SIL International + ../../output/SamplePlugin/$(Configuration) + true + ../FieldWorks.snk + false 1591 - - - pdbonly - True - ..\..\output\SamplePlugin\ - TRACE - prompt - 4 - AnyCPU - false - 6 - - - True - ..\..\output\SamplePlugin\ - TRACE;DEBUG;MONO - prompt - full - AnyCPU - - - 4 - False - false - 6 - - - ..\..\output\SamplePlugin\ - TRACE;MONO - prompt - True - pdbonly - AnyCPU - - - 4 - false - 6 - - - true - ..\..\output\Debug\ - DEBUG;TRACE - full + false + AnyCPU - 6 - prompt - MinimumRecommendedRules.ruleset + win7-x86;win7-x64 - - ..\..\output\Release\ - TRACE - true - pdbonly - AnyCPU - 6 - prompt - MinimumRecommendedRules.ruleset - - - - False - ..\..\lib\Debug\SIL.Core.dll - - - - - False - ..\..\lib\Release\SIL.Core.dll - - - - - False - ..\..\lib\DebugMono\SIL.Core.dll - - - - - False - ..\..\lib\ReleaseMono\SIL.Core.dll - - + - - - + + + + - - + + - - {94245366-8F1E-475C-810D-FE89BB3948E0} - LibChorus - + - - + + + + $(AssemblySearchPaths);{GAC} + + \ No newline at end of file