From 6b4929423c7e9fa58ffdafd22bf6e530af861d94 Mon Sep 17 00:00:00 2001 From: Rene Evertz Date: Tue, 6 Aug 2024 11:48:56 +0200 Subject: [PATCH] =?UTF-8?q?Translation=20Unit=20Tests=20->=20Probleme=20be?= =?UTF-8?q?im=20Einf=C3=BCgen=20von=20UserRights?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + BeWoTests.sln | 18 +++++ TranslationUnitTest/EnumTranslation.cs | 28 +++++++ .../Properties/AssemblyInfo.cs | 20 +++++ .../TranslationUnitTest.csproj | 74 +++++++++++++++++++ TranslationUnitTest/packages.config | 5 ++ 6 files changed, 146 insertions(+) create mode 100644 TranslationUnitTest/EnumTranslation.cs create mode 100644 TranslationUnitTest/Properties/AssemblyInfo.cs create mode 100644 TranslationUnitTest/TranslationUnitTest.csproj create mode 100644 TranslationUnitTest/packages.config diff --git a/.gitignore b/.gitignore index 9a7b012d0..7f314c138 100644 --- a/.gitignore +++ b/.gitignore @@ -631,3 +631,4 @@ obj /BeWoDatabaseTerminator/BeWoDatabaseTerminator/bin/Debug /BeWoDatabaseTerminator/BeWoDatabaseTerminator/bin/Release /ReportImp/TestLWV +/TranslationUnitTest/bin diff --git a/BeWoTests.sln b/BeWoTests.sln index ac36fd2ed..f9a4282df 100644 --- a/BeWoTests.sln +++ b/BeWoTests.sln @@ -39,6 +39,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Wohneinheit", "Wohneinheit" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WohneinheitUnitTest", "WohneinheitUnitTest\WohneinheitUnitTest.csproj", "{7630915F-DFE4-45A4-A7B1-B6D19B0126C1}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Translation", "Translation", "{B331128C-7E9F-4BDC-B509-A8DAE1B94E5C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TranslationUnitTest", "TranslationUnitTest\TranslationUnitTest.csproj", "{83C43FEC-233D-49EF-BD23-BF842A3EBDF5}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|.NET = Debug|.NET @@ -173,6 +177,18 @@ Global {7630915F-DFE4-45A4-A7B1-B6D19B0126C1}.Release|Any CPU.Build.0 = Release|Any CPU {7630915F-DFE4-45A4-A7B1-B6D19B0126C1}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {7630915F-DFE4-45A4-A7B1-B6D19B0126C1}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {83C43FEC-233D-49EF-BD23-BF842A3EBDF5}.Debug|.NET.ActiveCfg = Debug|Any CPU + {83C43FEC-233D-49EF-BD23-BF842A3EBDF5}.Debug|.NET.Build.0 = Debug|Any CPU + {83C43FEC-233D-49EF-BD23-BF842A3EBDF5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {83C43FEC-233D-49EF-BD23-BF842A3EBDF5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {83C43FEC-233D-49EF-BD23-BF842A3EBDF5}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {83C43FEC-233D-49EF-BD23-BF842A3EBDF5}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {83C43FEC-233D-49EF-BD23-BF842A3EBDF5}.Release|.NET.ActiveCfg = Release|Any CPU + {83C43FEC-233D-49EF-BD23-BF842A3EBDF5}.Release|.NET.Build.0 = Release|Any CPU + {83C43FEC-233D-49EF-BD23-BF842A3EBDF5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {83C43FEC-233D-49EF-BD23-BF842A3EBDF5}.Release|Any CPU.Build.0 = Release|Any CPU + {83C43FEC-233D-49EF-BD23-BF842A3EBDF5}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {83C43FEC-233D-49EF-BD23-BF842A3EBDF5}.Release|Mixed Platforms.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -189,6 +205,8 @@ Global {47331732-DD96-4075-869F-83AA9F3F9937} = {FEB0336B-F053-40B6-92DD-7DE56AB9408A} {2F7893AD-34FC-40A2-838A-3D2D8596E9AC} = {CCD6B644-49E7-4A11-BD8F-607088A4AC83} {7630915F-DFE4-45A4-A7B1-B6D19B0126C1} = {2F7893AD-34FC-40A2-838A-3D2D8596E9AC} + {B331128C-7E9F-4BDC-B509-A8DAE1B94E5C} = {CCD6B644-49E7-4A11-BD8F-607088A4AC83} + {83C43FEC-233D-49EF-BD23-BF842A3EBDF5} = {B331128C-7E9F-4BDC-B509-A8DAE1B94E5C} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {5352BE53-F2FD-442F-85A8-4157599AA153} diff --git a/TranslationUnitTest/EnumTranslation.cs b/TranslationUnitTest/EnumTranslation.cs new file mode 100644 index 000000000..a7cc93483 --- /dev/null +++ b/TranslationUnitTest/EnumTranslation.cs @@ -0,0 +1,28 @@ +using BS.Shared; +using BS.Shared.Core; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; + +namespace TranslationUnitTest +{ + [TestClass] + public class EnumTranslation + { + [TestInitialize] + public void Init() + { + + } + + [TestMethod] + public void UserRightType2TranslationsComplete() + { + var dict = EnumTranslations.UserRightType2Translations; + foreach (UserRightType item in Enum.GetValues(typeof(UserRightType))) + { + if (item != UserRightType.None && !dict.ContainsKey(item)) + Assert.Fail($"UserRight \"{item}\" hat keine Übersetzung in {nameof(EnumTranslations.UserRightType2Translations)}"); + } + } + } +} diff --git a/TranslationUnitTest/Properties/AssemblyInfo.cs b/TranslationUnitTest/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..a63558a99 --- /dev/null +++ b/TranslationUnitTest/Properties/AssemblyInfo.cs @@ -0,0 +1,20 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("TranslationUnitTest")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("TranslationUnitTest")] +[assembly: AssemblyCopyright("Copyright © 2024")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +[assembly: ComVisible(false)] + +[assembly: Guid("83c43fec-233d-49ef-bd23-bf842a3ebdf5")] + +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/TranslationUnitTest/TranslationUnitTest.csproj b/TranslationUnitTest/TranslationUnitTest.csproj new file mode 100644 index 000000000..fbe387df2 --- /dev/null +++ b/TranslationUnitTest/TranslationUnitTest.csproj @@ -0,0 +1,74 @@ + + + + + + Debug + AnyCPU + {83C43FEC-233D-49EF-BD23-BF842A3EBDF5} + Library + Properties + TranslationUnitTest + TranslationUnitTest + v4.7.2 + 512 + {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 15.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages + False + UnitTest + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\MSTest.TestFramework.2.1.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll + + + ..\packages\MSTest.TestFramework.2.1.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll + + + + + + + + + + + + + + {2F50B83D-A3F0-4EC4-979A-3F9B7E3D8ED4} + Shared + + + + + + + Dieses Projekt verweist auf mindestens ein NuGet-Paket, das auf diesem Computer fehlt. Verwenden Sie die Wiederherstellung von NuGet-Paketen, um die fehlenden Dateien herunterzuladen. Weitere Informationen finden Sie unter "http://go.microsoft.com/fwlink/?LinkID=322105". Die fehlende Datei ist "{0}". + + + + + + \ No newline at end of file diff --git a/TranslationUnitTest/packages.config b/TranslationUnitTest/packages.config new file mode 100644 index 000000000..f84cb1064 --- /dev/null +++ b/TranslationUnitTest/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file