|
26 | 26 | using NUnit.Framework; |
27 | 27 | using System; |
28 | 28 | using System.Collections.Generic; |
| 29 | +using System.Diagnostics; |
29 | 30 | using System.Drawing; |
30 | 31 | using CardMaker.Data; |
31 | 32 | using Moq; |
@@ -150,6 +151,54 @@ public string ValidateElementFields(string input) |
150 | 151 | return result.String; |
151 | 152 | } |
152 | 153 |
|
| 154 | + [TestCase("#(caps;)#", ExpectedResult = "")] |
| 155 | + [TestCase("#(caps;A)#", ExpectedResult = "A")] |
| 156 | + [TestCase("#(caps;a)#", ExpectedResult = "A")] |
| 157 | + [TestCase("#(caps;abc)#", ExpectedResult = "ABC")] |
| 158 | + [TestCase("#(caps;ABC)#", ExpectedResult = "ABC")] |
| 159 | + [TestCase("xy#(caps;abc)#zy", ExpectedResult = "xyABCzy")] |
| 160 | + [TestCase("xy#(caps;ABC)#zy", ExpectedResult = "xyABCzy")] |
| 161 | + public string ValidateCaps(string input) |
| 162 | + { |
| 163 | + _testDeck.ProcessLinesPublic(new List<List<string>>(), new List<List<string>>(), "test"); |
| 164 | + var result = _testDeck.TranslateString(input, _testDeck.CurrentLine, _testElement); |
| 165 | + return result.String; |
| 166 | + } |
| 167 | + |
| 168 | + [TestCase("#(nocaps;)#", ExpectedResult = "")] |
| 169 | + [TestCase("#(nocaps;A)#", ExpectedResult = "a")] |
| 170 | + [TestCase("#(nocaps;a)#", ExpectedResult = "a")] |
| 171 | + [TestCase("#(nocaps;abc)#", ExpectedResult = "abc")] |
| 172 | + [TestCase("#(nocaps;ABC)#", ExpectedResult = "abc")] |
| 173 | + [TestCase("xy#(nocaps;abc)#zy", ExpectedResult = "xyabczy")] |
| 174 | + [TestCase("xy#(nocaps;ABC)#zy", ExpectedResult = "xyabczy")] |
| 175 | + public string ValidateNoCaps(string input) |
| 176 | + { |
| 177 | + _testDeck.ProcessLinesPublic(new List<List<string>>(), new List<List<string>>(), "test"); |
| 178 | + var result = _testDeck.TranslateString(input, _testDeck.CurrentLine, _testElement); |
| 179 | + return result.String; |
| 180 | + } |
| 181 | + |
| 182 | + |
| 183 | + [TestCase("#(titlecase;)#", ExpectedResult = "")] |
| 184 | + [TestCase("#(titlecase;\t)#", ExpectedResult = "\t")] |
| 185 | + [TestCase("#(titlecase;\ta)#", ExpectedResult = "\tA")] |
| 186 | + [TestCase("#(titlecase;\ta\tb)#", ExpectedResult = "\tA\tB")] |
| 187 | + [TestCase("#(titlecase;a\tb)#", ExpectedResult = "A\tB")] |
| 188 | + [TestCase("#(titlecase;alpha beta gamma)#", ExpectedResult = "Alpha Beta Gamma")] |
| 189 | + [TestCase("#(titlecase;1alpha 2beta 3gamma)#", ExpectedResult = "1alpha 2beta 3gamma")] |
| 190 | + [TestCase("#(titlecase;-alpha =beta !gamma)#", ExpectedResult = "-alpha =beta !gamma")] |
| 191 | + [TestCase("#(titlecase;alpha,beta, gamma)#", ExpectedResult = "Alpha,beta, Gamma")] |
| 192 | + [TestCase("#(titlecase;Alpha Beta Gamma)#", ExpectedResult = "Alpha Beta Gamma")] |
| 193 | + [TestCase("00#(titlecase;Alpha Beta Gamma\t )#11", ExpectedResult = "00Alpha Beta Gamma\t 11")] |
| 194 | + [TestCase(" 00 #(titlecase;ALPHA BETA gAmma\t )#11 ", ExpectedResult = " 00 Alpha Beta Gamma\t 11 ")] |
| 195 | + public string ValidateTitleCase(string input) |
| 196 | + { |
| 197 | + _testDeck.ProcessLinesPublic(new List<List<string>>(), new List<List<string>>(), "test"); |
| 198 | + var result = _testDeck.TranslateString(input, _testDeck.CurrentLine, _testElement); |
| 199 | + return result.String; |
| 200 | + } |
| 201 | + |
153 | 202 | [TestCase("aa#padl;5;0;123#bb", ExpectedResult = "aa00123bb")] |
154 | 203 | [TestCase("aa#padr;5;0;123#bb", ExpectedResult = "aa12300bb")] |
155 | 204 | [TestCase("aa#padl;3;0;123#bb", ExpectedResult = "aa123bb")] |
|
0 commit comments