|
1 | 1 | // Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). |
2 | 2 | // https://github.com/angularsen/UnitsNet |
3 | | -// |
| 3 | +// |
4 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy |
5 | 5 | // of this software and associated documentation files (the "Software"), to deal |
6 | 6 | // in the Software without restriction, including without limitation the rights |
7 | 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
8 | 8 | // copies of the Software, and to permit persons to whom the Software is |
9 | 9 | // furnished to do so, subject to the following conditions: |
10 | | -// |
| 10 | +// |
11 | 11 | // The above copyright notice and this permission notice shall be included in |
12 | 12 | // all copies or substantial portions of the Software. |
13 | | -// |
| 13 | +// |
14 | 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
15 | 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
16 | 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
@@ -62,20 +62,6 @@ public void ParseLength_InvalidString_USEnglish_ThrowsException(string s, Type e |
62 | 62 | Assert.Throws(expectedExceptionType, () => Length.Parse(s, usEnglish)); |
63 | 63 | } |
64 | 64 |
|
65 | | - [Theory] |
66 | | - [InlineData("1 ft 1 in", 13)] |
67 | | - [InlineData("1ft 1in", 13)] |
68 | | - [InlineData("1' 1\"", 13)] |
69 | | - [InlineData("1'1\"", 13)] |
70 | | - [InlineData("1ft1in", 13)] |
71 | | - [InlineData("1ft and 1in", 13)] |
72 | | - public void ParseLength_FeetInchesString_USEnglish(string s, double expected) |
73 | | - { |
74 | | - CultureInfo usEnglish = new CultureInfo("en-US"); |
75 | | - double actual = Length.Parse(s, usEnglish).Inches; |
76 | | - Assert.Equal(expected, actual); |
77 | | - } |
78 | | - |
79 | 65 | /// <exception cref="UnitsNetException">Error parsing string.</exception> |
80 | 66 | [Theory] |
81 | 67 | [InlineData("5.5 m", 5.5)] |
@@ -166,61 +152,5 @@ public void TryParseLengthUnitUsEnglish(string s, bool expected) |
166 | 152 | bool actual = Length.TryParse(s, usEnglish, out Length _); |
167 | 153 | Assert.Equal(expected, actual); |
168 | 154 | } |
169 | | - |
170 | | - [Theory] |
171 | | - [InlineData("!")] |
172 | | - [InlineData("@")] |
173 | | - [InlineData("#")] |
174 | | - [InlineData("$")] |
175 | | - [InlineData("%")] |
176 | | - [InlineData("^")] |
177 | | - [InlineData("&")] |
178 | | - [InlineData("*")] |
179 | | - [InlineData("-")] |
180 | | - [InlineData("_")] |
181 | | - [InlineData("?")] |
182 | | - [InlineData("123")] |
183 | | - [InlineData(" ")] |
184 | | - public void TryParseLengthUnitAbbreviationSpecialCharacters(string s) |
185 | | - { |
186 | | - string abbrev = $"m{s}s"; |
187 | | - |
188 | | - UnitAbbreviationsCache.Default.MapUnitToAbbreviation(LengthUnit.Meter, abbrev); |
189 | | - |
190 | | - // Act |
191 | | - bool ok = UnitParser.Default.TryParse(abbrev, out LengthUnit result); |
192 | | - |
193 | | - // Assert |
194 | | - Assert.True(ok, "TryParse " + abbrev); |
195 | | - Assert.Equal(LengthUnit.Meter, result); |
196 | | - } |
197 | | - |
198 | | - [Theory] |
199 | | - [InlineData("!")] |
200 | | - [InlineData("@")] |
201 | | - [InlineData("#")] |
202 | | - [InlineData("$")] |
203 | | - [InlineData("%")] |
204 | | - [InlineData("^")] |
205 | | - [InlineData("&")] |
206 | | - [InlineData("*")] |
207 | | - [InlineData("-")] |
208 | | - [InlineData("_")] |
209 | | - [InlineData("?")] |
210 | | - [InlineData("123")] |
211 | | - [InlineData(" ")] |
212 | | - public void TryParseLengthSpecialCharacters(string s) |
213 | | - { |
214 | | - string abbrev = $"m{s}s"; |
215 | | - |
216 | | - UnitAbbreviationsCache.Default.MapUnitToAbbreviation(LengthUnit.Meter, abbrev); |
217 | | - |
218 | | - // Act |
219 | | - var ok = Length.TryParse($"10 {abbrev}", out var result); |
220 | | - |
221 | | - // Assert |
222 | | - Assert.True(ok, $"TryParse \"10 {abbrev}\""); |
223 | | - Assert.Equal(10, result.Meters); |
224 | | - } |
225 | 155 | } |
226 | 156 | } |
0 commit comments