/UnitTests/GitCommandsTests/Patches/testdata/big.patch
Patch | 440 lines | 423 code | 17 blank | 0 comment | 0 complexity | f773a97e79c7d9f8155751c0161038f9 MD5 | raw file
1From 95db80d3941b930282b8ae2ae4ffe4765b580af1 Mon Sep 17 00:00:00 2001 2From: =?UTF-8?q?Janusz=20Bia=C5=82obrzewski?= <jbialobr@o2.pl> 3Date: Mon, 8 Apr 2013 20:11:52 +0200 4Subject: [PATCH] GitCommandsTest renamed to GitExtensionsTest. TranslationTest 5 restored. 6 7--- 8 GitCommands/CommitInformationTest.cs | 2 +- 9 GitCommands/Config/ConfigFileTest.cs | 2 +- 10 GitCommands/Git/EncodingHelperTest.cs | 2 +- 11 GitCommands/Git/GitBlameHeaderTest.cs | 2 +- 12 GitCommands/Git/GitBlameTest.cs | 2 +- 13 GitCommands/Git/GitCheckoutBranchCmdTest.cs | 2 +- 14 GitCommands/Git/GitCommandCacheTest.cs | 2 +- 15 GitCommands/Git/GitCommandHelpersTest.cs | 2 +- 16 GitCommands/Helpers/FileInfoExtensions.cs | 2 +- 17 GitCommands/Helpers/FileInfoExtensionsTest.cs | 2 +- 18 GitCommands/Patch/PatchManagerTest.cs | 2 +- 19 GitCommands/Patch/PatchTest.cs | 2 +- 20 GitCommands/TestResource.Designer.cs | 70 ---------------------- 21 ...CommandsTest.csproj => GitExtensionsTest.csproj | 54 ++++++++++------- 22 .../Properties => Properties}/AssemblyInfo.cs | 0 23 Translation/TranslationTest.cs | 54 +++++++++++++++++ 24 GitCommands/packages.config => packages.config | 0 25 17 files changed, 98 insertions(+), 104 deletions(-) 26 delete mode 100644 GitCommands/TestResource.Designer.cs 27 rename GitCommands/GitCommandsTest.csproj => GitExtensionsTest.csproj (60%) 28 rename {GitCommands/Properties => Properties}/AssemblyInfo.cs (100%) 29 create mode 100644 Translation/TranslationTest.cs 30 rename GitCommands/packages.config => packages.config (100%) 31 32diff --git a/GitCommands/CommitInformationTest.cs b/GitCommands/CommitInformationTest.cs 33index 7b6bec8..6e3ba67 100644 34--- a/GitCommands/CommitInformationTest.cs 35+++ b/GitCommands/CommitInformationTest.cs 36@@ -10,7 +10,7 @@ using System; 37 using System.Linq; 38 using GitCommands; 39 40-namespace GitCommandsTest 41+namespace GitExtensionsTest 42 { 43 [TestClass] 44 public class CommitInformationTest 45diff --git a/GitCommands/Config/ConfigFileTest.cs b/GitCommands/Config/ConfigFileTest.cs 46index db87390..62281a9 100644 47--- a/GitCommands/Config/ConfigFileTest.cs 48+++ b/GitCommands/Config/ConfigFileTest.cs 49@@ -14,7 +14,7 @@ using System.IO; 50 using GitCommands; 51 using GitCommands.Config; 52 53-namespace GitCommandsTest.Config 54+namespace GitExtensionsTest.Config 55 { 56 /// <summary> 57 /// Tests for configfile class. 58diff --git a/GitCommands/Git/EncodingHelperTest.cs b/GitCommands/Git/EncodingHelperTest.cs 59index de136d1..72fc48e 100644 60--- a/GitCommands/Git/EncodingHelperTest.cs 61+++ b/GitCommands/Git/EncodingHelperTest.cs 62@@ -11,7 +11,7 @@ using System.Text; 63 using GitCommands; 64 using System.Collections.Generic; 65 66-namespace GitCommandsTest.Git 67+namespace GitExtensionsTest.Git 68 { 69 [TestClass] 70 public class EncodingHelperTest 71diff --git a/GitCommands/Git/GitBlameHeaderTest.cs b/GitCommands/Git/GitBlameHeaderTest.cs 72index 116d892..26c5f08 100644 73--- a/GitCommands/Git/GitBlameHeaderTest.cs 74+++ b/GitCommands/Git/GitBlameHeaderTest.cs 75@@ -12,7 +12,7 @@ using GitCommands; 76 using System.Collections.Generic; 77 using System.Drawing; 78 79-namespace GitCommandsTest.Git 80+namespace GitExtensionsTest.Git 81 { 82 83 [TestClass] 84diff --git a/GitCommands/Git/GitBlameTest.cs b/GitCommands/Git/GitBlameTest.cs 85index 2537711..b2d582c 100644 86--- a/GitCommands/Git/GitBlameTest.cs 87+++ b/GitCommands/Git/GitBlameTest.cs 88@@ -11,7 +11,7 @@ using System.Text; 89 using GitCommands; 90 using System.Collections.Generic; 91 92-namespace GitCommandsTest.Git 93+namespace GitExtensionsTest.Git 94 { 95 [TestClass] 96 public class GitBlameTest 97diff --git a/GitCommands/Git/GitCheckoutBranchCmdTest.cs b/GitCommands/Git/GitCheckoutBranchCmdTest.cs 98index 8ac8a96..8d8fee3 100644 99--- a/GitCommands/Git/GitCheckoutBranchCmdTest.cs 100+++ b/GitCommands/Git/GitCheckoutBranchCmdTest.cs 101@@ -11,7 +11,7 @@ using System.Collections.Generic; 102 using System.Linq; 103 using GitCommands.Git; 104 105-namespace GitCommandsTest.Git 106+namespace GitExtensionsTest.Git 107 { 108 [TestClass] 109 public class GitCheckoutBranchCmdTest 110diff --git a/GitCommands/Git/GitCommandCacheTest.cs b/GitCommands/Git/GitCommandCacheTest.cs 111index a513c57..b8192fb 100644 112--- a/GitCommands/Git/GitCommandCacheTest.cs 113+++ b/GitCommands/Git/GitCommandCacheTest.cs 114@@ -11,7 +11,7 @@ using System.Linq; 115 using GitCommands; 116 using System.Collections.Generic; 117 118-namespace GitCommandsTest.Git 119+namespace GitExtensionsTest.Git 120 { 121 122 [TestClass] 123diff --git a/GitCommands/Git/GitCommandHelpersTest.cs b/GitCommands/Git/GitCommandHelpersTest.cs 124index 387c472..7ba7895 100644 125--- a/GitCommands/Git/GitCommandHelpersTest.cs 126+++ b/GitCommands/Git/GitCommandHelpersTest.cs 127@@ -10,7 +10,7 @@ using System; 128 using GitCommands; 129 using System.Collections.Generic; 130 131-namespace GitCommandsTest.Git 132+namespace GitExtensionsTest.Git 133 { 134 [TestClass] 135 public class GitCommandsHelperTest 136diff --git a/GitCommands/Helpers/FileInfoExtensions.cs b/GitCommands/Helpers/FileInfoExtensions.cs 137index fd69608..418978d 100644 138--- a/GitCommands/Helpers/FileInfoExtensions.cs 139+++ b/GitCommands/Helpers/FileInfoExtensions.cs 140@@ -7,7 +7,7 @@ using System.Text; 141 using System.Security.Cryptography; 142 using System.Threading.Tasks; 143 144-namespace GitCommandsTest.Helpers 145+namespace GitExtensionsTest.Helpers 146 { 147 public static class FileInfoExtensions 148 { 149diff --git a/GitCommands/Helpers/FileInfoExtensionsTest.cs b/GitCommands/Helpers/FileInfoExtensionsTest.cs 150index c6017c8..ab44f62 100644 151--- a/GitCommands/Helpers/FileInfoExtensionsTest.cs 152+++ b/GitCommands/Helpers/FileInfoExtensionsTest.cs 153@@ -14,7 +14,7 @@ using System.Collections.Generic; 154 using System.Linq; 155 using System.Text; 156 157-namespace GitCommandsTest.Helpers 158+namespace GitExtensionsTest.Helpers 159 { 160 [TestClass] 161 public class FileInfoExtensionsTest 162diff --git a/GitCommands/Patch/PatchManagerTest.cs b/GitCommands/Patch/PatchManagerTest.cs 163index ad6627f..f4745b8 100644 164--- a/GitCommands/Patch/PatchManagerTest.cs 165+++ b/GitCommands/Patch/PatchManagerTest.cs 166@@ -12,7 +12,7 @@ using System.Collections.Generic; 167 using System.Linq; 168 using System.Text; 169 170-namespace GitCommandsTest.Patch 171+namespace GitExtensionsTest.Patch 172 { 173 [TestClass] 174 class PatchManagerTest 175diff --git a/GitCommands/Patch/PatchTest.cs b/GitCommands/Patch/PatchTest.cs 176index e7ddd17..5fdad9a 100644 177--- a/GitCommands/Patch/PatchTest.cs 178+++ b/GitCommands/Patch/PatchTest.cs 179@@ -11,7 +11,7 @@ using System.Collections.Generic; 180 using System.Linq; 181 using System.Text; 182 183-namespace GitCommandsTest.Patch 184+namespace GitExtensionsTest.Patch 185 { 186 [TestClass] 187 class PatchTest 188diff --git a/GitCommands/TestResource.Designer.cs b/GitCommands/TestResource.Designer.cs 189deleted file mode 100644 190index 586c3fd..0000000 191--- a/GitCommands/TestResource.Designer.cs 192+++ /dev/null 193@@ -1,70 +0,0 @@ 194-//------------------------------------------------------------------------------ 195-// <auto-generated> 196-// This code was generated by a tool. 197-// Runtime Version:4.0.30319.1 198-// 199-// Changes to this file may cause incorrect behavior and will be lost if 200-// the code is regenerated. 201-// </auto-generated> 202-//------------------------------------------------------------------------------ 203- 204-namespace GitCommandsTests 205-{ 206- 207- 208- /// <summary> 209- /// A strongly-typed resource class, for looking up localized strings, etc. 210- /// </summary> 211- // This class was auto-generated by the StronglyTypedResourceBuilder 212- // class via a tool like ResGen or Visual Studio. 213- // To add or remove a member, edit your .ResX file then rerun ResGen 214- // with the /str option, or rebuild your VS project. 215- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 216- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 217- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 218- internal class TestResource { 219- 220- private static global::System.Resources.ResourceManager resourceMan; 221- 222- private static global::System.Globalization.CultureInfo resourceCulture; 223- 224- [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 225- internal TestResource() { 226- } 227- 228- /// <summary> 229- /// Returns the cached ResourceManager instance used by this class. 230- /// </summary> 231- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 232- internal static global::System.Resources.ResourceManager ResourceManager { 233- get { 234- if (object.ReferenceEquals(resourceMan, null)) { 235- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("GitCommandsTests.TestResource", typeof(TestResource).Assembly); 236- resourceMan = temp; 237- } 238- return resourceMan; 239- } 240- } 241- 242- /// <summary> 243- /// Overrides the current thread's CurrentUICulture property for all 244- /// resource lookups using this strongly typed resource class. 245- /// </summary> 246- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 247- internal static global::System.Globalization.CultureInfo Culture { 248- get { 249- return resourceCulture; 250- } 251- set { 252- resourceCulture = value; 253- } 254- } 255- 256- internal static byte[] TestPatch { 257- get { 258- object obj = ResourceManager.GetObject("TestPatch", resourceCulture); 259- return ((byte[])(obj)); 260- } 261- } 262- } 263-} 264diff --git a/GitCommands/GitCommandsTest.csproj b/GitExtensionsTest.csproj 265similarity index 60% 266rename from GitCommands/GitCommandsTest.csproj 267rename to GitExtensionsTest.csproj 268index 1a1b284..2c8496d 100644 269--- a/GitCommands/GitCommandsTest.csproj 270+++ b/GitExtensionsTest.csproj 271@@ -7,9 +7,9 @@ 272 <SchemaVersion>2.0</SchemaVersion> 273 <ProjectGuid>{AC8FDEDF-6390-4F87-BBC3-1A974810B589}</ProjectGuid> 274 <OutputType>Library</OutputType> 275- <RootNamespace>GitCommandsTest</RootNamespace> 276- <AssemblyName>GitCommandsTests</AssemblyName> 277- <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir> 278+ <RootNamespace>GitExtensionsTest</RootNamespace> 279+ <AssemblyName>GitExtensionsTest</AssemblyName> 280+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir> 281 <RestorePackages>true</RestorePackages> 282 </PropertyGroup> 283 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> 284@@ -21,7 +21,7 @@ 285 <ErrorReport>prompt</ErrorReport> 286 <WarningLevel>4</WarningLevel> 287 <ConsolePause>False</ConsolePause> 288- <CodeAnalysisRuleSet>..\..\FxCopRules.ruleset</CodeAnalysisRuleSet> 289+ <CodeAnalysisRuleSet>..\FxCopRules.ruleset</CodeAnalysisRuleSet> 290 <RunCodeAnalysis>true</RunCodeAnalysis> 291 </PropertyGroup> 292 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> 293@@ -33,48 +33,58 @@ 294 <WarningLevel>4</WarningLevel> 295 <ConsolePause>False</ConsolePause> 296 <RunCodeAnalysis>true</RunCodeAnalysis> 297- <CodeAnalysisRuleSet>..\..\FxCopRules.ruleset</CodeAnalysisRuleSet> 298+ <CodeAnalysisRuleSet>..\FxCopRules.ruleset</CodeAnalysisRuleSet> 299 </PropertyGroup> 300 <ItemGroup> 301 <Reference Include="nunit.framework, Version=2.6.2.12296, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL"> 302 <SpecificVersion>False</SpecificVersion> 303- <HintPath>..\..\packages\NUnit.2.6.2\lib\nunit.framework.dll</HintPath> 304+ <HintPath>..\packages\NUnit.2.6.2\lib\nunit.framework.dll</HintPath> 305 </Reference> 306 <Reference Include="nunit.mocks, Version=2.6.2.12296, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL"> 307 <SpecificVersion>False</SpecificVersion> 308- <HintPath>..\..\packages\NUnit.Mocks.2.6.2\lib\nunit.mocks.dll</HintPath> 309+ <HintPath>..\packages\NUnit.Mocks.2.6.2\lib\nunit.mocks.dll</HintPath> 310 </Reference> 311 <Reference Include="System" /> 312 <Reference Include="System.Drawing" /> 313 <Reference Include="System.Core" /> 314+ <Reference Include="System.Windows.Forms" /> 315 </ItemGroup> 316 <ItemGroup> 317- <Compile Include="CommitInformationTest.cs" /> 318- <Compile Include="Config\ConfigFileTest.cs" /> 319- <Compile Include="Git\GitCommandHelpersTest.cs" /> 320- <Compile Include="Git\EncodingHelperTest.cs" /> 321- <Compile Include="Helpers\FileInfoExtensions.cs" /> 322- <Compile Include="Helpers\FileInfoExtensionsTest.cs" /> 323- <Compile Include="Patch\PatchManagerTest.cs" /> 324- <Compile Include="Patch\PatchTest.cs" /> 325+ <Compile Include="GitCommands\CommitInformationTest.cs" /> 326+ <Compile Include="GitCommands\Config\ConfigFileTest.cs" /> 327+ <Compile Include="GitCommands\Git\GitCommandHelpersTest.cs" /> 328+ <Compile Include="GitCommands\Git\EncodingHelperTest.cs" /> 329+ <Compile Include="GitCommands\Helpers\FileInfoExtensions.cs" /> 330+ <Compile Include="GitCommands\Helpers\FileInfoExtensionsTest.cs" /> 331+ <Compile Include="GitCommands\Patch\PatchManagerTest.cs" /> 332+ <Compile Include="GitCommands\Patch\PatchTest.cs" /> 333 <Compile Include="Properties\AssemblyInfo.cs" /> 334- <Compile Include="Git\GitBlameTest.cs" /> 335- <Compile Include="Git\GitBlameHeaderTest.cs" /> 336- <Compile Include="Git\GitCheckoutBranchCmdTest.cs" /> 337- <Compile Include="Git\GitCommandCacheTest.cs" /> 338+ <Compile Include="GitCommands\Git\GitBlameTest.cs" /> 339+ <Compile Include="GitCommands\Git\GitBlameHeaderTest.cs" /> 340+ <Compile Include="GitCommands\Git\GitCheckoutBranchCmdTest.cs" /> 341+ <Compile Include="GitCommands\Git\GitCommandCacheTest.cs" /> 342+ <Compile Include="Translation\TranslationTest.cs" /> 343 </ItemGroup> 344 <ItemGroup> 345- <ProjectReference Include="..\..\GitCommands\GitCommands.csproj"> 346+ <ProjectReference Include="..\GitCommands\GitCommands.csproj"> 347 <Project>{BD6AA2A2-997D-4AFF-ACC7-B64F6E51D181}</Project> 348 <Name>GitCommands</Name> 349 </ProjectReference> 350- <ProjectReference Include="..\..\Plugins\GitUIPluginInterfaces\GitUIPluginInterfaces.csproj"> 351+ <ProjectReference Include="..\GitUI\GitUI.csproj"> 352+ <Project>{CF5B22E7-230F-4E50-BE88-C4F7023CED2C}</Project> 353+ <Name>GitUI</Name> 354+ </ProjectReference> 355+ <ProjectReference Include="..\Plugins\GitUIPluginInterfaces\GitUIPluginInterfaces.csproj"> 356 <Project>{27559302-F35E-4B62-A6EC-11FF21A5FA6F}</Project> 357 <Name>GitUIPluginInterfaces</Name> 358 </ProjectReference> 359+ <ProjectReference Include="..\ResourceManager\ResourceManager.csproj"> 360+ <Project>{D3440FD7-AFC5-4351-8741-6CDBF15CE944}</Project> 361+ <Name>ResourceManager</Name> 362+ </ProjectReference> 363 </ItemGroup> 364 <ItemGroup> 365- <Folder Include="Patch\testdata\" /> 366+ <Folder Include="GitCommands\Patch\testdata\" /> 367 </ItemGroup> 368 <ItemGroup> 369 <None Include="packages.config" /> 370diff --git a/GitCommands/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs 371similarity index 100% 372rename from GitCommands/Properties/AssemblyInfo.cs 373rename to Properties/AssemblyInfo.cs 374diff --git a/Translation/TranslationTest.cs b/Translation/TranslationTest.cs 375new file mode 100644 376index 0000000..19a57aa 377--- /dev/null 378+++ b/Translation/TranslationTest.cs 379@@ -0,0 +1,54 @@ 380+#if !NUNIT 381+using Microsoft.VisualStudio.TestTools.UnitTesting; 382+using Category = Microsoft.VisualStudio.TestTools.UnitTesting.DescriptionAttribute; 383+#else 384+using NUnit.Framework; 385+using TestInitialize = NUnit.Framework.SetUpAttribute; 386+using TestContext = System.Object; 387+using TestProperty = NUnit.Framework.PropertyAttribute; 388+using TestClass = NUnit.Framework.TestFixtureAttribute; 389+using TestMethod = NUnit.Framework.TestAttribute; 390+using TestCleanup = NUnit.Framework.TearDownAttribute; 391+#endif 392+using GitUI; 393+using System; 394+using System.Collections.Generic; 395+using System.Diagnostics; 396+using System.Reflection; 397+using ResourceManager.Translation; 398+ 399+ 400+namespace GitExtensionsTest.Translation 401+{ 402+ [TestClass] 403+ public class TranslationTest 404+ { 405+ 406+ [TestMethod] 407+ [STAThread] 408+ public void CreateInstanceOfClass() 409+ { 410+ // just reference to GitUI 411+ MouseWheelRedirector.Active = true; 412+ 413+ List<Type> translatableTypes = TranslationUtl.GetTranslatableTypes(); 414+ 415+ ResourceManager.Translation.Translation testTranslation = new ResourceManager.Translation.Translation(); 416+ 417+ foreach (Type type in translatableTypes) 418+ { 419+ try 420+ { 421+ ITranslate obj = TranslationUtl.CreateInstanceOfClass(type) as ITranslate; 422+ obj.AddTranslationItems(testTranslation); 423+ obj.TranslateItems(testTranslation); 424+ } 425+ catch (System.Exception) 426+ { 427+ Trace.WriteLine("Problem with class: " + type.FullName); 428+ throw; 429+ } 430+ } 431+ } 432+ } 433+} 434diff --git a/GitCommands/packages.config b/packages.config 435similarity index 100% 436rename from GitCommands/packages.config 437rename to packages.config 438-- 4391.8.1.msysgit.1 440