Skip to content

Commit d42fc4e

Browse files
Copilotjosesimoes
andcommitted
Revert new test methods - need specific asserts from issue #1650
Co-authored-by: josesimoes <[email protected]>
1 parent 748cf49 commit d42fc4e

File tree

2 files changed

+0
-257
lines changed

2 files changed

+0
-257
lines changed

Tests/NFUnitTestSystemLib/UnitTestDouble.cs

Lines changed: 0 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -167,134 +167,6 @@ public void Equals()
167167

168168
}
169169

170-
[TestMethod]
171-
public void ToString_NoFormatString()
172-
{
173-
// Test basic ToString() without format string (uses "G" format by default)
174-
double value = 0;
175-
Assert.AreEqual("0", value.ToString(), "0.ToString() failed");
176-
177-
value = 123;
178-
Assert.AreEqual("123", value.ToString(), "123.ToString() failed");
179-
180-
value = -123;
181-
Assert.AreEqual("-123", value.ToString(), "-123.ToString() failed");
182-
183-
value = 123.456;
184-
Assert.AreEqual("123.456", value.ToString(), "123.456.ToString() failed");
185-
186-
value = -123.456;
187-
Assert.AreEqual("-123.456", value.ToString(), "-123.456.ToString() failed");
188-
189-
value = 0.1;
190-
Assert.AreEqual("0.1", value.ToString(), "0.1.ToString() failed");
191-
192-
value = -0.1;
193-
Assert.AreEqual("-0.1", value.ToString(), "-0.1.ToString() failed");
194-
195-
value = 1234567.89;
196-
Assert.AreEqual("1234567.89", value.ToString(), "1234567.89.ToString() failed");
197-
198-
value = -1234567.89;
199-
Assert.AreEqual("-1234567.89", value.ToString(), "-1234567.89.ToString() failed");
200-
}
201-
202-
[TestMethod]
203-
public void ToString_SpecialValues()
204-
{
205-
// Test special values
206-
Assert.AreEqual("NaN", double.NaN.ToString(), "NaN.ToString() failed");
207-
Assert.AreEqual("Infinity", double.PositiveInfinity.ToString(), "PositiveInfinity.ToString() failed");
208-
Assert.AreEqual("-Infinity", double.NegativeInfinity.ToString(), "NegativeInfinity.ToString() failed");
209-
}
210-
211-
[TestMethod]
212-
public void ToString_ZeroValues()
213-
{
214-
// Test zero and negative zero
215-
double zero = 0.0;
216-
Assert.AreEqual("0", zero.ToString(), "0.0.ToString() failed");
217-
218-
double negativeZero = -0.0;
219-
Assert.AreEqual("0", negativeZero.ToString(), "-0.0.ToString() failed");
220-
}
221-
222-
[TestMethod]
223-
public void ToString_SmallValues()
224-
{
225-
// Test very small values
226-
double value = 0.0001;
227-
Assert.AreEqual("0.0001", value.ToString(), "0.0001.ToString() failed");
228-
229-
value = -0.0001;
230-
Assert.AreEqual("-0.0001", value.ToString(), "-0.0001.ToString() failed");
231-
232-
value = 1e-10;
233-
Assert.AreEqual("1E-10", value.ToString(), "1e-10.ToString() failed");
234-
235-
value = -1e-10;
236-
Assert.AreEqual("-1E-10", value.ToString(), "-1e-10.ToString() failed");
237-
}
238-
239-
[TestMethod]
240-
public void ToString_LargeValues()
241-
{
242-
// Test large values
243-
double value = 1e10;
244-
Assert.AreEqual("10000000000", value.ToString(), "1e10.ToString() failed");
245-
246-
value = -1e10;
247-
Assert.AreEqual("-10000000000", value.ToString(), "-1e10.ToString() failed");
248-
249-
value = 1.23456789e15;
250-
Assert.AreEqual("1234567890000000", value.ToString(), "1.23456789e15.ToString() failed");
251-
}
252-
253-
[TestMethod]
254-
public void ToString_ScientificNotation()
255-
{
256-
// Test values that should use scientific notation in default format
257-
double value = 1.23e20;
258-
string result = value.ToString();
259-
Assert.IsTrue(result.Contains("E") || result.Contains("e"), "1.23e20.ToString() should use scientific notation");
260-
261-
value = -1.23e20;
262-
result = value.ToString();
263-
Assert.IsTrue(result.Contains("E") || result.Contains("e"), "-1.23e20.ToString() should use scientific notation");
264-
265-
value = 1.23e-20;
266-
result = value.ToString();
267-
Assert.IsTrue(result.Contains("E") || result.Contains("e"), "1.23e-20.ToString() should use scientific notation");
268-
}
269-
270-
[TestMethod]
271-
public void ToString_RoundingBehavior()
272-
{
273-
// Test rounding behavior
274-
double value = 1.234567890123456;
275-
string result = value.ToString();
276-
Assert.IsTrue(result.Length > 0, "ToString() should return a non-empty string");
277-
Assert.IsTrue(result.Contains("."), "Decimal value ToString() should contain a decimal point");
278-
279-
value = 0.123456789012345678;
280-
result = value.ToString();
281-
Assert.IsTrue(result.StartsWith("0."), "Fractional value should start with '0.'");
282-
}
283-
284-
[TestMethod]
285-
public void ToString_WithFormatString()
286-
{
287-
// Test ToString() with format string
288-
double value = 123.456;
289-
Assert.AreEqual("123.46", value.ToString("F2"), "ToString('F2') failed");
290-
291-
value = 1234.5;
292-
Assert.AreEqual("1,234.50", value.ToString("N2"), "ToString('N2') failed");
293-
294-
value = 1.23456e10;
295-
Assert.AreEqual("1.234560E+010", value.ToString("E6"), "ToString('E6') failed");
296-
}
297-
298170
private sealed class DoubleTestData
299171
{
300172
public object D1 { get; }

Tests/NFUnitTestSystemLib/UnitTestSingle.cs

Lines changed: 0 additions & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -160,135 +160,6 @@ public void Equals()
160160

161161
}
162162

