PageRenderTime 54ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/UnitTests/GitCommandsTests/Patches/testdata/big.patch

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