From 690d640a0543a9d99b5340d892512bd02038d077 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Fri, 7 May 2021 09:15:12 -0400 Subject: [PATCH] simplified a test --- .../java/mage/verify/VerifyCardDataTest.java | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/Mage.Verify/src/test/java/mage/verify/VerifyCardDataTest.java b/Mage.Verify/src/test/java/mage/verify/VerifyCardDataTest.java index a051b7c322..4d2711bb88 100644 --- a/Mage.Verify/src/test/java/mage/verify/VerifyCardDataTest.java +++ b/Mage.Verify/src/test/java/mage/verify/VerifyCardDataTest.java @@ -820,21 +820,13 @@ public class VerifyCardDataTest { // CHECK: wrong set class names for (ExpansionSet set : sets) { String className = extractShortClass(set.getClass()); - String needClassName = set.getName() - //.replaceAll("Duel Decks", "") - .replaceAll("&", "And") - .replaceAll(" vs. ", " Vs ") // for more friendly class name generation in logs TODO: replace to CamelCase transform instead custom words - .replaceAll(" the ", " The ") - .replaceAll(" in ", " In ") - .replaceAll(" and ", " And ") - .replaceAll(" of ", " Of ") - .replaceAll(" to ", " To ") - .replaceAll(" for ", " For ") - .replaceAll(" into ", " Into ") - .replaceAll(" over ", " Over ") - .replaceAll("[ .+-/:\"']", ""); + String needClassName = Arrays.stream( + set.getName() + .replaceAll("&", "And") + .replaceAll("[.+-/:\"']", "") + .split(" ") + ).map(CardUtil::getTextWithFirstCharUpperCase).reduce("", String::concat); - //if (!className.toLowerCase(Locale.ENGLISH).equals(needClassName.toLowerCase(Locale.ENGLISH))) { if (!className.equals(needClassName)) { errorsList.add("Error: set's class name must be equal to set name: " + className + " from " + set.getClass().getName() + ", caption: " + set.getName() + ", need name: " + needClassName);