163-
[TestMethod]
164-
public void ToString_NoFormatString()
165-
{
166-
// Test basic ToString() without format string (uses "G" format by default)
167-
float value = 0;
168-
Assert.AreEqual("0", value.ToString(), "0.ToString() failed");
169-
170-
value = 123;
171-
Assert.AreEqual("123", value.ToString(), "123.ToString() failed");
172-
173-
value = -123;
174-
Assert.AreEqual("-123", value.ToString(), "-123.ToString() failed");
175-
176-
value = 123.456f;
177-
Assert.AreEqual("123.456", value.ToString(), "123.456f.ToString() failed");
178-
179-
value = -123.456f;
180-
Assert.AreEqual("-123.456", value.ToString(), "-123.456f.ToString() failed");
181-
182-
value = 0.1f;
183-
Assert.AreEqual("0.1", value.ToString(), "0.1f.ToString() failed");
184-
185-
value = -0.1f;
186-
Assert.AreEqual("-0.1", value.ToString(), "-0.1f.ToString() failed");
187-
188-
value = 1234567.89f;
189-
Assert.AreEqual("1234567.89", value.ToString(), "1234567.89f.ToString() failed");
190-
191-
value = -1234567.89f;
192-
Assert.AreEqual("-1234567.89", value.ToString(), "-1234567.89f.ToString() failed");
193-
}
194-
195-
[TestMethod]
196-
public void ToString_SpecialValues()
197-
{
198-
// Test special values
199-
Assert.AreEqual("NaN", float.NaN.ToString(), "NaN.ToString() failed");
200-
Assert.AreEqual("Infinity", float.PositiveInfinity.ToString(), "PositiveInfinity.ToString() failed");
201-
Assert.AreEqual("-Infinity", float.NegativeInfinity.ToString(), "NegativeInfinity.ToString() failed");
202-
}
203-
204-
[TestMethod]
205-
public void ToString_ZeroValues()
206-
{
207-
// Test zero and negative zero
208-
float zero = 0.0f;
209-
Assert.AreEqual("0", zero.ToString(), "0.0f.ToString() failed");
210-
211-
float negativeZero = -0.0f;
212-
Assert.AreEqual("0", negativeZero.ToString(), "-0.0f.ToString() failed");
213-
}
214-
215-
[TestMethod]
216-
public void ToString_SmallValues()
217-
{
218-
// Test very small values
219-
float value = 0.0001f;
220-
Assert.AreEqual("0.0001", value.ToString(), "0.0001f.ToString() failed");
221-
222-
value = -0.0001f;
223-
Assert.AreEqual("-0.0001", value.ToString(), "-0.0001f.ToString() failed");
224-
225-
value = 1e-10f;
226-
Assert.AreEqual("1E-10", value.ToString(), "1e-10f.ToString() failed");
227-
228-
value = -1e-10f;
229-
Assert.AreEqual("-1E-10", value.ToString(), "-1e-10f.ToString() failed");
230-
}
231-
232-
[TestMethod]
233-
public void ToString_LargeValues()
234-
{
235-
// Test large values
236-
float value = 1e10f;
237-
Assert.AreEqual("10000000000", value.ToString(), "1e10f.ToString() failed");
238-
239-
value = -1e10f;
240-
Assert.AreEqual("-10000000000", value.ToString(), "-1e10f.ToString() failed");
241-
242-
value = 1.23456789e15f;
243-
string result = value.ToString();
244-
Assert.IsTrue(result.Length > 0, "ToString() should return a non-empty string");
245-
}
246-
247-
[TestMethod]
248-
public void ToString_ScientificNotation()
249-
{
250-
// Test values that should use scientific notation in default format
251-
float value = 1.23e20f;
252-
string result = value.ToString();
253-
Assert.IsTrue(result.Contains("E") || result.Contains("e"), "1.23e20f.ToString() should use scientific notation");
254-
255-
value = -1.23e20f;
256-
result = value.ToString();
257-
Assert.IsTrue(result.Contains("E") || result.Contains("e"), "-1.23e20f.ToString() should use scientific notation");
258-
259-
value = 1.23e-20f;
260-
result = value.ToString();
261-
Assert.IsTrue(result.Contains("E") || result.Contains("e"), "1.23e-20f.ToString() should use scientific notation");
262-
}
263-
264-
[TestMethod]
265-
public void ToString_RoundingBehavior()
266-
{
267-
// Test rounding behavior
268-
float value = 1.23456789f;
269-
string result = value.ToString();
270-
Assert.IsTrue(result.Length > 0, "ToString() should return a non-empty string");
271-
Assert.IsTrue(result.Contains("."), "Decimal value ToString() should contain a decimal point");
272-
273-
value = 0.123456789f;
274-
result = value.ToString();
275-
Assert.IsTrue(result.StartsWith("0."), "Fractional value should start with '0.'");
276-
}
277-
278-
[TestMethod]
279-
public void ToString_WithFormatString()
280-
{
281-
// Test ToString() with format string
282-
float value = 123.456f;
283-
Assert.AreEqual("123.46", value.ToString("F2"), "ToString('F2') failed");
284-
285-
value = 1234.5f;
286-
Assert.AreEqual("1,234.50", value.ToString("N2"), "ToString('N2') failed");
287-
288-
value = 1.23456e10f;
289-
Assert.AreEqual("1.234560E+010", value.ToString("E6"), "ToString('E6') failed");
290-
}
291-
292163
private sealed class SingleTestData
293164
{
294165
public object F1 { get; }

0 commit comments

Comments
 (0)