Renaming -> Wrong T Search prevented

This commit is contained in:
2024-08-06 12:23:23 +02:00
parent ea0b9af8ee
commit f546b44bad
4 changed files with 62 additions and 47 deletions

View File

@@ -630,15 +630,17 @@ namespace BS.Shared.Core
dict.Add(UserRightType.AccountingTransactionView_Delete, Translator.Translate("Finanzen löschen"));
dict.Add(UserRightType.AccountingTransactionView_Edit, Translator.Translate("Finanzen ändern"));
dict.Add(UserRightType.AccountingTransactionView_View, Translator.Translate("Finanzen ansehen (alle)"));
dict.Add(UserRightType.AdministrationView_Create, Translator.Translate("Verwaltung anlegen"));
dict.Add(UserRightType.AdministrationView_Delete, Translator.Translate("Verwaltung löschen"));
dict.Add(UserRightType.AdministrationView_Edit, Translator.Translate("Verwaltung ändern"));
dict.Add(UserRightType.AdministrationView_View, Translator.Translate("Verwaltung ansehen"));
dict.Add(UserRightType.CustomerView_Create, Translator.Translate("Klienten") + " anlegen");
dict.Add(UserRightType.CustomerView_Delete, Translator.Translate("Klienten") + " löschen");
dict.Add(UserRightType.Customer_AllowArchiving, Translator.Translate("Klienten") + " archivieren");
dict.Add(UserRightType.CustomerView_Edit, Translator.Translate("Klienten") + " ändern");
dict.Add(UserRightType.CustomerView_View, Translator.Translate("Klienten") + " ansehen (alle)");
dict.Add(UserRightType.Customer_AllowArchiving, Translator.Translate("Klienten") + " archivieren");
dict.Add(UserRightType.Customer_ViewMyCustomers, Translator.Translate("Klienten") + " ansehen (von " + Translator.Translate("MitarbeiterSingular") + " betreut)");
dict.Add(UserRightType.Customer_ViewMyTeams, Translator.Translate("Klienten") + " ansehen (von Teams betreut)");
dict.Add(UserRightType.Customer_ViewMedication, Translator.Translate("Klienten") + " Medikation ansehen");
@@ -647,26 +649,10 @@ namespace BS.Shared.Core
dict.Add(UserRightType.Customer_ViewNotizen, Translator.Translate("Klienten") + " Notizen ansehen");
dict.Add(UserRightType.Customer_EditNotizen, Translator.Translate("Klienten") + " Notizen bearbeiten");
dict.Add(UserRightType.Customer_DeleteNotizen, Translator.Translate("Klienten") + " Notizen löschen");
dict.Add(UserRightType.DeleteAll, Translator.Translate("Alles löschen"));
dict.Add(UserRightType.EmployeeView_Create, Translator.Translate("MitarbeiterSingular") + " anlegen");
dict.Add(UserRightType.EmployeeView_Delete, Translator.Translate("MitarbeiterSingular") + " löschen");
dict.Add(UserRightType.WohnheimView_Create, Translator.Translate("Wohnprojekte anlegen"));
dict.Add(UserRightType.WohnheimView_Delete, Translator.Translate("Wohnprojekte löschen"));
dict.Add(UserRightType.WohnheimView_Edit, Translator.Translate("Wohnprojekte bearbeiten"));
dict.Add(UserRightType.WohnheimView_View, Translator.Translate("Wohnprojekte ansehen"));
dict.Add(UserRightType.Wohnheim_AllowArchiving, Translator.Translate("Wohnprojekte archivieren"));
dict.Add(UserRightType.WohnheimView_Wohneinheit_View, Translator.Translate("Wohnprojekte-> Wohneinheit ansehen"));
dict.Add(UserRightType.WohnheimView_Wohneinheit_Create, Translator.Translate("Wohnprojekte-> Wohneinheit anlegen"));
dict.Add(UserRightType.WohnheimView_Wohneinheit_Edit, Translator.Translate("Wohnprojekte-> Wohneinheit bearbeiten"));
dict.Add(UserRightType.WohnheimView_Wohneinheit_Delete, Translator.Translate("Wohnprojekte-> Wohneinheit löschen"));
dict.Add(UserRightType.WohnheimView_Wohneinheit_Belegung_View, Translator.Translate("Wohnprojekte-> Wohneinheitbelegung ansehen"));
dict.Add(UserRightType.WohnheimView_Wohneinheit_Belegung_Create, Translator.Translate("Wohnprojekte-> Wohneinheitbelegung anlegen"));
dict.Add(UserRightType.WohnheimView_Wohneinheit_Belegung_Edit, Translator.Translate("Wohnprojekte-> Wohneinheitbelegung bearbeiten"));
dict.Add(UserRightType.WohnheimView_Wohneinheit_Belegung_Delete, Translator.Translate("Wohnprojekte-> Wohneinheitbelegung löschen"));
dict.Add(UserRightType.EmployeeView_Edit, Translator.Translate("MitarbeiterSingular") + " ändern (alle)");
dict.Add(UserRightType.EmployeeView_View, Translator.Translate("MitarbeiterSingular") + " ansehen (alle)");
dict.Add(UserRightType.Employee_ShowFinance, Translator.Translate("MitarbeiterSingular") + " alle Daten bearbeiten");
@@ -678,12 +664,28 @@ namespace BS.Shared.Core
dict.Add(UserRightType.Employee_ViewNotizen, Translator.Translate("MitarbeiterSingular") + " Notizen ansehen");
dict.Add(UserRightType.Employee_EditNotizen, Translator.Translate("MitarbeiterSingular") + " Notizen bearbeiten");
dict.Add(UserRightType.Employee_DeleteNotizen, Translator.Translate("MitarbeiterSingular") + " Notizen löschen");
dict.Add(UserRightType.OrganisationView_Create, Translator.Translate("Organisationen anlegen"));
dict.Add(UserRightType.OrganisationView_Delete, Translator.Translate("Organisationen löschen"));
dict.Add(UserRightType.OrganisationView_Edit, Translator.Translate("Organisationen ändern"));
dict.Add(UserRightType.OrganisationView_View, Translator.Translate("Organisationen ansehen"));
dict.Add(UserRightType.Organisation_AllowArchiving, Translator.Translate("Organisationen archivieren"));
dict.Add(UserRightType.OrganisationView_AllowEditCostBearer, Translator.Translate("Organisationen Kostenträgerdetails bearbeiten"));
dict.Add(UserRightType.WohnheimView_Create, Translator.Translate("Wohnprojekte anlegen"));
dict.Add(UserRightType.WohnheimView_Delete, Translator.Translate("Wohnprojekte löschen"));
dict.Add(UserRightType.WohnheimView_Edit, Translator.Translate("Wohnprojekte bearbeiten"));
dict.Add(UserRightType.WohnheimView_View, Translator.Translate("Wohnprojekte ansehen"));
dict.Add(UserRightType.Wohnheim_AllowArchiving, Translator.Translate("Wohnprojekte archivieren"));
dict.Add(UserRightType.WohnheimView_Wohneinheit_View, Translator.Translate("Wohnprojekte-> Wohneinheit ansehen"));
dict.Add(UserRightType.WohnheimView_Wohneinheit_Create, Translator.Translate("Wohnprojekte-> Wohneinheit anlegen"));
dict.Add(UserRightType.WohnheimView_Wohneinheit_Edit, Translator.Translate("Wohnprojekte-> Wohneinheit bearbeiten"));
dict.Add(UserRightType.WohnheimView_Wohneinheit_Delete, Translator.Translate("Wohnprojekte-> Wohneinheit löschen"));
dict.Add(UserRightType.WohnheimView_Wohneinheit_Belegung_View, Translator.Translate("Wohnprojekte-> Wohneinheitbelegung ansehen"));
dict.Add(UserRightType.WohnheimView_Wohneinheit_Belegung_Create, Translator.Translate("Wohnprojekte-> Wohneinheitbelegung anlegen"));
dict.Add(UserRightType.WohnheimView_Wohneinheit_Belegung_Edit, Translator.Translate("Wohnprojekte-> Wohneinheitbelegung bearbeiten"));
dict.Add(UserRightType.WohnheimView_Wohneinheit_Belegung_Delete, Translator.Translate("Wohnprojekte-> Wohneinheitbelegung löschen"));
dict.Add(UserRightType.PersonView_Create, Translator.Translate("Personen anlegen"));
dict.Add(UserRightType.PersonView_Delete, Translator.Translate("Personen löschen"));
dict.Add(UserRightType.Person_AllowArchiving, Translator.Translate("Personen archivieren"));

View File

@@ -1,28 +0,0 @@
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)}");
}
}
}
}

View File

@@ -0,0 +1,41 @@
using BS.Shared;
using BS.Shared.Core;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
namespace TranslationUnitTest
{
[TestClass]
public class EnumTranslationTest
{
public Dictionary<UserRightType, String> Dict { get; set; }
[TestInitialize]
public void UserRightTypeCreation()
{
Dict = EnumTranslations.UserRightType2Translations;
var values = new Dictionary<long, UserRightType>();
foreach (UserRightType item in Enum.GetValues(typeof(UserRightType)))
{
var value = (long)item;
if (values.ContainsKey(value))
Assert.Fail($"\"{item}\" und \"{values[value]}\" haben den gleichen Wert \"{value}\"");
values.Add(value, item);
}
}
[TestMethod]
public void UserRightType2TranslationsComplete()
{
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)}");
}
}
}
}

View File

@@ -49,7 +49,7 @@
<Reference Include="System.Core" />
</ItemGroup>
<ItemGroup>
<Compile Include="EnumTranslation.cs" />
<Compile Include="EnumTranslationTest.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>