Renaming -> Wrong T Search prevented
This commit is contained in:
@@ -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)}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
41
TranslationUnitTest/EnumTranslationTest.cs
Normal file
41
TranslationUnitTest/EnumTranslationTest.cs
Normal 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)}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user