props = f.CreateProperties(data, 0, (short)3);
EscherComplexProperty p1 = (EscherComplexProperty)props[0];
- Assert.AreEqual(unchecked((short)0xC141), p1.Id);
- Assert.AreEqual("[01, 02, 03]", HexDump.ToHex(p1.ComplexData));
+ ClassicAssert.AreEqual(unchecked((short)0xC141), p1.Id);
+ ClassicAssert.AreEqual("[01, 02, 03]", HexDump.ToHex(p1.ComplexData));
EscherComplexProperty p3 = (EscherComplexProperty)props[2];
- Assert.AreEqual(unchecked((short)0xC141), p3.Id);
- Assert.AreEqual("[01, 02, 03]", HexDump.ToHex(p3.ComplexData));
+ ClassicAssert.AreEqual(unchecked((short)0xC141), p3.Id);
+ ClassicAssert.AreEqual("[01, 02, 03]", HexDump.ToHex(p3.ComplexData));
}
diff --git a/testcases/main/DDF/TestEscherSpRecord.cs b/testcases/main/DDF/TestEscherSpRecord.cs
index f0d2fb595..89bfa3212 100644
--- a/testcases/main/DDF/TestEscherSpRecord.cs
+++ b/testcases/main/DDF/TestEscherSpRecord.cs
@@ -24,7 +24,7 @@ namespace TestCases.DDF
using System.Collections.Generic;
using System.IO;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.DDF;
using NPOI.Util;
[TestFixture]
@@ -37,8 +37,8 @@ public void TestSerialize()
byte[] data = new byte[16];
int bytesWritten = r.Serialize(0, data);
- Assert.AreEqual(16, bytesWritten);
- Assert.AreEqual("[02, 00, " +
+ ClassicAssert.AreEqual(16, bytesWritten);
+ ClassicAssert.AreEqual("[02, 00, " +
"0A, F0, " +
"08, 00, 00, 00, " +
"00, 04, 00, 00, " +
@@ -57,9 +57,9 @@ public void TestFillFields()
EscherSpRecord r = new EscherSpRecord();
int bytesWritten = r.FillFields(data, new DefaultEscherRecordFactory());
- Assert.AreEqual(16, bytesWritten);
- Assert.AreEqual(0x0400, r.ShapeId);
- Assert.AreEqual(0x05, r.Flags);
+ ClassicAssert.AreEqual(16, bytesWritten);
+ ClassicAssert.AreEqual(0x0400, r.ShapeId);
+ ClassicAssert.AreEqual(0x05, r.Flags);
}
[Test]
public void TestToString()
@@ -72,7 +72,7 @@ public void TestToString()
" ShapeType: 0x0000" + nl +
" ShapeId: 1024" + nl +
" Flags: GROUP|PATRIARCH (0x00000005)" + nl;
- Assert.AreEqual(expected, CreateRecord().ToString());
+ ClassicAssert.AreEqual(expected, CreateRecord().ToString());
}
private EscherSpRecord CreateRecord()
diff --git a/testcases/main/DDF/TestEscherSpgrRecord.cs b/testcases/main/DDF/TestEscherSpgrRecord.cs
index d65a3bbcf..e111994e4 100644
--- a/testcases/main/DDF/TestEscherSpgrRecord.cs
+++ b/testcases/main/DDF/TestEscherSpgrRecord.cs
@@ -20,10 +20,7 @@ namespace TestCases.DDF
{
using System;
- using System.Text;
- using System.IO;
-
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.DDF;
using NPOI.Util;
[TestFixture]
@@ -36,8 +33,8 @@ public void TestSerialize()
byte[] data = new byte[24];
int bytesWritten = r.Serialize(0, data);
- Assert.AreEqual(24, bytesWritten);
- Assert.AreEqual("[10, 00, " +
+ ClassicAssert.AreEqual(24, bytesWritten);
+ ClassicAssert.AreEqual("[10, 00, " +
"09, F0, " +
"10, 00, 00, 00, " +
"01, 00, 00, 00, " + // x
@@ -60,11 +57,11 @@ public void TestFillFields()
EscherSpgrRecord r = new EscherSpgrRecord();
int bytesWritten = r.FillFields(data, new DefaultEscherRecordFactory());
- Assert.AreEqual(24, bytesWritten);
- Assert.AreEqual(1, r.RectX1);
- Assert.AreEqual(2, r.RectY1);
- Assert.AreEqual(3, r.RectX2);
- Assert.AreEqual(4, r.RectY2);
+ ClassicAssert.AreEqual(24, bytesWritten);
+ ClassicAssert.AreEqual(1, r.RectX1);
+ ClassicAssert.AreEqual(2, r.RectY1);
+ ClassicAssert.AreEqual(3, r.RectX2);
+ ClassicAssert.AreEqual(4, r.RectY2);
}
[Test]
public void TestToString()
@@ -80,7 +77,7 @@ public void TestToString()
" RectWidth: 3" + nl +
" RectHeight: 4" + nl;
;
- Assert.AreEqual(expected, CreateRecord().ToString());
+ ClassicAssert.AreEqual(expected, CreateRecord().ToString());
}
private EscherSpgrRecord CreateRecord()
diff --git a/testcases/main/DDF/TestEscherSplitMenuColorsRecord.cs b/testcases/main/DDF/TestEscherSplitMenuColorsRecord.cs
index 19800a594..1a565b09d 100644
--- a/testcases/main/DDF/TestEscherSplitMenuColorsRecord.cs
+++ b/testcases/main/DDF/TestEscherSplitMenuColorsRecord.cs
@@ -23,7 +23,7 @@ namespace TestCases.DDF
using System.Text;
using System.IO;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.DDF;
using NPOI.Util;
[TestFixture]
@@ -36,8 +36,8 @@ public void TestSerialize()
byte[] data = new byte[24];
int bytesWritten = r.Serialize(0, data);
- Assert.AreEqual(24, bytesWritten);
- Assert.AreEqual("[40, 00, " +
+ ClassicAssert.AreEqual(24, bytesWritten);
+ ClassicAssert.AreEqual("[40, 00, " +
"1E, F1, " +
"10, 00, 00, 00, " +
"02, 04, 00, 00, " +
@@ -60,11 +60,11 @@ public void TestFillFields()
EscherSplitMenuColorsRecord r = new EscherSplitMenuColorsRecord();
int bytesWritten = r.FillFields(data, new DefaultEscherRecordFactory());
- Assert.AreEqual(24, bytesWritten);
- Assert.AreEqual(0x0402, r.Color1);
- Assert.AreEqual(0x02, r.Color2);
- Assert.AreEqual(0x02, r.Color3);
- Assert.AreEqual(0x01, r.Color4);
+ ClassicAssert.AreEqual(24, bytesWritten);
+ ClassicAssert.AreEqual(0x0402, r.Color1);
+ ClassicAssert.AreEqual(0x02, r.Color2);
+ ClassicAssert.AreEqual(0x02, r.Color3);
+ ClassicAssert.AreEqual(0x01, r.Color4);
}
[Test]
public void TestToString()
@@ -80,7 +80,7 @@ public void TestToString()
" Color3: 0x00000002" + nl +
" Color4: 0x00000001" + nl +
"";
- Assert.AreEqual(expected, CreateRecord().ToString());
+ ClassicAssert.AreEqual(expected, CreateRecord().ToString());
}
private EscherSplitMenuColorsRecord CreateRecord()
diff --git a/testcases/main/DDF/TestUnknownEscherRecord.cs b/testcases/main/DDF/TestUnknownEscherRecord.cs
index f4f7eb9e7..d179633be 100644
--- a/testcases/main/DDF/TestUnknownEscherRecord.cs
+++ b/testcases/main/DDF/TestUnknownEscherRecord.cs
@@ -24,7 +24,7 @@ namespace TestCases.DDF
using System.Collections.Generic;
using System.IO;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.DDF;
using NPOI.Util;
[TestFixture]
@@ -42,12 +42,12 @@ public void TestFillFields()
IEscherRecordFactory factory = new DefaultEscherRecordFactory();
r.FillFields(HexRead.ReadFromString(TestData), factory);
- Assert.AreEqual(0x020F, r.Options);
- Assert.AreEqual(unchecked((short)0xF111), r.RecordId);
- Assert.IsTrue(r.IsContainerRecord);
- Assert.AreEqual(8, r.RecordSize);
- Assert.AreEqual(0, r.ChildRecords.Count);
- Assert.AreEqual(0, r.Data.Length);
+ ClassicAssert.AreEqual(0x020F, r.Options);
+ ClassicAssert.AreEqual(unchecked((short)0xF111), r.RecordId);
+ ClassicAssert.IsTrue(r.IsContainerRecord);
+ ClassicAssert.AreEqual(8, r.RecordSize);
+ ClassicAssert.AreEqual(0, r.ChildRecords.Count);
+ ClassicAssert.AreEqual(0, r.Data.Length);
TestData =
"00 02 " + // options
@@ -58,16 +58,16 @@ public void TestFillFields()
r = new UnknownEscherRecord();
r.FillFields(HexRead.ReadFromString(TestData), factory);
- Assert.AreEqual(0x0200, r.Options);
- Assert.AreEqual(unchecked((short)0xF111), r.RecordId);
- Assert.AreEqual(12, r.RecordSize);
- Assert.IsFalse(r.IsContainerRecord);
- Assert.AreEqual(0, r.ChildRecords.Count);
- Assert.AreEqual(4, r.Data.Length);
- Assert.AreEqual(1, r.Data[0]);
- Assert.AreEqual(2, r.Data[1]);
- Assert.AreEqual(3, r.Data[2]);
- Assert.AreEqual(4, r.Data[3]);
+ ClassicAssert.AreEqual(0x0200, r.Options);
+ ClassicAssert.AreEqual(unchecked((short)0xF111), r.RecordId);
+ ClassicAssert.AreEqual(12, r.RecordSize);
+ ClassicAssert.IsFalse(r.IsContainerRecord);
+ ClassicAssert.AreEqual(0, r.ChildRecords.Count);
+ ClassicAssert.AreEqual(4, r.Data.Length);
+ ClassicAssert.AreEqual(1, r.Data[0]);
+ ClassicAssert.AreEqual(2, r.Data[1]);
+ ClassicAssert.AreEqual(3, r.Data[2]);
+ ClassicAssert.AreEqual(4, r.Data[3]);
TestData =
"0F 02 " + // options
@@ -80,12 +80,12 @@ public void TestFillFields()
r = new UnknownEscherRecord();
r.FillFields(HexRead.ReadFromString(TestData), factory);
- Assert.AreEqual(0x020F, r.Options);
- Assert.AreEqual(unchecked((short)0xF111), r.RecordId);
- Assert.AreEqual(8, r.RecordSize);
- Assert.IsTrue(r.IsContainerRecord);
- Assert.AreEqual(1, r.ChildRecords.Count);
- Assert.AreEqual(unchecked((short)0xFFFF), r.GetChild(0).RecordId);
+ ClassicAssert.AreEqual(0x020F, r.Options);
+ ClassicAssert.AreEqual(unchecked((short)0xF111), r.RecordId);
+ ClassicAssert.AreEqual(8, r.RecordSize);
+ ClassicAssert.IsTrue(r.IsContainerRecord);
+ ClassicAssert.AreEqual(1, r.ChildRecords.Count);
+ ClassicAssert.AreEqual(unchecked((short)0xFFFF), r.GetChild(0).RecordId);
}
[Test]
@@ -97,7 +97,7 @@ public void TestSerialize()
byte[] data = new byte[8];
r.Serialize(0, data);
- Assert.AreEqual("[34, 12, 12, F1, 00, 00, 00, 00]", HexDump.ToHex(data));
+ ClassicAssert.AreEqual("[34, 12, 12, F1, 00, 00, 00, 00]", HexDump.ToHex(data));
EscherRecord childRecord = new UnknownEscherRecord();
childRecord.Options=unchecked((short)0x9999);
@@ -107,7 +107,7 @@ public void TestSerialize()
data = new byte[16];
r.Serialize(0, data);
- Assert.AreEqual("[3F, 12, 12, F1, 08, 00, 00, 00, 99, 99, 01, FF, 00, 00, 00, 00]", HexDump.ToHex(data));
+ ClassicAssert.AreEqual("[3F, 12, 12, F1, 08, 00, 00, 00, 99, 99, 01, FF, 00, 00, 00, 00]", HexDump.ToHex(data));
}
[Test]
public void TestToString()
@@ -119,7 +119,7 @@ public void TestToString()
r.Serialize(0, data);
String nl = Environment.NewLine;
- Assert.AreEqual("UnknownEscherRecord:" + nl +
+ ClassicAssert.AreEqual("UnknownEscherRecord:" + nl +
" isContainer: False" + nl +
" version: 0x0004" + nl +
" instance: 0x0123" + nl +
diff --git a/testcases/main/HPSF/Basic/TestBasic.cs b/testcases/main/HPSF/Basic/TestBasic.cs
index 89523d985..984b07157 100644
--- a/testcases/main/HPSF/Basic/TestBasic.cs
+++ b/testcases/main/HPSF/Basic/TestBasic.cs
@@ -26,6 +26,7 @@ namespace TestCases.HPSF.Basic
using NPOI.HPSF;
using NPOI.HPSF.Wellknown;
using NPOI.Util;
+ using NUnit.Framework.Legacy;
/**
@@ -91,7 +92,7 @@ public void TestReadFiles()
{
String[] expected = POI_FILES;
for (int i = 0; i < expected.Length; i++)
- Assert.AreEqual(poiFiles[i].GetName(), expected[i]);
+ ClassicAssert.AreEqual(poiFiles[i].GetName(), expected[i]);
}
@@ -138,7 +139,7 @@ public void TestCreatePropertySets()
o = ex;
}
in1.Close();
- Assert.AreEqual(expected[i], o.GetType());
+ ClassicAssert.AreEqual(expected[i], o.GetType());
}
}
@@ -160,13 +161,13 @@ public void TestPropertySetMethods()
{
byte[] b = poiFiles[i].GetBytes();
PropertySet ps = PropertySetFactory.Create(new ByteArrayInputStream(b));
- Assert.AreEqual(ps.ByteOrder, BYTE_ORDER);
- Assert.AreEqual(ps.Format, FORMAT);
- Assert.AreEqual(ps.OSVersion, OS_VERSION);
+ ClassicAssert.AreEqual(ps.ByteOrder, BYTE_ORDER);
+ ClassicAssert.AreEqual(ps.Format, FORMAT);
+ ClassicAssert.AreEqual(ps.OSVersion, OS_VERSION);
CollectionAssert.AreEqual(CLASS_ID, ps.ClassID.Bytes);
- Assert.AreEqual(SECTION_COUNT[i], ps.SectionCount);
- Assert.AreEqual(IS_SUMMARY_INFORMATION[i], ps.IsSummaryInformation);
- Assert.AreEqual(IS_DOCUMENT_SUMMARY_INFORMATION[i], ps.IsDocumentSummaryInformation);
+ ClassicAssert.AreEqual(SECTION_COUNT[i], ps.SectionCount);
+ ClassicAssert.AreEqual(IS_SUMMARY_INFORMATION[i], ps.IsSummaryInformation);
+ ClassicAssert.AreEqual(IS_DOCUMENT_SUMMARY_INFORMATION[i], ps.IsDocumentSummaryInformation);
}
}
@@ -188,13 +189,12 @@ public void TestSectionMethods()
(poiFiles[0].GetBytes()));
IList sections = si.Sections;
Section s = (Section)sections[0];
- Assert.IsTrue(Arrays.Equals
+ ClassicAssert.IsTrue(Arrays.Equals
(s.FormatID.Bytes, SectionIDMap.SUMMARY_INFORMATION_ID));
- Assert.IsNotNull(s.Properties);
- Assert.AreEqual(17, s.PropertyCount);
- Assert.AreEqual("Titel", s.GetProperty(2));
- //Assert.assertEquals(1764, s.getSize());
- Assert.AreEqual(1764, s.Size);
+ ClassicAssert.IsNotNull(s.Properties);
+ ClassicAssert.AreEqual(17, s.PropertyCount);
+ ClassicAssert.AreEqual("Titel", s.GetProperty(2));
+ ClassicAssert.AreEqual(1764, s.Size);
}
}
diff --git a/testcases/main/HPSF/Basic/TestClassID.cs b/testcases/main/HPSF/Basic/TestClassID.cs
index 6b9a3a13a..d0acbcdf1 100644
--- a/testcases/main/HPSF/Basic/TestClassID.cs
+++ b/testcases/main/HPSF/Basic/TestClassID.cs
@@ -19,7 +19,7 @@ namespace TestCases.HPSF.Basic
{
using System;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HPSF;
/**
@@ -52,10 +52,10 @@ public void TestEquals()
0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x11 }
, 0
);
- Assert.AreEqual(clsidTest1, clsidTest1);
- Assert.AreEqual(clsidTest1, clsidTest2);
- Assert.IsFalse(clsidTest1.Equals(clsidTest3));
- Assert.IsFalse(clsidTest1.Equals(null));
+ ClassicAssert.AreEqual(clsidTest1, clsidTest1);
+ ClassicAssert.AreEqual(clsidTest1, clsidTest2);
+ ClassicAssert.IsFalse(clsidTest1.Equals(clsidTest3));
+ ClassicAssert.IsFalse(clsidTest1.Equals(null));
}
/**
* Try to write to a buffer that is too small. This should
@@ -78,7 +78,7 @@ public void TestWriteArrayStoreException()
{
bExceptionOccurred = true;
}
- Assert.IsTrue(bExceptionOccurred);
+ ClassicAssert.IsTrue(bExceptionOccurred);
bExceptionOccurred = false;
try
@@ -89,7 +89,7 @@ public void TestWriteArrayStoreException()
{
bExceptionOccurred = true;
}
- Assert.IsTrue(bExceptionOccurred);
+ ClassicAssert.IsTrue(bExceptionOccurred);
// These should work without throwing an Exception
bExceptionOccurred = false;
@@ -102,7 +102,7 @@ public void TestWriteArrayStoreException()
{
bExceptionOccurred = true;
}
- Assert.IsFalse(bExceptionOccurred);
+ ClassicAssert.IsFalse(bExceptionOccurred);
}
/**
* Tests the {@link PropertySet} methods. The test file has two
@@ -117,7 +117,7 @@ public void TestClassID1()
0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10}
, 0
);
- Assert.AreEqual(clsidTest.ToString().ToUpper(),
+ ClassicAssert.AreEqual(clsidTest.ToString().ToUpper(),
"{04030201-0605-0807-090A-0B0C0D0E0F10}"
);
}
diff --git a/testcases/main/HPSF/Basic/TestEmptyProperties.cs b/testcases/main/HPSF/Basic/TestEmptyProperties.cs
index 78861fe54..e0ea86947 100644
--- a/testcases/main/HPSF/Basic/TestEmptyProperties.cs
+++ b/testcases/main/HPSF/Basic/TestEmptyProperties.cs
@@ -19,7 +19,7 @@ namespace TestCases.HPSF.Basic
{
using System;
using System.IO;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HPSF;
using NPOI.Util;
@@ -67,7 +67,7 @@ public void TestReadFiles()
{
String[] expected = POI_FILES;
for (int i = 0; i < expected.Length; i++)
- Assert.AreEqual(poiFiles[i].GetName(), expected[i]);
+ ClassicAssert.AreEqual(poiFiles[i].GetName(), expected[i]);
}
/**
@@ -110,7 +110,7 @@ public void TestCreatePropertySets()
o = ex;
}
in1.Close();
- Assert.AreEqual(o.GetType(), expected[i]);
+ ClassicAssert.AreEqual(o.GetType(), expected[i]);
}
}
@@ -131,23 +131,23 @@ public void TestPropertySetMethods()
PropertySet ps =
PropertySetFactory.Create(new ByteArrayInputStream(b));
SummaryInformation s = (SummaryInformation)ps;
- Assert.IsNull(s.Title);
- Assert.IsNull(s.Subject);
- Assert.IsNotNull(s.Author);
- Assert.IsNull(s.Keywords);
- Assert.IsNull(s.Comments);
- Assert.IsNotNull(s.Template);
- Assert.IsNotNull(s.LastAuthor);
- Assert.IsNotNull(s.RevNumber);
- Assert.AreEqual(s.EditTime, 0);
- Assert.IsNull(s.LastPrinted);
- Assert.IsNull(s.CreateDateTime);
- Assert.IsNull(s.LastSaveDateTime);
- Assert.AreEqual(s.PageCount, 0);
- Assert.AreEqual(s.WordCount, 0);
- Assert.AreEqual(s.CharCount, 0);
- Assert.IsNull(s.Thumbnail);
- Assert.IsNull(s.ApplicationName);
+ ClassicAssert.IsNull(s.Title);
+ ClassicAssert.IsNull(s.Subject);
+ ClassicAssert.IsNotNull(s.Author);
+ ClassicAssert.IsNull(s.Keywords);
+ ClassicAssert.IsNull(s.Comments);
+ ClassicAssert.IsNotNull(s.Template);
+ ClassicAssert.IsNotNull(s.LastAuthor);
+ ClassicAssert.IsNotNull(s.RevNumber);
+ ClassicAssert.AreEqual(s.EditTime, 0);
+ ClassicAssert.IsNull(s.LastPrinted);
+ ClassicAssert.IsNull(s.CreateDateTime);
+ ClassicAssert.IsNull(s.LastSaveDateTime);
+ ClassicAssert.AreEqual(s.PageCount, 0);
+ ClassicAssert.AreEqual(s.WordCount, 0);
+ ClassicAssert.AreEqual(s.CharCount, 0);
+ ClassicAssert.IsNull(s.Thumbnail);
+ ClassicAssert.IsNull(s.ApplicationName);
}
}
diff --git a/testcases/main/HPSF/Basic/TestHPSFBugs.cs b/testcases/main/HPSF/Basic/TestHPSFBugs.cs
index a421d4bb5..9f81cd762 100644
--- a/testcases/main/HPSF/Basic/TestHPSFBugs.cs
+++ b/testcases/main/HPSF/Basic/TestHPSFBugs.cs
@@ -18,7 +18,7 @@ limitations under the License.
namespace TestCases.HPSF.Basic
{
using System.IO;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.UserModel;
using System;
using NPOI.SS.UserModel;
@@ -44,14 +44,14 @@ public void Test48832()
HSSFWorkbook wb = new HSSFWorkbook();
// Starts empty
- Assert.IsNull(wb.DocumentSummaryInformation);
- Assert.IsNull(wb.SummaryInformation);
+ ClassicAssert.IsNull(wb.DocumentSummaryInformation);
+ ClassicAssert.IsNull(wb.SummaryInformation);
// Add new properties
wb.CreateInformationProperties();
- Assert.IsNotNull(wb.DocumentSummaryInformation);
- Assert.IsNotNull(wb.SummaryInformation);
+ ClassicAssert.IsNotNull(wb.DocumentSummaryInformation);
+ ClassicAssert.IsNotNull(wb.SummaryInformation);
// Set Initial values
wb.SummaryInformation.Author = (/*setter*/"Apache POI");
@@ -70,13 +70,13 @@ public void Test48832()
// Ensure Changes were taken
- Assert.IsNotNull(wb.DocumentSummaryInformation);
- Assert.IsNotNull(wb.SummaryInformation);
+ ClassicAssert.IsNotNull(wb.DocumentSummaryInformation);
+ ClassicAssert.IsNotNull(wb.SummaryInformation);
- Assert.AreEqual("Apache POI", wb.SummaryInformation.Author);
- Assert.AreEqual("Testing POI", wb.SummaryInformation.Keywords);
- Assert.AreEqual(12345, DateUtil.GetExcelDate(wb.SummaryInformation.CreateDateTime.Value));
- Assert.AreEqual("Apache", wb.DocumentSummaryInformation.Company);
+ ClassicAssert.AreEqual("Apache POI", wb.SummaryInformation.Author);
+ ClassicAssert.AreEqual("Testing POI", wb.SummaryInformation.Keywords);
+ ClassicAssert.AreEqual(12345, DateUtil.GetExcelDate(wb.SummaryInformation.CreateDateTime.Value));
+ ClassicAssert.AreEqual("Apache", wb.DocumentSummaryInformation.Company);
// Set some more, save + reload
@@ -88,14 +88,14 @@ public void Test48832()
wb = new HSSFWorkbook(bais);
// Check again
- Assert.IsNotNull(wb.DocumentSummaryInformation);
- Assert.IsNotNull(wb.SummaryInformation);
-
- Assert.AreEqual("Apache POI", wb.SummaryInformation.Author);
- Assert.AreEqual("Testing POI", wb.SummaryInformation.Keywords);
- Assert.AreEqual("Resaved", wb.SummaryInformation.Comments);
- Assert.AreEqual(12345, DateUtil.GetExcelDate(wb.SummaryInformation.CreateDateTime.Value));
- Assert.AreEqual("Apache", wb.DocumentSummaryInformation.Company);
+ ClassicAssert.IsNotNull(wb.DocumentSummaryInformation);
+ ClassicAssert.IsNotNull(wb.SummaryInformation);
+
+ ClassicAssert.AreEqual("Apache POI", wb.SummaryInformation.Author);
+ ClassicAssert.AreEqual("Testing POI", wb.SummaryInformation.Keywords);
+ ClassicAssert.AreEqual("Resaved", wb.SummaryInformation.Comments);
+ ClassicAssert.AreEqual(12345, DateUtil.GetExcelDate(wb.SummaryInformation.CreateDateTime.Value));
+ ClassicAssert.AreEqual("Apache", wb.DocumentSummaryInformation.Company);
}
/**
@@ -117,10 +117,10 @@ public void Test54233()
DocumentSummaryInformation dsi = (DocumentSummaryInformation)PropertySetFactory.Create(dis);
// Test
- Assert.AreEqual("Microsoft Word 10.0", si.ApplicationName);
- Assert.AreEqual("", si.Title);
- Assert.AreEqual("", si.Author);
- Assert.AreEqual("Cour de Justice", dsi.Company);
+ ClassicAssert.AreEqual("Microsoft Word 10.0", si.ApplicationName);
+ ClassicAssert.AreEqual("", si.Title);
+ ClassicAssert.AreEqual("", si.Author);
+ ClassicAssert.AreEqual("Cour de Justice", dsi.Company);
// Write out and read back, should still be valid
@@ -131,10 +131,10 @@ public void Test54233()
doc = new HPSFPropertiesOnlyDocument(new POIFSFileSystem(bais));
// Check properties are still there
- Assert.AreEqual("Microsoft Word 10.0", si.ApplicationName);
- Assert.AreEqual("", si.Title);
- Assert.AreEqual("", si.Author);
- Assert.AreEqual("Cour de Justice", dsi.Company);
+ ClassicAssert.AreEqual("Microsoft Word 10.0", si.ApplicationName);
+ ClassicAssert.AreEqual("", si.Title);
+ ClassicAssert.AreEqual("", si.Author);
+ ClassicAssert.AreEqual("Cour de Justice", dsi.Company);
}
/**
@@ -154,12 +154,12 @@ public void Test56138()
DocumentSummaryInformation dsi = (DocumentSummaryInformation)PropertySetFactory.Create(dis);
// Test
- Assert.AreEqual("MSProject", si.ApplicationName);
- Assert.AreEqual("project1", si.Title);
- Assert.AreEqual("Jon Iles", si.Author);
+ ClassicAssert.AreEqual("MSProject", si.ApplicationName);
+ ClassicAssert.AreEqual("project1", si.Title);
+ ClassicAssert.AreEqual("Jon Iles", si.Author);
- Assert.AreEqual("", dsi.Company);
- Assert.AreEqual(2, dsi.SectionCount);
+ ClassicAssert.AreEqual("", dsi.Company);
+ ClassicAssert.AreEqual(2, dsi.SectionCount);
}
}
diff --git a/testcases/main/HPSF/Basic/TestMetaDataIPI.cs b/testcases/main/HPSF/Basic/TestMetaDataIPI.cs
index e238b456d..ce905bfd5 100644
Binary files a/testcases/main/HPSF/Basic/TestMetaDataIPI.cs and b/testcases/main/HPSF/Basic/TestMetaDataIPI.cs differ
diff --git a/testcases/main/HPSF/Basic/TestReadAllFiles.cs b/testcases/main/HPSF/Basic/TestReadAllFiles.cs
index acfb9c45b..8b70e934c 100644
--- a/testcases/main/HPSF/Basic/TestReadAllFiles.cs
+++ b/testcases/main/HPSF/Basic/TestReadAllFiles.cs
@@ -23,7 +23,7 @@ namespace TestCases.HPSF.Basic
using System.IO;
using System.Text;
using System.Collections;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HPSF;
using NPOI.Util;
using System.Collections.Generic;
diff --git a/testcases/main/HPSF/Basic/TestUnicode.cs b/testcases/main/HPSF/Basic/TestUnicode.cs
index 460fa0d06..66399b740 100644
--- a/testcases/main/HPSF/Basic/TestUnicode.cs
+++ b/testcases/main/HPSF/Basic/TestUnicode.cs
@@ -20,7 +20,7 @@ namespace TestCases.HPSF.Basic
{
using System;
using System.IO;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HPSF;
using NPOI.Util;
@@ -75,18 +75,18 @@ public void TestPropertySetMethods()
byte[] b = poiFile.GetBytes();
PropertySet ps =
PropertySetFactory.Create(new ByteArrayInputStream(b));
- Assert.IsTrue(ps.IsDocumentSummaryInformation, "IsDocumentSummaryInformation");
- Assert.AreEqual(ps.SectionCount, 2);
+ ClassicAssert.IsTrue(ps.IsDocumentSummaryInformation, "IsDocumentSummaryInformation");
+ ClassicAssert.AreEqual(ps.SectionCount, 2);
Section s = (Section)ps.Sections[1];
- Assert.AreEqual(s.GetProperty(1),
+ ClassicAssert.AreEqual(s.GetProperty(1),
CodePageUtil.CP_UTF16);
- Assert.AreEqual(s.GetProperty(2),
+ ClassicAssert.AreEqual(s.GetProperty(2),
-96070278);
- Assert.AreEqual(s.GetProperty(3),
+ ClassicAssert.AreEqual(s.GetProperty(3),
"MCon_Info zu Office bei Schreiner");
- Assert.AreEqual(s.GetProperty(4),
+ ClassicAssert.AreEqual(s.GetProperty(4),
"petrovitsch@schreiner-online.de");
- Assert.AreEqual(s.GetProperty(5),
+ ClassicAssert.AreEqual(s.GetProperty(5),
"Petrovitsch, Wilhelm");
}
}
diff --git a/testcases/main/HPSF/Basic/TestWrite.cs b/testcases/main/HPSF/Basic/TestWrite.cs
index 4508aa2ae..c6a4a1704 100644
--- a/testcases/main/HPSF/Basic/TestWrite.cs
+++ b/testcases/main/HPSF/Basic/TestWrite.cs
@@ -30,7 +30,7 @@ namespace TestCases.HPSF.Basic
using NPOI.POIFS.FileSystem;
using NPOI.Util;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NUnit.Framework.Constraints;
/**
@@ -104,7 +104,7 @@ public void TestWithoutAFormatID()
}
catch (Exception ex)
{
- Assert.IsTrue(ex is NoFormatIDException);
+ ClassicAssert.IsTrue(ex is NoFormatIDException);
}
finally
{
@@ -232,14 +232,14 @@ public void TestWriteSimplePropertySet()
POIFSReaderListener1 psl = new POIFSReaderListener1();
reader1.RegisterListener(psl);
reader1.Read(file);
- Assert.IsNotNull(psa[0]);
- Assert.IsTrue(psa[0].IsSummaryInformation);
+ ClassicAssert.IsNotNull(psa[0]);
+ ClassicAssert.IsTrue(psa[0].IsSummaryInformation);
Section s = (Section)(psa[0].Sections[0]);
Object p1 = s.GetProperty(PropertyIDMap.PID_AUTHOR);
Object p2 = s.GetProperty(PropertyIDMap.PID_TITLE);
- Assert.AreEqual(AUTHOR, p1);
- Assert.AreEqual(TITLE, p2);
+ ClassicAssert.AreEqual(AUTHOR, p1);
+ ClassicAssert.AreEqual(TITLE, p2);
file.Close();
try
{
@@ -313,14 +313,14 @@ public void TestWriteTwoSections()
POIFSReaderListener2 prl = new POIFSReaderListener2();
reader2.RegisterListener(prl);
reader2.Read(file);
- Assert.IsNotNull(psa[0]);
+ ClassicAssert.IsNotNull(psa[0]);
Section s = (Section)(psa[0].Sections[0]);
- Assert.AreEqual(s.FormatID, formatID);
+ ClassicAssert.AreEqual(s.FormatID, formatID);
Object p = s.GetProperty(2);
- Assert.AreEqual(SECTION1, p);
+ ClassicAssert.AreEqual(SECTION1, p);
s = (Section)(psa[0].Sections[1]);
p = s.GetProperty(2);
- Assert.AreEqual(SECTION2, p);
+ ClassicAssert.AreEqual(SECTION2, p);
file.Close();
//File.Delete(dataDir + POI_FS);
@@ -535,10 +535,10 @@ public void TestUnicodeWrite8Bit()
byte[] bytes = out1.ToArray();
PropertySet psr = new PropertySet(bytes);
- Assert.IsTrue(psr.IsSummaryInformation);
+ ClassicAssert.IsTrue(psr.IsSummaryInformation);
Section sr = (Section)psr.Sections[0];
String title = (String)sr.GetProperty(PropertyIDMap.PID_TITLE);
- Assert.AreEqual(TITLE, title);
+ ClassicAssert.AreEqual(TITLE, title);
}
catch (WritingNotSupportedException e)
{
@@ -600,7 +600,7 @@ private void check(long variantType, Object value,
" (" + Encoding.Default.EncodingName + ")." : "."));
}
else
- Assert.AreEqual(value, objRead);
+ ClassicAssert.AreEqual(value, objRead);
}
@@ -722,7 +722,7 @@ private void TestRecreate(FileInfo f)
/* Compare the property Set stream with the corresponding one
* from the origin file and check whether they are equal. */
- Assert.AreEqual(ps1, ps2, "Equality for file " + f.Name);
+ ClassicAssert.AreEqual(ps1, ps2, "Equality for file " + f.Name);
}
out1.Close();
}
@@ -754,18 +754,18 @@ public void TestDictionary()
}
/* Read back: */
POIFile[] psf = Util.ReadPropertySets(copy);
- Assert.AreEqual(1, psf.Length);
+ ClassicAssert.AreEqual(1, psf.Length);
byte[] bytes = psf[0].GetBytes();
InputStream in1 = new ByteArrayInputStream(bytes);
PropertySet ps2 = PropertySetFactory.Create(in1);
/* Check if the result is a DocumentSummaryInformation stream, as
* specified. */
- Assert.IsTrue(ps2.IsDocumentSummaryInformation);
+ ClassicAssert.IsTrue(ps2.IsDocumentSummaryInformation);
/* Compare the property Set stream with the corresponding one
* from the origin file and check whether they are equal. */
- Assert.IsTrue(ps1.Equals(ps2));
+ ClassicAssert.IsTrue(ps1.Equals(ps2));
copy.Delete();
}
@@ -807,20 +807,20 @@ public void TestInPlaceNPOIFSWrite()
InputStream sinfStream = new NDocumentInputStream(sinfDoc);
sinf = (SummaryInformation)PropertySetFactory.Create(sinfStream);
sinfStream.Close();
- Assert.AreEqual(131077, sinf.OSVersion);
+ ClassicAssert.AreEqual(131077, sinf.OSVersion);
InputStream dinfStream = new NDocumentInputStream(dinfDoc);
dinf = (DocumentSummaryInformation)PropertySetFactory.Create(dinfStream);
dinfStream.Close();
- Assert.AreEqual(131077, dinf.OSVersion);
+ ClassicAssert.AreEqual(131077, dinf.OSVersion);
// Check they start as we expect
- Assert.AreEqual("Reiichiro Hori", sinf.Author);
- Assert.AreEqual("Microsoft Word 9.0", sinf.ApplicationName);
- Assert.AreEqual("\u7b2c1\u7ae0", sinf.Title);
+ ClassicAssert.AreEqual("Reiichiro Hori", sinf.Author);
+ ClassicAssert.AreEqual("Microsoft Word 9.0", sinf.ApplicationName);
+ ClassicAssert.AreEqual("\u7b2c1\u7ae0", sinf.Title);
- Assert.AreEqual("", dinf.Company);
- Assert.AreEqual(null, dinf.Manager);
+ ClassicAssert.AreEqual("", dinf.Company);
+ ClassicAssert.AreEqual(null, dinf.Manager);
// Do an in-place replace via an InputStream
new NPOIFSDocument(sinfDoc).ReplaceContents(sinf.ToInputStream());
@@ -834,12 +834,12 @@ public void TestInPlaceNPOIFSWrite()
InputStream sinfStream2 = new NDocumentInputStream(sinfDoc);
sinf = (SummaryInformation)PropertySetFactory.Create(sinfStream2);
sinfStream2.Close();
- Assert.AreEqual(131077, sinf.OSVersion);
+ ClassicAssert.AreEqual(131077, sinf.OSVersion);
InputStream dinfStream2 = new NDocumentInputStream(dinfDoc);
dinf = (DocumentSummaryInformation)PropertySetFactory.Create(dinfStream2);
dinfStream2.Close();
- Assert.AreEqual(131077, dinf.OSVersion);
+ ClassicAssert.AreEqual(131077, dinf.OSVersion);
// Start again!
@@ -861,12 +861,12 @@ public void TestInPlaceNPOIFSWrite()
InputStream sinfStream3 = new NDocumentInputStream(sinfDoc);
sinf = (SummaryInformation)PropertySetFactory.Create(sinfStream3);
sinfStream3.Close();
- Assert.AreEqual(131077, sinf.OSVersion);
+ ClassicAssert.AreEqual(131077, sinf.OSVersion);
InputStream dinfStream3 = new NDocumentInputStream(dinfDoc);
dinf = (DocumentSummaryInformation)PropertySetFactory.Create(dinfStream3);
dinfStream3.Close();
- Assert.AreEqual(131077, dinf.OSVersion);
+ ClassicAssert.AreEqual(131077, dinf.OSVersion);
// Have them write themselves in-place with no Changes
@@ -902,19 +902,19 @@ public void TestInPlaceNPOIFSWrite()
InputStream sinfStream5 = new NDocumentInputStream(sinfDoc);
sinf = (SummaryInformation)PropertySetFactory.Create(sinfStream5);
sinfStream5.Close();
- Assert.AreEqual(131077, sinf.OSVersion);
+ ClassicAssert.AreEqual(131077, sinf.OSVersion);
InputStream dinfStream5 = new NDocumentInputStream(dinfDoc);
dinf = (DocumentSummaryInformation)PropertySetFactory.Create(dinfStream5);
dinfStream5.Close();
- Assert.AreEqual(131077, dinf.OSVersion);
+ ClassicAssert.AreEqual(131077, dinf.OSVersion);
- Assert.AreEqual("Reiichiro Hori", sinf.Author);
- Assert.AreEqual("Microsoft Word 9.0", sinf.ApplicationName);
- Assert.AreEqual("\u7b2c1\u7ae0", sinf.Title);
+ ClassicAssert.AreEqual("Reiichiro Hori", sinf.Author);
+ ClassicAssert.AreEqual("Microsoft Word 9.0", sinf.ApplicationName);
+ ClassicAssert.AreEqual("\u7b2c1\u7ae0", sinf.Title);
- Assert.AreEqual("", dinf.Company);
- Assert.AreEqual(null, dinf.Manager);
+ ClassicAssert.AreEqual("", dinf.Company);
+ ClassicAssert.AreEqual(null, dinf.Manager);
// Now alter a few of them
@@ -937,20 +937,20 @@ public void TestInPlaceNPOIFSWrite()
InputStream sinfStream6 = new NDocumentInputStream(sinfDoc);
sinf = (SummaryInformation)PropertySetFactory.Create(sinfStream6);
sinfStream6.Close();
- Assert.AreEqual(131077, sinf.OSVersion);
+ ClassicAssert.AreEqual(131077, sinf.OSVersion);
dinfDoc = (DocumentNode)root.GetEntry(DocumentSummaryInformation.DEFAULT_STREAM_NAME);
InputStream dinfStream6 = new NDocumentInputStream(dinfDoc);
dinf = (DocumentSummaryInformation)PropertySetFactory.Create(dinfStream6);
dinfStream6.Close();
- Assert.AreEqual(131077, dinf.OSVersion);
+ ClassicAssert.AreEqual(131077, dinf.OSVersion);
- Assert.AreEqual("Changed Author", sinf.Author);
- Assert.AreEqual("Microsoft Word 9.0", sinf.ApplicationName);
- Assert.AreEqual("Le titre \u00e9tait chang\u00e9", sinf.Title);
+ ClassicAssert.AreEqual("Changed Author", sinf.Author);
+ ClassicAssert.AreEqual("Microsoft Word 9.0", sinf.ApplicationName);
+ ClassicAssert.AreEqual("Le titre \u00e9tait chang\u00e9", sinf.Title);
- Assert.AreEqual("", dinf.Company);
- Assert.AreEqual("Changed Manager", dinf.Manager);
+ ClassicAssert.AreEqual("", dinf.Company);
+ ClassicAssert.AreEqual("Changed Manager", dinf.Manager);
// Close the whole filesystem, and open it once more
@@ -965,20 +965,20 @@ public void TestInPlaceNPOIFSWrite()
InputStream sinfStream7 = new NDocumentInputStream(sinfDoc);
sinf = (SummaryInformation)PropertySetFactory.Create(sinfStream7);
sinfStream7.Close();
- Assert.AreEqual(131077, sinf.OSVersion);
+ ClassicAssert.AreEqual(131077, sinf.OSVersion);
dinfDoc = (DocumentNode)root.GetEntry(DocumentSummaryInformation.DEFAULT_STREAM_NAME);
InputStream dinfStream7 = new NDocumentInputStream(dinfDoc);
dinf = (DocumentSummaryInformation)PropertySetFactory.Create(dinfStream7);
dinfStream7.Close();
- Assert.AreEqual(131077, dinf.OSVersion);
+ ClassicAssert.AreEqual(131077, dinf.OSVersion);
- Assert.AreEqual("Changed Author", sinf.Author);
- Assert.AreEqual("Microsoft Word 9.0", sinf.ApplicationName);
- Assert.AreEqual("Le titre \u00e9tait chang\u00e9", sinf.Title);
+ ClassicAssert.AreEqual("Changed Author", sinf.Author);
+ ClassicAssert.AreEqual("Microsoft Word 9.0", sinf.ApplicationName);
+ ClassicAssert.AreEqual("Le titre \u00e9tait chang\u00e9", sinf.Title);
- Assert.AreEqual("", dinf.Company);
- Assert.AreEqual("Changed Manager", dinf.Manager);
+ ClassicAssert.AreEqual("", dinf.Company);
+ ClassicAssert.AreEqual("Changed Manager", dinf.Manager);
// Tidy up
diff --git a/testcases/main/HPSF/Basic/TestWriteWellKnown.cs b/testcases/main/HPSF/Basic/TestWriteWellKnown.cs
index 5cf6c6866..777affbb5 100644
--- a/testcases/main/HPSF/Basic/TestWriteWellKnown.cs
+++ b/testcases/main/HPSF/Basic/TestWriteWellKnown.cs
@@ -27,7 +27,7 @@ namespace TestCases.HPSF.Basic
using NPOI.HPSF.Wellknown;
using NPOI.POIFS.FileSystem;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
* Tests HPSF's high-level writing functionality for the well-known property
@@ -322,62 +322,62 @@ public void TestWriteWellKnown1()
ps = new PropertySet(dis);
dsi = new DocumentSummaryInformation(ps);
- Assert.AreEqual(P_APPLICATION_NAME, si.ApplicationName);
- Assert.AreEqual(P_AUTHOR, si.Author);
- Assert.AreEqual(P_CHAR_COUNT, si.CharCount);
- Assert.AreEqual(P_COMMENTS, si.Comments);
- Assert.AreEqual(P_CREATE_DATE_TIME, si.CreateDateTime);
- Assert.AreEqual(P_EDIT_TIME, si.EditTime);
- Assert.AreEqual(P_KEYWORDS, si.Keywords);
- Assert.AreEqual(P_LAST_AUTHOR, si.LastAuthor);
- Assert.AreEqual(P_LAST_PRINTED, si.LastPrinted);
- Assert.AreEqual(P_LAST_SAVE_DATE_TIME, si.LastSaveDateTime);
- Assert.AreEqual(P_PAGE_COUNT, si.PageCount);
- Assert.AreEqual(P_REV_NUMBER, si.RevNumber);
- Assert.AreEqual(P_SECURITY, si.Security);
- Assert.AreEqual(P_SUBJECT, si.Subject);
- Assert.AreEqual(P_TEMPLATE, si.Template);
- // FIXME (byte array properties not yet implemented): Assert.AreEqual(P_THUMBNAIL, si.Thumbnail);
- Assert.AreEqual(P_TITLE, si.Title);
- Assert.AreEqual(P_WORD_COUNT, si.WordCount);
-
- Assert.AreEqual(P_BYTE_COUNT, dsi.ByteCount);
- Assert.AreEqual(P_CATEGORY, dsi.Category);
- Assert.AreEqual(P_COMPANY, dsi.Company);
- // FIXME (byte array properties not yet implemented): Assert.AreEqual(P_, dsi.Docparts);
- // FIXME (byte array properties not yet implemented): Assert.AreEqual(P_, dsi.HeadingPair);
- Assert.AreEqual(P_HIDDEN_COUNT, dsi.HiddenCount);
- Assert.AreEqual(P_LINE_COUNT, dsi.LineCount);
- Assert.AreEqual(P_LINKS_DIRTY, dsi.LinksDirty);
- Assert.AreEqual(P_MANAGER, dsi.Manager);
- Assert.AreEqual(P_MM_CLIP_COUNT, dsi.MMClipCount);
- Assert.AreEqual(P_NOTE_COUNT, dsi.NoteCount);
- Assert.AreEqual(P_PAR_COUNT, dsi.ParCount);
- Assert.AreEqual(P_PRESENTATION_FORMAT, dsi.PresentationFormat);
- Assert.AreEqual(P_SCALE, dsi.Scale);
- Assert.AreEqual(P_SLIDE_COUNT, dsi.SlideCount);
+ ClassicAssert.AreEqual(P_APPLICATION_NAME, si.ApplicationName);
+ ClassicAssert.AreEqual(P_AUTHOR, si.Author);
+ ClassicAssert.AreEqual(P_CHAR_COUNT, si.CharCount);
+ ClassicAssert.AreEqual(P_COMMENTS, si.Comments);
+ ClassicAssert.AreEqual(P_CREATE_DATE_TIME, si.CreateDateTime);
+ ClassicAssert.AreEqual(P_EDIT_TIME, si.EditTime);
+ ClassicAssert.AreEqual(P_KEYWORDS, si.Keywords);
+ ClassicAssert.AreEqual(P_LAST_AUTHOR, si.LastAuthor);
+ ClassicAssert.AreEqual(P_LAST_PRINTED, si.LastPrinted);
+ ClassicAssert.AreEqual(P_LAST_SAVE_DATE_TIME, si.LastSaveDateTime);
+ ClassicAssert.AreEqual(P_PAGE_COUNT, si.PageCount);
+ ClassicAssert.AreEqual(P_REV_NUMBER, si.RevNumber);
+ ClassicAssert.AreEqual(P_SECURITY, si.Security);
+ ClassicAssert.AreEqual(P_SUBJECT, si.Subject);
+ ClassicAssert.AreEqual(P_TEMPLATE, si.Template);
+ // FIXME (byte array properties not yet implemented): ClassicAssert.AreEqual(P_THUMBNAIL, si.Thumbnail);
+ ClassicAssert.AreEqual(P_TITLE, si.Title);
+ ClassicAssert.AreEqual(P_WORD_COUNT, si.WordCount);
+
+ ClassicAssert.AreEqual(P_BYTE_COUNT, dsi.ByteCount);
+ ClassicAssert.AreEqual(P_CATEGORY, dsi.Category);
+ ClassicAssert.AreEqual(P_COMPANY, dsi.Company);
+ // FIXME (byte array properties not yet implemented): ClassicAssert.AreEqual(P_, dsi.Docparts);
+ // FIXME (byte array properties not yet implemented): ClassicAssert.AreEqual(P_, dsi.HeadingPair);
+ ClassicAssert.AreEqual(P_HIDDEN_COUNT, dsi.HiddenCount);
+ ClassicAssert.AreEqual(P_LINE_COUNT, dsi.LineCount);
+ ClassicAssert.AreEqual(P_LINKS_DIRTY, dsi.LinksDirty);
+ ClassicAssert.AreEqual(P_MANAGER, dsi.Manager);
+ ClassicAssert.AreEqual(P_MM_CLIP_COUNT, dsi.MMClipCount);
+ ClassicAssert.AreEqual(P_NOTE_COUNT, dsi.NoteCount);
+ ClassicAssert.AreEqual(P_PAR_COUNT, dsi.ParCount);
+ ClassicAssert.AreEqual(P_PRESENTATION_FORMAT, dsi.PresentationFormat);
+ ClassicAssert.AreEqual(P_SCALE, dsi.Scale);
+ ClassicAssert.AreEqual(P_SLIDE_COUNT, dsi.SlideCount);
CustomProperties cps = dsi.CustomProperties;
- //Assert.AreEqual(customProperties, cps);
- Assert.IsNull(cps["No value available"]);
- Assert.AreEqual("Wert 1", cps["Schlssel 1"]);
- Assert.AreEqual("Wert 2", cps["Schlssel 2"]);
- Assert.AreEqual("Wert 3", cps["Schlssel 3"]);
- Assert.AreEqual("Wert 4", cps["Schlssel 4"]);
- Assert.AreEqual(POSITIVE_INTEGER, cps["positive_int"]);
- Assert.AreEqual(POSITIVE_LONG, cps["positive_long"]);
- Assert.AreEqual(POSITIVE_DOUBLE, cps["positive_Double"]);
- Assert.AreEqual(NEGATIVE_INTEGER, cps["negative_int"]);
- Assert.AreEqual(NEGATIVE_LONG, cps["negative_long"]);
- Assert.AreEqual(NEGATIVE_DOUBLE, cps["negative_Double"]);
- Assert.AreEqual(true, cps["Boolean"]);
- Assert.AreEqual(now, cps["Date"]);
- Assert.AreEqual(MAX_INTEGER, cps["max_int"]);
- Assert.AreEqual(MIN_INTEGER, cps["min_int"]);
- Assert.AreEqual(MAX_LONG, cps["max_long"]);
- Assert.AreEqual(MIN_LONG, cps["min_long"]);
- Assert.AreEqual(MAX_DOUBLE, cps["max_Double"]);
- Assert.AreEqual(MIN_DOUBLE, cps["min_Double"]);
+ //ClassicAssert.AreEqual(customProperties, cps);
+ ClassicAssert.IsNull(cps["No value available"]);
+ ClassicAssert.AreEqual("Wert 1", cps["Schlssel 1"]);
+ ClassicAssert.AreEqual("Wert 2", cps["Schlssel 2"]);
+ ClassicAssert.AreEqual("Wert 3", cps["Schlssel 3"]);
+ ClassicAssert.AreEqual("Wert 4", cps["Schlssel 4"]);
+ ClassicAssert.AreEqual(POSITIVE_INTEGER, cps["positive_int"]);
+ ClassicAssert.AreEqual(POSITIVE_LONG, cps["positive_long"]);
+ ClassicAssert.AreEqual(POSITIVE_DOUBLE, cps["positive_Double"]);
+ ClassicAssert.AreEqual(NEGATIVE_INTEGER, cps["negative_int"]);
+ ClassicAssert.AreEqual(NEGATIVE_LONG, cps["negative_long"]);
+ ClassicAssert.AreEqual(NEGATIVE_DOUBLE, cps["negative_Double"]);
+ ClassicAssert.AreEqual(true, cps["Boolean"]);
+ ClassicAssert.AreEqual(now, cps["Date"]);
+ ClassicAssert.AreEqual(MAX_INTEGER, cps["max_int"]);
+ ClassicAssert.AreEqual(MIN_INTEGER, cps["min_int"]);
+ ClassicAssert.AreEqual(MAX_LONG, cps["max_long"]);
+ ClassicAssert.AreEqual(MIN_LONG, cps["min_long"]);
+ ClassicAssert.AreEqual(MAX_DOUBLE, cps["max_Double"]);
+ ClassicAssert.AreEqual(MIN_DOUBLE, cps["min_Double"]);
/* Remove all properties supported by HPSF from the summary
* information (e.g. author, edit date, application name) and from the
@@ -450,54 +450,54 @@ public void TestWriteWellKnown1()
ps = new PropertySet(dis);
dsi = new DocumentSummaryInformation(ps);
- Assert.AreEqual(null, si.ApplicationName);
- Assert.AreEqual(null, si.Author);
- Assert.AreEqual(0, si.CharCount);
- Assert.IsTrue(si.WasNull);
- Assert.AreEqual(null, si.Comments);
- Assert.AreEqual(null, si.CreateDateTime);
- Assert.AreEqual(0, si.EditTime);
- Assert.IsTrue(si.WasNull);
- Assert.AreEqual(null, si.Keywords);
- Assert.AreEqual(null, si.LastAuthor);
- Assert.AreEqual(null, si.LastPrinted);
- Assert.AreEqual(null, si.LastSaveDateTime);
- Assert.AreEqual(0, si.PageCount);
- Assert.IsTrue(si.WasNull);
- Assert.AreEqual(null, si.RevNumber);
- Assert.AreEqual(0, si.Security);
- Assert.IsTrue(si.WasNull);
- Assert.AreEqual(null, si.Subject);
- Assert.AreEqual(null, si.Template);
- Assert.AreEqual(null, si.Thumbnail);
- Assert.AreEqual(null, si.Title);
- Assert.AreEqual(0, si.WordCount);
- Assert.IsTrue(si.WasNull);
-
- Assert.AreEqual(0, dsi.ByteCount);
- Assert.IsTrue(dsi.WasNull);
- Assert.AreEqual(null, dsi.Category);
- Assert.AreEqual(null, dsi.CustomProperties);
- // FIXME (byte array properties not yet implemented): Assert.AreEqual(null, dsi.Docparts);
- // FIXME (byte array properties not yet implemented): Assert.AreEqual(null, dsi.HeadingPair);
- Assert.AreEqual(0, dsi.HiddenCount);
- Assert.IsTrue(dsi.WasNull);
- Assert.AreEqual(0, dsi.LineCount);
- Assert.IsTrue(dsi.WasNull);
- Assert.AreEqual(false, dsi.LinksDirty);
- Assert.IsTrue(dsi.WasNull);
- Assert.AreEqual(null, dsi.Manager);
- Assert.AreEqual(0, dsi.MMClipCount);
- Assert.IsTrue(dsi.WasNull);
- Assert.AreEqual(0, dsi.NoteCount);
- Assert.IsTrue(dsi.WasNull);
- Assert.AreEqual(0, dsi.ParCount);
- Assert.IsTrue(dsi.WasNull);
- Assert.AreEqual(null, dsi.PresentationFormat);
- Assert.AreEqual(false, dsi.Scale);
- Assert.IsTrue(dsi.WasNull);
- Assert.AreEqual(0, dsi.SlideCount);
- Assert.IsTrue(dsi.WasNull);
+ ClassicAssert.AreEqual(null, si.ApplicationName);
+ ClassicAssert.AreEqual(null, si.Author);
+ ClassicAssert.AreEqual(0, si.CharCount);
+ ClassicAssert.IsTrue(si.WasNull);
+ ClassicAssert.AreEqual(null, si.Comments);
+ ClassicAssert.AreEqual(null, si.CreateDateTime);
+ ClassicAssert.AreEqual(0, si.EditTime);
+ ClassicAssert.IsTrue(si.WasNull);
+ ClassicAssert.AreEqual(null, si.Keywords);
+ ClassicAssert.AreEqual(null, si.LastAuthor);
+ ClassicAssert.AreEqual(null, si.LastPrinted);
+ ClassicAssert.AreEqual(null, si.LastSaveDateTime);
+ ClassicAssert.AreEqual(0, si.PageCount);
+ ClassicAssert.IsTrue(si.WasNull);
+ ClassicAssert.AreEqual(null, si.RevNumber);
+ ClassicAssert.AreEqual(0, si.Security);
+ ClassicAssert.IsTrue(si.WasNull);
+ ClassicAssert.AreEqual(null, si.Subject);
+ ClassicAssert.AreEqual(null, si.Template);
+ ClassicAssert.AreEqual(null, si.Thumbnail);
+ ClassicAssert.AreEqual(null, si.Title);
+ ClassicAssert.AreEqual(0, si.WordCount);
+ ClassicAssert.IsTrue(si.WasNull);
+
+ ClassicAssert.AreEqual(0, dsi.ByteCount);
+ ClassicAssert.IsTrue(dsi.WasNull);
+ ClassicAssert.AreEqual(null, dsi.Category);
+ ClassicAssert.AreEqual(null, dsi.CustomProperties);
+ // FIXME (byte array properties not yet implemented): ClassicAssert.AreEqual(null, dsi.Docparts);
+ // FIXME (byte array properties not yet implemented): ClassicAssert.AreEqual(null, dsi.HeadingPair);
+ ClassicAssert.AreEqual(0, dsi.HiddenCount);
+ ClassicAssert.IsTrue(dsi.WasNull);
+ ClassicAssert.AreEqual(0, dsi.LineCount);
+ ClassicAssert.IsTrue(dsi.WasNull);
+ ClassicAssert.AreEqual(false, dsi.LinksDirty);
+ ClassicAssert.IsTrue(dsi.WasNull);
+ ClassicAssert.AreEqual(null, dsi.Manager);
+ ClassicAssert.AreEqual(0, dsi.MMClipCount);
+ ClassicAssert.IsTrue(dsi.WasNull);
+ ClassicAssert.AreEqual(0, dsi.NoteCount);
+ ClassicAssert.IsTrue(dsi.WasNull);
+ ClassicAssert.AreEqual(0, dsi.ParCount);
+ ClassicAssert.IsTrue(dsi.WasNull);
+ ClassicAssert.AreEqual(null, dsi.PresentationFormat);
+ ClassicAssert.AreEqual(false, dsi.Scale);
+ ClassicAssert.IsTrue(dsi.WasNull);
+ ClassicAssert.AreEqual(0, dsi.SlideCount);
+ ClassicAssert.IsTrue(dsi.WasNull);
}
}
}
@@ -553,8 +553,8 @@ private void RunTest(FileStream file)
foreach (var de in cps)
{
CustomProperty cp = (CustomProperty)de.Value;
- Assert.IsNotNull(cp.Name);
- Assert.IsNotNull(cp.Value);
+ ClassicAssert.IsNotNull(cp.Name);
+ ClassicAssert.IsNotNull(cp.Value);
}
}
@@ -600,28 +600,28 @@ public void TestCustomerProperties()
CustomProperty cp;
CustomProperties cps = new CustomProperties();
- Assert.AreEqual(0, cps.Count);
+ ClassicAssert.AreEqual(0, cps.Count);
/* After Adding a custom property the size must be 1 and it must be
* possible to extract the custom property from the map. */
cps.Put(KEY, VALUE_1);
- Assert.AreEqual(1, cps.Count);
+ ClassicAssert.AreEqual(1, cps.Count);
Object v1 = cps[KEY];
- Assert.AreEqual(VALUE_1, v1);
+ ClassicAssert.AreEqual(VALUE_1, v1);
/* After Adding a custom property with the same name the size must still
* be one. */
cps.Put(KEY, VALUE_2);
- Assert.AreEqual(1, cps.Count);
+ ClassicAssert.AreEqual(1, cps.Count);
Object v2 = cps[KEY];
- Assert.AreEqual(VALUE_2, v2);
+ ClassicAssert.AreEqual(VALUE_2, v2);
/* Removing the custom property must return the Remove property and
* reduce the size to 0. */
cp = (CustomProperty)cps.Remove(KEY);
- Assert.AreEqual(KEY, cp.Name);
- Assert.AreEqual(VALUE_2, cp.Value);
- Assert.AreEqual(0, cps.Count);
+ ClassicAssert.AreEqual(KEY, cp.Name);
+ ClassicAssert.AreEqual(VALUE_2, cp.Value);
+ ClassicAssert.AreEqual(0, cps.Count);
}
/**
@@ -643,7 +643,7 @@ public void TestGetCustomerProperties()
/* A document summary information Set stream by default does have custom properties. */
cps = dsi.CustomProperties;
- Assert.AreEqual(null, cps);
+ ClassicAssert.AreEqual(null, cps);
/* Test an empty custom properties Set. */
s = new MutableSection();
@@ -651,7 +651,7 @@ public void TestGetCustomerProperties()
// s.SetCodepage(CodePageUtil.CP_UNICODE);
dsi.AddSection(s);
cps = dsi.CustomProperties;
- Assert.AreEqual(0, cps.Count);
+ ClassicAssert.AreEqual(0, cps.Count);
/* Add a custom property. */
MutableProperty p = new MutableProperty();
@@ -662,16 +662,16 @@ public void TestGetCustomerProperties()
dictionary[ID_1] = NAME_1;
s.SetDictionary(dictionary);
cps = dsi.CustomProperties;
- Assert.AreEqual(1, cps.Count);
- Assert.IsTrue(cps.IsPure);
+ ClassicAssert.AreEqual(1, cps.Count);
+ ClassicAssert.IsTrue(cps.IsPure);
/* Add another custom property. */
s.SetProperty((int)ID_2, Variant.VT_LPWSTR, VALUE_1);
dictionary[ID_2] = NAME_1;
s.SetDictionary(dictionary);
cps = dsi.CustomProperties;
- Assert.AreEqual(1, cps.Count);
- Assert.IsFalse(cps.IsPure);
+ ClassicAssert.AreEqual(1, cps.Count);
+ ClassicAssert.IsFalse(cps.IsPure);
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HPSF/Basic/Util.cs b/testcases/main/HPSF/Basic/Util.cs
index a0f9827d4..15fe07374 100644
--- a/testcases/main/HPSF/Basic/Util.cs
+++ b/testcases/main/HPSF/Basic/Util.cs
@@ -22,7 +22,7 @@ namespace TestCases.HPSF.Basic
using System;
using System.IO;
using System.Collections;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HPSF;
using NPOI.POIFS.EventFileSystem;
using NPOI.Util;
diff --git a/testcases/main/HPSF/Extractor/TestHPSFPropertiesExtractor.cs b/testcases/main/HPSF/Extractor/TestHPSFPropertiesExtractor.cs
index 1a405db80..a089e014a 100644
--- a/testcases/main/HPSF/Extractor/TestHPSFPropertiesExtractor.cs
+++ b/testcases/main/HPSF/Extractor/TestHPSFPropertiesExtractor.cs
@@ -21,7 +21,7 @@ namespace TestCases.HPSF.Extractor
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF;
using NPOI.HSSF.UserModel;
@@ -48,17 +48,17 @@ public void TestNormalProperties()
String sinfText = ext.SummaryInformationText;
String dinfText = ext.DocumentSummaryInformationText;
- Assert.IsTrue(sinfText.IndexOf("TEMPLATE = Normal") > -1);
- Assert.IsTrue(sinfText.IndexOf("SUBJECT = sample subject") > -1);
- Assert.IsTrue(dinfText.IndexOf("MANAGER = sample manager") > -1);
- Assert.IsTrue(dinfText.IndexOf("COMPANY = sample company") > -1);
+ ClassicAssert.IsTrue(sinfText.IndexOf("TEMPLATE = Normal") > -1);
+ ClassicAssert.IsTrue(sinfText.IndexOf("SUBJECT = sample subject") > -1);
+ ClassicAssert.IsTrue(dinfText.IndexOf("MANAGER = sample manager") > -1);
+ ClassicAssert.IsTrue(dinfText.IndexOf("COMPANY = sample company") > -1);
// Now overall
text = ext.Text;
- Assert.IsTrue(text.IndexOf("TEMPLATE = Normal") > -1);
- Assert.IsTrue(text.IndexOf("SUBJECT = sample subject") > -1);
- Assert.IsTrue(text.IndexOf("MANAGER = sample manager") > -1);
- Assert.IsTrue(text.IndexOf("COMPANY = sample company") > -1);
+ ClassicAssert.IsTrue(text.IndexOf("TEMPLATE = Normal") > -1);
+ ClassicAssert.IsTrue(text.IndexOf("SUBJECT = sample subject") > -1);
+ ClassicAssert.IsTrue(text.IndexOf("MANAGER = sample manager") > -1);
+ ClassicAssert.IsTrue(text.IndexOf("COMPANY = sample company") > -1);
}
[Test]
@@ -72,17 +72,17 @@ public void TestNormalUnicodeProperties()
String sinfText = ext.SummaryInformationText;
String dinfText = ext.DocumentSummaryInformationText;
- Assert.IsTrue(sinfText.IndexOf("AUTHOR = marshall") > -1);
- Assert.IsTrue(sinfText.IndexOf("TITLE = Titel: \u00c4h") > -1);
- Assert.IsTrue(dinfText.IndexOf("COMPANY = Schreiner") > -1);
- Assert.IsTrue(dinfText.IndexOf("SCALE = False") > -1);
+ ClassicAssert.IsTrue(sinfText.IndexOf("AUTHOR = marshall") > -1);
+ ClassicAssert.IsTrue(sinfText.IndexOf("TITLE = Titel: \u00c4h") > -1);
+ ClassicAssert.IsTrue(dinfText.IndexOf("COMPANY = Schreiner") > -1);
+ ClassicAssert.IsTrue(dinfText.IndexOf("SCALE = False") > -1);
// Now overall
text = ext.Text;
- Assert.IsTrue(text.IndexOf("AUTHOR = marshall") > -1);
- Assert.IsTrue(text.IndexOf("TITLE = Titel: \u00c4h") > -1);
- Assert.IsTrue(text.IndexOf("COMPANY = Schreiner") > -1);
- Assert.IsTrue(text.IndexOf("SCALE = False") > -1);
+ ClassicAssert.IsTrue(text.IndexOf("AUTHOR = marshall") > -1);
+ ClassicAssert.IsTrue(text.IndexOf("TITLE = Titel: \u00c4h") > -1);
+ ClassicAssert.IsTrue(text.IndexOf("COMPANY = Schreiner") > -1);
+ ClassicAssert.IsTrue(text.IndexOf("SCALE = False") > -1);
}
[Test]
@@ -95,12 +95,12 @@ public void TestCustomProperties()
// Custom properties are part of the document info stream
String dinfText = ext.DocumentSummaryInformationText;
- Assert.IsTrue(dinfText.IndexOf("Client = sample client") > -1);
- Assert.IsTrue(dinfText.IndexOf("Division = sample division") > -1);
+ ClassicAssert.IsTrue(dinfText.IndexOf("Client = sample client") > -1);
+ ClassicAssert.IsTrue(dinfText.IndexOf("Division = sample division") > -1);
String text = ext.Text;
- Assert.IsTrue(text.IndexOf("Client = sample client") > -1);
- Assert.IsTrue(text.IndexOf("Division = sample division") > -1);
+ ClassicAssert.IsTrue(text.IndexOf("Client = sample client") > -1);
+ ClassicAssert.IsTrue(text.IndexOf("Division = sample division") > -1);
}
[Test]
@@ -155,11 +155,11 @@ public void TestConstructors()
eeExt.Close();
}
- Assert.AreEqual(fsText, hwText);
- Assert.AreEqual(fsText, eeText);
+ ClassicAssert.AreEqual(fsText, hwText);
+ ClassicAssert.AreEqual(fsText, eeText);
- Assert.IsTrue(fsText.IndexOf("AUTHOR = marshall") > -1);
- Assert.IsTrue(fsText.IndexOf("TITLE = Titel: \u00c4h") > -1);
+ ClassicAssert.IsTrue(fsText.IndexOf("AUTHOR = marshall") > -1);
+ ClassicAssert.IsTrue(fsText.IndexOf("TITLE = Titel: \u00c4h") > -1);
// Finally tidy
wb.Close();
@@ -170,10 +170,10 @@ public void Test42726()
{
HPSFPropertiesExtractor ex = new HPSFPropertiesExtractor(HSSFTestDataSamples.OpenSampleWorkbook("42726.xls"));
String txt = ex.Text;
- Assert.IsTrue(txt.IndexOf("PID_AUTHOR") != -1);
- Assert.IsTrue(txt.IndexOf("PID_EDITTIME") != -1);
- Assert.IsTrue(txt.IndexOf("PID_REVNUMBER") != -1);
- Assert.IsTrue(txt.IndexOf("PID_THUMBNAIL") != -1);
+ ClassicAssert.IsTrue(txt.IndexOf("PID_AUTHOR") != -1);
+ ClassicAssert.IsTrue(txt.IndexOf("PID_EDITTIME") != -1);
+ ClassicAssert.IsTrue(txt.IndexOf("PID_REVNUMBER") != -1);
+ ClassicAssert.IsTrue(txt.IndexOf("PID_THUMBNAIL") != -1);
}
[Test]
@@ -182,9 +182,9 @@ public void TestThumbnail()
POIFSFileSystem fs = new POIFSFileSystem(_samples.OpenResourceAsStream("TestThumbnail.xls"));
HSSFWorkbook wb = new HSSFWorkbook(fs);
Thumbnail thumbnail = new Thumbnail(wb.SummaryInformation.Thumbnail);
- Assert.AreEqual(-1, thumbnail.ClipboardFormatTag);
- Assert.AreEqual(3, thumbnail.GetClipboardFormat());
- Assert.IsNotNull(thumbnail.GetThumbnailAsWMF());
+ ClassicAssert.AreEqual(-1, thumbnail.ClipboardFormatTag);
+ ClassicAssert.AreEqual(3, thumbnail.GetClipboardFormat());
+ ClassicAssert.IsNotNull(thumbnail.GetThumbnailAsWMF());
//wb.Close();
}
@@ -195,11 +195,11 @@ public void Test52258()
HPSFPropertiesExtractor ext = new HPSFPropertiesExtractor(fs);
try
{
- Assert.IsNotNull(ext.DocSummaryInformation);
- Assert.IsNotNull(ext.DocumentSummaryInformationText);
- Assert.IsNotNull(ext.SummaryInformation);
- Assert.IsNotNull(ext.SummaryInformationText);
- Assert.IsNotNull(ext.Text);
+ ClassicAssert.IsNotNull(ext.DocSummaryInformation);
+ ClassicAssert.IsNotNull(ext.DocumentSummaryInformationText);
+ ClassicAssert.IsNotNull(ext.SummaryInformation);
+ ClassicAssert.IsNotNull(ext.SummaryInformationText);
+ ClassicAssert.IsNotNull(ext.Text);
}
finally
{
diff --git a/testcases/main/HPSF/TestVariantSupport.cs b/testcases/main/HPSF/TestVariantSupport.cs
index 8fcc8903b..13ca974ff 100644
--- a/testcases/main/HPSF/TestVariantSupport.cs
+++ b/testcases/main/HPSF/TestVariantSupport.cs
@@ -19,7 +19,7 @@ limitations Under the License.
using NPOI.HPSF;
using NPOI.HPSF.Wellknown;
using NPOI.Util;
-using NUnit.Framework;
+using NUnit.Framework;using NUnit.Framework.Legacy;
namespace TestCases.HPSF
{
@@ -65,21 +65,21 @@ public void Test52337()
Object hdrs = s.GetProperty(PropertyIDMap.PID_HEADINGPAIR);
- Assert.IsNotNull(hdrs, "PID_HEADINGPAIR was not found");
+ ClassicAssert.IsNotNull(hdrs, "PID_HEADINGPAIR was not found");
- Assert.IsTrue(hdrs is byte[], "PID_HEADINGPAIR: expected byte[] but was " + hdrs.GetType());
+ ClassicAssert.IsTrue(hdrs is byte[], "PID_HEADINGPAIR: expected byte[] but was " + hdrs.GetType());
// parse the value
Vector v = new Vector((short)Variant.VT_VARIANT);
v.Read((byte[])hdrs, 0);
TypedPropertyValue[] items = v.Values;
- Assert.AreEqual(2, items.Length);
+ ClassicAssert.AreEqual(2, items.Length);
- Assert.IsNotNull(items[0].Value);
- Assert.IsTrue(items[0].Value is CodePageString, "first item must be CodePageString but was " + items[0].GetType());
- Assert.IsNotNull(items[1].Value);
- Assert.IsTrue(Number.IsInteger(items[1].Value), "second item must be Integer but was " + items[1].Value.GetType());
- Assert.AreEqual(1, (int)items[1].Value);
+ ClassicAssert.IsNotNull(items[0].Value);
+ ClassicAssert.IsTrue(items[0].Value is CodePageString, "first item must be CodePageString but was " + items[0].GetType());
+ ClassicAssert.IsNotNull(items[1].Value);
+ ClassicAssert.IsTrue(Number.IsInteger(items[1].Value), "second item must be Integer but was " + items[1].Value.GetType());
+ ClassicAssert.AreEqual(1, (int)items[1].Value);
}
}
diff --git a/testcases/main/HSSF/EventModel/TestAbortableListener.cs b/testcases/main/HSSF/EventModel/TestAbortableListener.cs
index 45576179b..8eb73c223 100644
--- a/testcases/main/HSSF/EventModel/TestAbortableListener.cs
+++ b/testcases/main/HSSF/EventModel/TestAbortableListener.cs
@@ -18,7 +18,7 @@ limitations under the License.
namespace TestCases.HSSF.EventModel
{
using System.IO;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.EventUserModel;
using NPOI.HSSF.Record;
using NPOI.POIFS.FileSystem;
@@ -56,16 +56,16 @@ public void TestAbortingBasics()
HSSFEventFactory f = new HSSFEventFactory();
- Assert.AreEqual(0, l.countSeen);
- Assert.AreEqual(null, l.lastRecordSeen);
+ ClassicAssert.AreEqual(0, l.countSeen);
+ ClassicAssert.AreEqual(null, l.lastRecordSeen);
POIFSFileSystem fs = openSample();
short res = f.AbortableProcessWorkbookEvents(req, fs);
- Assert.AreEqual(0, res);
- //Assert.AreEqual(175, l.countSeen);
- Assert.AreEqual(176, l.countSeen); //Tony Qu add a sheetext record, so this value should be 176
- Assert.AreEqual(EOFRecord.sid, l.lastRecordSeen.Sid);
+ ClassicAssert.AreEqual(0, res);
+ //ClassicAssert.AreEqual(175, l.countSeen);
+ ClassicAssert.AreEqual(176, l.countSeen); //Tony Qu add a sheetext record, so this value should be 176
+ ClassicAssert.AreEqual(EOFRecord.sid, l.lastRecordSeen.Sid);
}
@@ -79,15 +79,15 @@ public void TestAbortStops()
HSSFEventFactory f = new HSSFEventFactory();
- Assert.AreEqual(0, l.countSeen);
- Assert.AreEqual(null, l.lastRecordSeen);
+ ClassicAssert.AreEqual(0, l.countSeen);
+ ClassicAssert.AreEqual(null, l.lastRecordSeen);
POIFSFileSystem fs = openSample();
short res = f.AbortableProcessWorkbookEvents(req, fs);
- Assert.AreEqual(1234, res);
- Assert.AreEqual(1, l.countSeen);
- Assert.AreEqual(BOFRecord.sid, l.lastRecordSeen.Sid);
+ ClassicAssert.AreEqual(1234, res);
+ ClassicAssert.AreEqual(1, l.countSeen);
+ ClassicAssert.AreEqual(BOFRecord.sid, l.lastRecordSeen.Sid);
}
private class AbortableCountingListener : AbortableHSSFListener
diff --git a/testcases/main/HSSF/EventModel/TestEventRecordFactory.cs b/testcases/main/HSSF/EventModel/TestEventRecordFactory.cs
index 6a1a0f5c8..a018a46a8 100644
--- a/testcases/main/HSSF/EventModel/TestEventRecordFactory.cs
+++ b/testcases/main/HSSF/EventModel/TestEventRecordFactory.cs
@@ -27,7 +27,7 @@ namespace TestCases.HSSF.EventModel
using NPOI.HSSF.Record;
using NPOI.POIFS.FileSystem;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
@@ -52,7 +52,7 @@ public ERFListener1(ref bool[] wascalled)
public bool ProcessRecord(Record rec)
{
wascalled[0] = true;
- Assert.IsTrue(
+ ClassicAssert.IsTrue(
(rec.Sid == BOFRecord.sid),
"must be BOFRecord got SID=" + rec.Sid);
return true;
@@ -88,7 +88,7 @@ public void TestProcessRecords()
offset = eof.Serialize(offset, bytes);
factory.ProcessRecords(new MemoryStream(bytes));
- Assert.IsTrue(wascalled[0], "The record listener must be called");
+ ClassicAssert.IsTrue(wascalled[0], "The record listener must be called");
}
/**
@@ -110,8 +110,8 @@ public void TestCreateRecord()
Record[] records = RecordFactory.CreateRecord(TestcaseRecordInputStream.Create(bytes));
- Assert.IsTrue(records.Length == 1, "record.Length must be 1, was =" + records.Length);
- Assert.IsTrue(CompareRec(bof, records[0]), "record is the same");
+ ClassicAssert.IsTrue(records.Length == 1, "record.Length must be 1, was =" + records.Length);
+ ClassicAssert.IsTrue(CompareRec(bof, records[0]), "record is the same");
}
@@ -172,7 +172,7 @@ public ERFListener2(ref byte[] data, ref int[] recCnt, ref int[] offset)
public bool ProcessRecord(Record rec)
{
// System.out.println(rec.toString());
- Assert.AreEqual(
+ ClassicAssert.AreEqual(
expectedRecordTypes[recCnt[0]],
rec.GetType().Name,
"Record type"
@@ -186,7 +186,7 @@ private void CompareData(Record record, String message)
byte[] recData = record.Serialize();
for (int i = 0; i < recData.Length; i++)
{
- Assert.AreEqual(recData[i], data[offset[0]++], message + " data byte " + i);
+ ClassicAssert.AreEqual(recData[i], data[offset[0]++], message + " data byte " + i);
}
}
}
@@ -217,8 +217,8 @@ public void TestContinuedUnknownRecord()
EventRecordFactory factory = new EventRecordFactory(listener, sids);
factory.ProcessRecords(new MemoryStream(data));
- Assert.AreEqual(3, recCnt[0], "nr. of Processed records");
- Assert.AreEqual(data.Length, offset[0], "nr. of Processed bytes");
+ ClassicAssert.AreEqual(3, recCnt[0], "nr. of Processed records");
+ ClassicAssert.AreEqual(data.Length, offset[0], "nr. of Processed bytes");
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/EventUserModel/TestEventWorkbookBuilder.cs b/testcases/main/HSSF/EventUserModel/TestEventWorkbookBuilder.cs
index c1377ae1d..d36c39fc2 100644
--- a/testcases/main/HSSF/EventUserModel/TestEventWorkbookBuilder.cs
+++ b/testcases/main/HSSF/EventUserModel/TestEventWorkbookBuilder.cs
@@ -29,7 +29,7 @@ namespace TestCases.HSSF.EventUserModel
using NPOI.POIFS.FileSystem;
using NPOI.SS.Formula;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.SS.Formula.PTG;
@@ -62,29 +62,29 @@ public void SetUp()
[Test]
public void TestBasics()
{
- Assert.IsNotNull(listener.GetSSTRecord());
- Assert.IsNotNull(listener.GetBoundSheetRecords());
- Assert.IsNotNull(listener.GetExternSheetRecords());
+ ClassicAssert.IsNotNull(listener.GetSSTRecord());
+ ClassicAssert.IsNotNull(listener.GetBoundSheetRecords());
+ ClassicAssert.IsNotNull(listener.GetExternSheetRecords());
}
[Test]
public void TestGetStubWorkbooks()
{
- Assert.IsNotNull(listener.GetStubWorkbook());
- Assert.IsNotNull(listener.GetStubHSSFWorkbook());
+ ClassicAssert.IsNotNull(listener.GetStubWorkbook());
+ ClassicAssert.IsNotNull(listener.GetStubHSSFWorkbook());
}
[Test]
public void TestContents()
{
- Assert.AreEqual(2, listener.GetSSTRecord().NumStrings);
- Assert.AreEqual(3, listener.GetBoundSheetRecords().Length);
- Assert.AreEqual(1, listener.GetExternSheetRecords().Length);
+ ClassicAssert.AreEqual(2, listener.GetSSTRecord().NumStrings);
+ ClassicAssert.AreEqual(3, listener.GetBoundSheetRecords().Length);
+ ClassicAssert.AreEqual(1, listener.GetExternSheetRecords().Length);
- Assert.AreEqual(3, listener.GetStubWorkbook().NumSheets);
+ ClassicAssert.AreEqual(3, listener.GetStubWorkbook().NumSheets);
InternalWorkbook ref1 = listener.GetStubWorkbook();
- Assert.AreEqual("Sh3", ref1.FindSheetFirstNameFromExternSheet(0));
- Assert.AreEqual("Sheet1", ref1.FindSheetFirstNameFromExternSheet(1));
- Assert.AreEqual("S2", ref1.FindSheetFirstNameFromExternSheet(2));
+ ClassicAssert.AreEqual("Sh3", ref1.FindSheetFirstNameFromExternSheet(0));
+ ClassicAssert.AreEqual("Sheet1", ref1.FindSheetFirstNameFromExternSheet(1));
+ ClassicAssert.AreEqual("S2", ref1.FindSheetFirstNameFromExternSheet(2));
}
[Test]
public void TestFormulas()
@@ -93,17 +93,17 @@ public void TestFormulas()
FormulaRecord[] fRecs = mockListen.GetFormulaRecords();
// Check our formula records
- Assert.AreEqual(6, fRecs.Length);
+ ClassicAssert.AreEqual(6, fRecs.Length);
InternalWorkbook stubWB = listener.GetStubWorkbook();
- Assert.IsNotNull(stubWB);
+ ClassicAssert.IsNotNull(stubWB);
HSSFWorkbook stubHSSF = listener.GetStubHSSFWorkbook();
- Assert.IsNotNull(stubHSSF);
+ ClassicAssert.IsNotNull(stubHSSF);
// Check these stubs have the right stuff on them
- Assert.AreEqual("Sheet1", stubWB.GetSheetName(0));
- Assert.AreEqual("S2", stubWB.GetSheetName(1));
- Assert.AreEqual("Sh3", stubWB.GetSheetName(2));
+ ClassicAssert.AreEqual("Sheet1", stubWB.GetSheetName(0));
+ ClassicAssert.AreEqual("S2", stubWB.GetSheetName(1));
+ ClassicAssert.AreEqual("Sh3", stubWB.GetSheetName(2));
// Check we can Get the formula without breaking
for (int i = 0; i < fRecs.Length; i++)
@@ -114,12 +114,12 @@ public void TestFormulas()
// Peer into just one formula, and check that
// all the ptgs give back the right things
Ptg[] ptgs = fRecs[0].ParsedExpression;
- Assert.AreEqual(1, ptgs.Length);
- Assert.IsTrue(ptgs[0] is Ref3DPtg);
+ ClassicAssert.AreEqual(1, ptgs.Length);
+ ClassicAssert.IsTrue(ptgs[0] is Ref3DPtg);
Ref3DPtg ptg = (Ref3DPtg)ptgs[0];
HSSFEvaluationWorkbook book = HSSFEvaluationWorkbook.Create(stubHSSF);
- Assert.AreEqual("Sheet1!A1", ptg.ToFormulaString(book));
+ ClassicAssert.AreEqual("Sheet1!A1", ptg.ToFormulaString(book));
// Now check we Get the right formula back for
@@ -128,27 +128,27 @@ public void TestFormulas()
// Sheet 1 A2 is on same sheet
fr = fRecs[0];
- Assert.AreEqual(1, fr.Row);
- Assert.AreEqual(0, fr.Column);
- Assert.AreEqual("Sheet1!A1", HSSFFormulaParser.ToFormulaString(stubHSSF, fr.ParsedExpression));
+ ClassicAssert.AreEqual(1, fr.Row);
+ ClassicAssert.AreEqual(0, fr.Column);
+ ClassicAssert.AreEqual("Sheet1!A1", HSSFFormulaParser.ToFormulaString(stubHSSF, fr.ParsedExpression));
// Sheet 1 A5 is to another sheet
fr = fRecs[3];
- Assert.AreEqual(4, fr.Row);
- Assert.AreEqual(0, fr.Column);
- Assert.AreEqual("'S2'!A1", HSSFFormulaParser.ToFormulaString(stubHSSF, fr.ParsedExpression));
+ ClassicAssert.AreEqual(4, fr.Row);
+ ClassicAssert.AreEqual(0, fr.Column);
+ ClassicAssert.AreEqual("'S2'!A1", HSSFFormulaParser.ToFormulaString(stubHSSF, fr.ParsedExpression));
// Sheet 1 A7 is to another sheet, range
fr = fRecs[5];
- Assert.AreEqual(6, fr.Row);
- Assert.AreEqual(0, fr.Column);
- Assert.AreEqual("SUM(Sh3!A1:A4)", HSSFFormulaParser.ToFormulaString(stubHSSF, fr.ParsedExpression));
+ ClassicAssert.AreEqual(6, fr.Row);
+ ClassicAssert.AreEqual(0, fr.Column);
+ ClassicAssert.AreEqual("SUM(Sh3!A1:A4)", HSSFFormulaParser.ToFormulaString(stubHSSF, fr.ParsedExpression));
// Now, load via Usermodel and re-check
HSSFWorkbook wb = HSSFTestDataSamples.OpenSampleWorkbook("3dFormulas.xls");
- Assert.AreEqual("Sheet1!A1", wb.GetSheetAt(0).GetRow(1).GetCell(0).CellFormula);
- Assert.AreEqual("SUM(Sh3!A1:A4)", wb.GetSheetAt(0).GetRow(6).GetCell(0).CellFormula);
+ ClassicAssert.AreEqual("Sheet1!A1", wb.GetSheetAt(0).GetRow(1).GetCell(0).CellFormula);
+ ClassicAssert.AreEqual("SUM(Sh3!A1:A4)", wb.GetSheetAt(0).GetRow(6).GetCell(0).CellFormula);
}
private class MockHSSFListener : IHSSFListener
diff --git a/testcases/main/HSSF/EventUserModel/TestFormatTrackingHSSFListener.cs b/testcases/main/HSSF/EventUserModel/TestFormatTrackingHSSFListener.cs
index 767a8b814..802b15ecf 100644
--- a/testcases/main/HSSF/EventUserModel/TestFormatTrackingHSSFListener.cs
+++ b/testcases/main/HSSF/EventUserModel/TestFormatTrackingHSSFListener.cs
@@ -28,7 +28,7 @@ namespace TestCases.HSSF.EventUserModel
using NPOI.HSSF.Record;
using NPOI.POIFS.FileSystem;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
[TestFixture]
public class TestFormatTrackingHSSFListener
@@ -60,10 +60,10 @@ public void TestFormats()
{
ProcessFile("MissingBits.xls");
- Assert.AreEqual("_(\"$\"* #,##0_);_(\"$\"* (#,##0);_(\"$\"* \"-\"_);_(@_)", listener.GetFormatString(41));
- Assert.AreEqual("_(* #,##0_);_(* (#,##0);_(* \"-\"_);_(@_)", listener.GetFormatString(42));
- Assert.AreEqual("_(* #,##0.00_);_(* (#,##0.00);_(* \"-\"??_);_(@_)", listener.GetFormatString(43));
- Assert.AreEqual("_(\"$\"* #,##0.00_);_(\"$\"* (#,##0.00);_(\"$\"* \"-\"??_);_(@_)", listener.GetFormatString(44));
+ ClassicAssert.AreEqual("_(\"$\"* #,##0_);_(\"$\"* (#,##0);_(\"$\"* \"-\"_);_(@_)", listener.GetFormatString(41));
+ ClassicAssert.AreEqual("_(* #,##0_);_(* (#,##0);_(* \"-\"_);_(@_)", listener.GetFormatString(42));
+ ClassicAssert.AreEqual("_(* #,##0.00_);_(* (#,##0.00);_(* \"-\"??_);_(@_)", listener.GetFormatString(43));
+ ClassicAssert.AreEqual("_(\"$\"* #,##0.00_);_(\"$\"* (#,##0.00);_(\"$\"* \"-\"??_);_(@_)", listener.GetFormatString(44));
}
/**
@@ -84,8 +84,8 @@ public void TestTurnToString()
ProcessFile(files[k]);
// Check we found our formats
- Assert.IsTrue(listener.NumberOfCustomFormats > 5);
- Assert.IsTrue(listener.NumberOfExtendedFormats > 5);
+ ClassicAssert.IsTrue(listener.NumberOfCustomFormats > 5);
+ ClassicAssert.IsTrue(listener.NumberOfExtendedFormats > 5);
// Now check we can turn all the numeric
// cells into strings without error
@@ -107,8 +107,8 @@ public void TestTurnToString()
{
// Should always give us a string
String s = listener.FormatNumberDateCell(cvr);
- Assert.IsNotNull(s);
- Assert.IsTrue(s.Length > 0);
+ ClassicAssert.IsNotNull(s);
+ ClassicAssert.IsTrue(s.Length > 0);
}
}
diff --git a/testcases/main/HSSF/EventUserModel/TestHSSFEventFactory.cs b/testcases/main/HSSF/EventUserModel/TestHSSFEventFactory.cs
index 935ac0fee..8789aaa07 100644
--- a/testcases/main/HSSF/EventUserModel/TestHSSFEventFactory.cs
+++ b/testcases/main/HSSF/EventUserModel/TestHSSFEventFactory.cs
@@ -26,7 +26,7 @@ namespace TestCases.HSSF.EventUserModel
using NPOI.HSSF.Record;
using NPOI.POIFS.FileSystem;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
[TestFixture]
public class TestHSSFEventFactory
@@ -50,14 +50,14 @@ public void TestWithMissingRecords()
Record[] recs = mockListen.GetRecords();
// Check we got the records
- Assert.IsTrue(recs.Length > 100);
+ ClassicAssert.IsTrue(recs.Length > 100);
// Check that the last few records are as we expect
// (Makes sure we don't accidently skip the end ones)
int numRec = recs.Length;
- Assert.AreEqual(typeof(WindowTwoRecord), recs[numRec - 3].GetType());
- Assert.AreEqual(typeof(SelectionRecord), recs[numRec - 2].GetType());
- Assert.AreEqual(typeof(EOFRecord), recs[numRec - 1].GetType());
+ ClassicAssert.AreEqual(typeof(WindowTwoRecord), recs[numRec - 3].GetType());
+ ClassicAssert.AreEqual(typeof(SelectionRecord), recs[numRec - 2].GetType());
+ ClassicAssert.AreEqual(typeof(EOFRecord), recs[numRec - 1].GetType());
}
public void TestWithCrazyContinueRecords()
@@ -75,20 +75,20 @@ public void TestWithCrazyContinueRecords()
Record[] recs = mockListen.GetRecords();
// Check we got the records
- Assert.IsTrue(recs.Length > 100);
+ ClassicAssert.IsTrue(recs.Length > 100);
// And none of them are continue ones
for (int i = 0; i < recs.Length; i++)
{
- Assert.IsFalse(recs[i] is ContinueRecord);
+ ClassicAssert.IsFalse(recs[i] is ContinueRecord);
}
// Check that the last few records are as we expect
// (Makes sure we don't accidently skip the end ones)
int numRec = recs.Length;
- Assert.AreEqual(typeof(DVALRecord), recs[numRec - 3].GetType());
- Assert.AreEqual(typeof(DVRecord), recs[numRec - 2].GetType());
- Assert.AreEqual(typeof(EOFRecord), recs[numRec - 1].GetType());
+ ClassicAssert.AreEqual(typeof(DVALRecord), recs[numRec - 3].GetType());
+ ClassicAssert.AreEqual(typeof(DVRecord), recs[numRec - 2].GetType());
+ ClassicAssert.AreEqual(typeof(EOFRecord), recs[numRec - 1].GetType());
}
/**
@@ -108,7 +108,7 @@ public void TestUnknownContinueRecords()
HSSFEventFactory factory = new HSSFEventFactory();
factory.ProcessWorkbookEvents(req, fs);
- Assert.IsTrue(true, "no errors while Processing the file");
+ ClassicAssert.IsTrue(true, "no errors while Processing the file");
}
private class MockHSSFListener : IHSSFListener
diff --git a/testcases/main/HSSF/EventUserModel/TestMissingRecordAwareHSSFListener.cs b/testcases/main/HSSF/EventUserModel/TestMissingRecordAwareHSSFListener.cs
index 4cf65d39e..30fababf7 100644
--- a/testcases/main/HSSF/EventUserModel/TestMissingRecordAwareHSSFListener.cs
+++ b/testcases/main/HSSF/EventUserModel/TestMissingRecordAwareHSSFListener.cs
@@ -27,7 +27,7 @@ namespace TestCases.HSSF.EventUserModel
using NPOI.POIFS.FileSystem;
using NPOI.HSSF.EventUserModel.DummyRecord;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
[TestFixture]
public class TestMissingRecordAwareHSSFListener
@@ -55,7 +55,7 @@ private void ReadRecords(String sampleFileName)
}
r = mockListen.GetRecords();
- Assert.IsTrue(r.Length > 100);
+ ClassicAssert.IsTrue(r.Length > 100);
}
public void OpenNormal()
{
@@ -76,43 +76,43 @@ public void TestMissingRowRecords()
if (rr.RowNumber == 0) { row0 = i; }
}
}
- Assert.IsTrue(row0 > -1);
+ ClassicAssert.IsTrue(row0 > -1);
// Following row 0, we should have 1, 2, then dummy, then 20+21+22
- Assert.IsTrue(r[row0] is RowRecord);
- Assert.IsTrue(r[row0 + 1] is RowRecord);
- Assert.IsTrue(r[row0 + 2] is RowRecord);
- Assert.IsTrue(r[row0 + 3] is MissingRowDummyRecord);
- Assert.IsTrue(r[row0 + 4] is MissingRowDummyRecord);
- Assert.IsTrue(r[row0 + 5] is MissingRowDummyRecord);
- Assert.IsTrue(r[row0 + 6] is MissingRowDummyRecord);
+ ClassicAssert.IsTrue(r[row0] is RowRecord);
+ ClassicAssert.IsTrue(r[row0 + 1] is RowRecord);
+ ClassicAssert.IsTrue(r[row0 + 2] is RowRecord);
+ ClassicAssert.IsTrue(r[row0 + 3] is MissingRowDummyRecord);
+ ClassicAssert.IsTrue(r[row0 + 4] is MissingRowDummyRecord);
+ ClassicAssert.IsTrue(r[row0 + 5] is MissingRowDummyRecord);
+ ClassicAssert.IsTrue(r[row0 + 6] is MissingRowDummyRecord);
// ...
- Assert.IsTrue(r[row0 + 18] is MissingRowDummyRecord);
- Assert.IsTrue(r[row0 + 19] is MissingRowDummyRecord);
- Assert.IsTrue(r[row0 + 20] is RowRecord);
- Assert.IsTrue(r[row0 + 21] is RowRecord);
- Assert.IsTrue(r[row0 + 22] is RowRecord);
+ ClassicAssert.IsTrue(r[row0 + 18] is MissingRowDummyRecord);
+ ClassicAssert.IsTrue(r[row0 + 19] is MissingRowDummyRecord);
+ ClassicAssert.IsTrue(r[row0 + 20] is RowRecord);
+ ClassicAssert.IsTrue(r[row0 + 21] is RowRecord);
+ ClassicAssert.IsTrue(r[row0 + 22] is RowRecord);
// Check things had the right row numbers
RowRecord rr2;
rr2 = (RowRecord)r[row0 + 2];
- Assert.AreEqual(2, rr2.RowNumber);
+ ClassicAssert.AreEqual(2, rr2.RowNumber);
rr2 = (RowRecord)r[row0 + 20];
- Assert.AreEqual(20, rr2.RowNumber);
+ ClassicAssert.AreEqual(20, rr2.RowNumber);
rr2 = (RowRecord)r[row0 + 21];
- Assert.AreEqual(21, rr2.RowNumber);
+ ClassicAssert.AreEqual(21, rr2.RowNumber);
MissingRowDummyRecord mr;
mr = (MissingRowDummyRecord)r[row0 + 3];
- Assert.AreEqual(3, mr.RowNumber);
+ ClassicAssert.AreEqual(3, mr.RowNumber);
mr = (MissingRowDummyRecord)r[row0 + 4];
- Assert.AreEqual(4, mr.RowNumber);
+ ClassicAssert.AreEqual(4, mr.RowNumber);
mr = (MissingRowDummyRecord)r[row0 + 5];
- Assert.AreEqual(5, mr.RowNumber);
+ ClassicAssert.AreEqual(5, mr.RowNumber);
mr = (MissingRowDummyRecord)r[row0 + 18];
- Assert.AreEqual(18, mr.RowNumber);
+ ClassicAssert.AreEqual(18, mr.RowNumber);
mr = (MissingRowDummyRecord)r[row0 + 19];
- Assert.AreEqual(19, mr.RowNumber);
+ ClassicAssert.AreEqual(19, mr.RowNumber);
}
[Test]
public void TestEndOfRowRecords()
@@ -129,7 +129,7 @@ public void TestEndOfRowRecords()
if (lr.Row == 0 && lr.Column == 0) { cell00 = i; }
}
}
- Assert.IsTrue(cell00 > -1);
+ ClassicAssert.IsTrue(cell00 > -1);
// We have rows 0, 1, 2, 20 and 21
// Row 0 has 1 entry
@@ -140,70 +140,70 @@ public void TestEndOfRowRecords()
// Row 22 has 12 entries
// Row 0
- Assert.IsFalse(r[cell00 + 0] is LastCellOfRowDummyRecord);
- Assert.IsTrue(r[cell00 + 1] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 0] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsTrue(r[cell00 + 1] is LastCellOfRowDummyRecord);
// Row 1
- Assert.IsFalse(r[cell00 + 2] is LastCellOfRowDummyRecord);
- Assert.IsFalse(r[cell00 + 3] is LastCellOfRowDummyRecord);
- Assert.IsFalse(r[cell00 + 4] is LastCellOfRowDummyRecord);
- Assert.IsFalse(r[cell00 + 5] is LastCellOfRowDummyRecord);
- Assert.IsTrue(r[cell00 + 6] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 2] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 3] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 4] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 5] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsTrue(r[cell00 + 6] is LastCellOfRowDummyRecord);
// Row 2
- Assert.IsFalse(r[cell00 + 7] is LastCellOfRowDummyRecord);
- Assert.IsFalse(r[cell00 + 8] is LastCellOfRowDummyRecord);
- Assert.IsFalse(r[cell00 + 9] is LastCellOfRowDummyRecord);
- Assert.IsFalse(r[cell00 + 10] is LastCellOfRowDummyRecord);
- Assert.IsFalse(r[cell00 + 11] is LastCellOfRowDummyRecord);
- Assert.IsFalse(r[cell00 + 12] is LastCellOfRowDummyRecord);
- Assert.IsTrue(r[cell00 + 13] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 7] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 8] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 9] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 10] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 11] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 12] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsTrue(r[cell00 + 13] is LastCellOfRowDummyRecord);
// Row 3 -> 19
- Assert.IsTrue(r[cell00 + 14] is LastCellOfRowDummyRecord);
- Assert.IsTrue(r[cell00 + 15] is LastCellOfRowDummyRecord);
- Assert.IsTrue(r[cell00 + 16] is LastCellOfRowDummyRecord);
- Assert.IsTrue(r[cell00 + 17] is LastCellOfRowDummyRecord);
- Assert.IsTrue(r[cell00 + 18] is LastCellOfRowDummyRecord);
- Assert.IsTrue(r[cell00 + 19] is LastCellOfRowDummyRecord);
- Assert.IsTrue(r[cell00 + 20] is LastCellOfRowDummyRecord);
- Assert.IsTrue(r[cell00 + 21] is LastCellOfRowDummyRecord);
- Assert.IsTrue(r[cell00 + 22] is LastCellOfRowDummyRecord);
- Assert.IsTrue(r[cell00 + 23] is LastCellOfRowDummyRecord);
- Assert.IsTrue(r[cell00 + 24] is LastCellOfRowDummyRecord);
- Assert.IsTrue(r[cell00 + 25] is LastCellOfRowDummyRecord);
- Assert.IsTrue(r[cell00 + 26] is LastCellOfRowDummyRecord);
- Assert.IsTrue(r[cell00 + 27] is LastCellOfRowDummyRecord);
- Assert.IsTrue(r[cell00 + 28] is LastCellOfRowDummyRecord);
- Assert.IsTrue(r[cell00 + 29] is LastCellOfRowDummyRecord);
- Assert.IsTrue(r[cell00 + 30] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsTrue(r[cell00 + 14] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsTrue(r[cell00 + 15] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsTrue(r[cell00 + 16] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsTrue(r[cell00 + 17] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsTrue(r[cell00 + 18] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsTrue(r[cell00 + 19] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsTrue(r[cell00 + 20] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsTrue(r[cell00 + 21] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsTrue(r[cell00 + 22] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsTrue(r[cell00 + 23] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsTrue(r[cell00 + 24] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsTrue(r[cell00 + 25] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsTrue(r[cell00 + 26] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsTrue(r[cell00 + 27] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsTrue(r[cell00 + 28] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsTrue(r[cell00 + 29] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsTrue(r[cell00 + 30] is LastCellOfRowDummyRecord);
// Row 20
- Assert.IsFalse(r[cell00 + 31] is LastCellOfRowDummyRecord);
- Assert.IsFalse(r[cell00 + 32] is LastCellOfRowDummyRecord);
- Assert.IsFalse(r[cell00 + 33] is LastCellOfRowDummyRecord);
- Assert.IsFalse(r[cell00 + 34] is LastCellOfRowDummyRecord);
- Assert.IsFalse(r[cell00 + 35] is LastCellOfRowDummyRecord);
- Assert.IsTrue(r[cell00 + 36] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 31] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 32] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 33] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 34] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 35] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsTrue(r[cell00 + 36] is LastCellOfRowDummyRecord);
// Row 21
- Assert.IsFalse(r[cell00 + 37] is LastCellOfRowDummyRecord);
- Assert.IsFalse(r[cell00 + 38] is LastCellOfRowDummyRecord);
- Assert.IsFalse(r[cell00 + 39] is LastCellOfRowDummyRecord);
- Assert.IsFalse(r[cell00 + 40] is LastCellOfRowDummyRecord);
- Assert.IsFalse(r[cell00 + 41] is LastCellOfRowDummyRecord);
- Assert.IsFalse(r[cell00 + 42] is LastCellOfRowDummyRecord);
- Assert.IsFalse(r[cell00 + 43] is LastCellOfRowDummyRecord);
- Assert.IsTrue(r[cell00 + 44] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 37] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 38] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 39] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 40] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 41] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 42] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 43] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsTrue(r[cell00 + 44] is LastCellOfRowDummyRecord);
// Row 22
- Assert.IsFalse(r[cell00 + 45] is LastCellOfRowDummyRecord);
- Assert.IsFalse(r[cell00 + 46] is LastCellOfRowDummyRecord);
- Assert.IsFalse(r[cell00 + 47] is LastCellOfRowDummyRecord);
- Assert.IsFalse(r[cell00 + 48] is LastCellOfRowDummyRecord);
- Assert.IsFalse(r[cell00 + 49] is LastCellOfRowDummyRecord);
- Assert.IsFalse(r[cell00 + 50] is LastCellOfRowDummyRecord);
- Assert.IsFalse(r[cell00 + 51] is LastCellOfRowDummyRecord);
- Assert.IsFalse(r[cell00 + 52] is LastCellOfRowDummyRecord);
- Assert.IsFalse(r[cell00 + 53] is LastCellOfRowDummyRecord);
- Assert.IsFalse(r[cell00 + 54] is LastCellOfRowDummyRecord);
- Assert.IsFalse(r[cell00 + 55] is LastCellOfRowDummyRecord);
- Assert.IsFalse(r[cell00 + 56] is LastCellOfRowDummyRecord);
- Assert.IsTrue(r[cell00 + 57] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 45] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 46] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 47] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 48] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 49] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 50] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 51] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 52] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 53] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 54] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 55] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 56] is LastCellOfRowDummyRecord);
+ ClassicAssert.IsTrue(r[cell00 + 57] is LastCellOfRowDummyRecord);
// Check the numbers of the last seen columns
LastCellOfRowDummyRecord[] lrs = new LastCellOfRowDummyRecord[24];
@@ -217,29 +217,29 @@ public void TestEndOfRowRecords()
}
}
- Assert.AreEqual(0, lrs[0].LastColumnNumber);
- Assert.AreEqual(0, lrs[0].Row);
+ ClassicAssert.AreEqual(0, lrs[0].LastColumnNumber);
+ ClassicAssert.AreEqual(0, lrs[0].Row);
- Assert.AreEqual(3, lrs[1].LastColumnNumber);
- Assert.AreEqual(1, lrs[1].Row);
+ ClassicAssert.AreEqual(3, lrs[1].LastColumnNumber);
+ ClassicAssert.AreEqual(1, lrs[1].Row);
- Assert.AreEqual(5, lrs[2].LastColumnNumber);
- Assert.AreEqual(2, lrs[2].Row);
+ ClassicAssert.AreEqual(5, lrs[2].LastColumnNumber);
+ ClassicAssert.AreEqual(2, lrs[2].Row);
for (int i = 3; i <= 19; i++)
{
- Assert.AreEqual(-1, lrs[i].LastColumnNumber);
- Assert.AreEqual(i, lrs[i].Row);
+ ClassicAssert.AreEqual(-1, lrs[i].LastColumnNumber);
+ ClassicAssert.AreEqual(i, lrs[i].Row);
}
- Assert.AreEqual(4, lrs[20].LastColumnNumber);
- Assert.AreEqual(20, lrs[20].Row);
+ ClassicAssert.AreEqual(4, lrs[20].LastColumnNumber);
+ ClassicAssert.AreEqual(20, lrs[20].Row);
- Assert.AreEqual(6, lrs[21].LastColumnNumber);
- Assert.AreEqual(21, lrs[21].Row);
+ ClassicAssert.AreEqual(6, lrs[21].LastColumnNumber);
+ ClassicAssert.AreEqual(21, lrs[21].Row);
- Assert.AreEqual(11, lrs[22].LastColumnNumber);
- Assert.AreEqual(22, lrs[22].Row);
+ ClassicAssert.AreEqual(11, lrs[22].LastColumnNumber);
+ ClassicAssert.AreEqual(22, lrs[22].Row);
}
[Test]
@@ -257,7 +257,7 @@ public void TestMissingCellRecords()
if (lr.Row == 0 && lr.Column == 0) { cell00 = i; }
}
}
- Assert.IsTrue(cell00 > -1);
+ ClassicAssert.IsTrue(cell00 > -1);
// We have rows 0, 1, 2, 20 and 21
// Row 0 has 1 entry, 0
@@ -268,82 +268,82 @@ public void TestMissingCellRecords()
// Row 22 has 12 entries, 0+3+4+11
// Row 0
- Assert.IsFalse(r[cell00 + 0] is MissingCellDummyRecord);
- Assert.IsFalse(r[cell00 + 1] is MissingCellDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 0] is MissingCellDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 1] is MissingCellDummyRecord);
// Row 1
- Assert.IsFalse(r[cell00 + 2] is MissingCellDummyRecord);
- Assert.IsTrue(r[cell00 + 3] is MissingCellDummyRecord);
- Assert.IsTrue(r[cell00 + 4] is MissingCellDummyRecord);
- Assert.IsFalse(r[cell00 + 5] is MissingCellDummyRecord);
- Assert.IsFalse(r[cell00 + 6] is MissingCellDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 2] is MissingCellDummyRecord);
+ ClassicAssert.IsTrue(r[cell00 + 3] is MissingCellDummyRecord);
+ ClassicAssert.IsTrue(r[cell00 + 4] is MissingCellDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 5] is MissingCellDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 6] is MissingCellDummyRecord);
// Row 2
- Assert.IsFalse(r[cell00 + 7] is MissingCellDummyRecord);
- Assert.IsTrue(r[cell00 + 8] is MissingCellDummyRecord);
- Assert.IsTrue(r[cell00 + 9] is MissingCellDummyRecord);
- Assert.IsTrue(r[cell00 + 10] is MissingCellDummyRecord);
- Assert.IsTrue(r[cell00 + 11] is MissingCellDummyRecord);
- Assert.IsFalse(r[cell00 + 12] is MissingCellDummyRecord);
- Assert.IsFalse(r[cell00 + 13] is MissingCellDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 7] is MissingCellDummyRecord);
+ ClassicAssert.IsTrue(r[cell00 + 8] is MissingCellDummyRecord);
+ ClassicAssert.IsTrue(r[cell00 + 9] is MissingCellDummyRecord);
+ ClassicAssert.IsTrue(r[cell00 + 10] is MissingCellDummyRecord);
+ ClassicAssert.IsTrue(r[cell00 + 11] is MissingCellDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 12] is MissingCellDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 13] is MissingCellDummyRecord);
// Row 3-19
- Assert.IsFalse(r[cell00 + 14] is MissingCellDummyRecord);
- Assert.IsFalse(r[cell00 + 15] is MissingCellDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 14] is MissingCellDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 15] is MissingCellDummyRecord);
// Row 20
- Assert.IsFalse(r[cell00 + 31] is MissingCellDummyRecord);
- Assert.IsFalse(r[cell00 + 32] is MissingCellDummyRecord);
- Assert.IsFalse(r[cell00 + 33] is MissingCellDummyRecord);
- Assert.IsFalse(r[cell00 + 34] is MissingCellDummyRecord);
- Assert.IsFalse(r[cell00 + 35] is MissingCellDummyRecord);
- Assert.IsFalse(r[cell00 + 36] is MissingCellDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 31] is MissingCellDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 32] is MissingCellDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 33] is MissingCellDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 34] is MissingCellDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 35] is MissingCellDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 36] is MissingCellDummyRecord);
// Row 21
- Assert.IsFalse(r[cell00 + 37] is MissingCellDummyRecord);
- Assert.IsFalse(r[cell00 + 38] is MissingCellDummyRecord);
- Assert.IsTrue(r[cell00 + 39] is MissingCellDummyRecord);
- Assert.IsFalse(r[cell00 + 40] is MissingCellDummyRecord);
- Assert.IsTrue(r[cell00 + 41] is MissingCellDummyRecord);
- Assert.IsFalse(r[cell00 + 42] is MissingCellDummyRecord);
- Assert.IsFalse(r[cell00 + 43] is MissingCellDummyRecord);
- Assert.IsFalse(r[cell00 + 44] is MissingCellDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 37] is MissingCellDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 38] is MissingCellDummyRecord);
+ ClassicAssert.IsTrue(r[cell00 + 39] is MissingCellDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 40] is MissingCellDummyRecord);
+ ClassicAssert.IsTrue(r[cell00 + 41] is MissingCellDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 42] is MissingCellDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 43] is MissingCellDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 44] is MissingCellDummyRecord);
// Row 22
- Assert.IsFalse(r[cell00 + 45] is MissingCellDummyRecord);
- Assert.IsTrue(r[cell00 + 46] is MissingCellDummyRecord);
- Assert.IsTrue(r[cell00 + 47] is MissingCellDummyRecord);
- Assert.IsFalse(r[cell00 + 48] is MissingCellDummyRecord);
- Assert.IsFalse(r[cell00 + 49] is MissingCellDummyRecord);
- Assert.IsTrue(r[cell00 + 50] is MissingCellDummyRecord);
- Assert.IsTrue(r[cell00 + 51] is MissingCellDummyRecord);
- Assert.IsTrue(r[cell00 + 52] is MissingCellDummyRecord);
- Assert.IsTrue(r[cell00 + 53] is MissingCellDummyRecord);
- Assert.IsTrue(r[cell00 + 54] is MissingCellDummyRecord);
- Assert.IsTrue(r[cell00 + 55] is MissingCellDummyRecord);
- Assert.IsFalse(r[cell00 + 56] is MissingCellDummyRecord);
- Assert.IsFalse(r[cell00 + 57] is MissingCellDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 45] is MissingCellDummyRecord);
+ ClassicAssert.IsTrue(r[cell00 + 46] is MissingCellDummyRecord);
+ ClassicAssert.IsTrue(r[cell00 + 47] is MissingCellDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 48] is MissingCellDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 49] is MissingCellDummyRecord);
+ ClassicAssert.IsTrue(r[cell00 + 50] is MissingCellDummyRecord);
+ ClassicAssert.IsTrue(r[cell00 + 51] is MissingCellDummyRecord);
+ ClassicAssert.IsTrue(r[cell00 + 52] is MissingCellDummyRecord);
+ ClassicAssert.IsTrue(r[cell00 + 53] is MissingCellDummyRecord);
+ ClassicAssert.IsTrue(r[cell00 + 54] is MissingCellDummyRecord);
+ ClassicAssert.IsTrue(r[cell00 + 55] is MissingCellDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 56] is MissingCellDummyRecord);
+ ClassicAssert.IsFalse(r[cell00 + 57] is MissingCellDummyRecord);
// Check some numbers
MissingCellDummyRecord mc;
mc = (MissingCellDummyRecord)r[cell00 + 3];
- Assert.AreEqual(1, mc.Row);
- Assert.AreEqual(1, mc.Column);
+ ClassicAssert.AreEqual(1, mc.Row);
+ ClassicAssert.AreEqual(1, mc.Column);
mc = (MissingCellDummyRecord)r[cell00 + 4];
- Assert.AreEqual(1, mc.Row);
- Assert.AreEqual(2, mc.Column);
+ ClassicAssert.AreEqual(1, mc.Row);
+ ClassicAssert.AreEqual(2, mc.Column);
mc = (MissingCellDummyRecord)r[cell00 + 8];
- Assert.AreEqual(2, mc.Row);
- Assert.AreEqual(1, mc.Column);
+ ClassicAssert.AreEqual(2, mc.Row);
+ ClassicAssert.AreEqual(1, mc.Column);
mc = (MissingCellDummyRecord)r[cell00 + 9];
- Assert.AreEqual(2, mc.Row);
- Assert.AreEqual(2, mc.Column);
+ ClassicAssert.AreEqual(2, mc.Row);
+ ClassicAssert.AreEqual(2, mc.Column);
mc = (MissingCellDummyRecord)r[cell00 + 55];
- Assert.AreEqual(22, mc.Row);
- Assert.AreEqual(10, mc.Column);
+ ClassicAssert.AreEqual(22, mc.Row);
+ ClassicAssert.AreEqual(10, mc.Column);
}
// Make sure we don't put in any extra new lines
@@ -361,12 +361,12 @@ public void TestNoExtraNewLines()
if (r[i] is LastCellOfRowDummyRecord)
{
LastCellOfRowDummyRecord eor = (LastCellOfRowDummyRecord)r[i];
- Assert.AreEqual(rowCount, eor.Row);
+ ClassicAssert.AreEqual(rowCount, eor.Row);
rowCount++;
}
}
// Check we got the 33 rows
- Assert.AreEqual(33, rowCount);
+ ClassicAssert.AreEqual(33, rowCount);
}
private class MockHSSFListener : IHSSFListener
@@ -450,8 +450,8 @@ public void TestEndOfRow_bug45672()
{
throw new AssertionException("Identified bug 45672");
}
- Assert.AreEqual(1, eorCount);
- Assert.AreEqual(1, sfrCount);
+ ClassicAssert.AreEqual(1, eorCount);
+ ClassicAssert.AreEqual(1, sfrCount);
}
/**
@@ -497,7 +497,7 @@ public void TestMulBlankHandling()
{
throw new AssertionException("Identified bug 45672");
}
- Assert.AreEqual(2, eorCount);
+ ClassicAssert.AreEqual(2, eorCount);
}
[Test]
public void TestStringRecordHandling()
@@ -518,8 +518,8 @@ public void TestStringRecordHandling()
lastCount++;
}
}
- Assert.AreEqual(1, missingCount);
- Assert.AreEqual(1, lastCount);
+ ClassicAssert.AreEqual(1, missingCount);
+ ClassicAssert.AreEqual(1, lastCount);
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/Extractor/TestExcelExtractor.cs b/testcases/main/HSSF/Extractor/TestExcelExtractor.cs
index fa3f9e2c5..20d71b22e 100644
--- a/testcases/main/HSSF/Extractor/TestExcelExtractor.cs
+++ b/testcases/main/HSSF/Extractor/TestExcelExtractor.cs
@@ -26,10 +26,9 @@ namespace TestCases.HSSF.Extractor
using TestCases.HSSF;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.Record.Crypto;
-
[TestFixture]
public class TestExcelExtractor
{
@@ -55,11 +54,11 @@ public void TestSimple()
ExcelExtractor extractor = CreateExtractor("Simple.xls");
- Assert.AreEqual("Sheet1\nreplaceMe\nSheet2\nSheet3\n", extractor.Text);
+ ClassicAssert.AreEqual("Sheet1\nreplaceMe\nSheet2\nSheet3\n", extractor.Text);
// Now turn off sheet names
extractor.IncludeSheetNames=false;
- Assert.AreEqual("replaceMe\n", extractor.Text);
+ ClassicAssert.AreEqual("replaceMe\n", extractor.Text);
}
[Test]
public void TestNumericFormula()
@@ -74,14 +73,14 @@ public void TestNumericFormula()
"4000\t4\n" +
"5000\t5\n" +
"Sheet2\nSheet3\n";
- Assert.AreEqual(
+ ClassicAssert.AreEqual(
expected,
extractor.Text
);
extractor.FormulasNotResults=(true);
- Assert.AreEqual(
+ ClassicAssert.AreEqual(
"Sheet1\n" +
"1000\t1\tSUMIF(A1:A5,\">4000\",B1:B5)\n" +
"2000\t2\n" +
@@ -103,7 +102,7 @@ public void TestwithContinueRecords()
// Has masses of text
// Until we fixed bug #41064, this would've
// failed by now
- Assert.IsTrue(extractor.Text.Length > 40960);
+ ClassicAssert.IsTrue(extractor.Text.Length > 40960);
}
[Test]
public void TestStringConcat()
@@ -113,11 +112,11 @@ public void TestStringConcat()
// Comes out as NaN if treated as a number
// And as XYZ if treated as a string
- Assert.AreEqual("Sheet1\nreplaceme\nreplaceme\nreplacemereplaceme\nSheet2\nSheet3\n", extractor.Text);
+ ClassicAssert.AreEqual("Sheet1\nreplaceme\nreplaceme\nreplacemereplaceme\nSheet2\nSheet3\n", extractor.Text);
extractor.FormulasNotResults = (true);
- Assert.AreEqual("Sheet1\nreplaceme\nreplaceme\nCONCATENATE(A1,A2)\nSheet2\nSheet3\n", extractor.Text);
+ ClassicAssert.AreEqual("Sheet1\nreplaceme\nreplaceme\nCONCATENATE(A1,A2)\nSheet2\nSheet3\n", extractor.Text);
}
[Test]
public void TestStringFormula()
@@ -127,11 +126,11 @@ public void TestStringFormula()
// Comes out as NaN if treated as a number
// And as XYZ if treated as a string
- Assert.AreEqual("Sheet1\nXYZ\nSheet2\nSheet3\n", extractor.Text);
+ ClassicAssert.AreEqual("Sheet1\nXYZ\nSheet2\nSheet3\n", extractor.Text);
extractor.FormulasNotResults = (true);
- Assert.AreEqual("Sheet1\nUPPER(\"xyz\")\nSheet2\nSheet3\n", extractor.Text);
+ ClassicAssert.AreEqual("Sheet1\nUPPER(\"xyz\")\nSheet2\nSheet3\n", extractor.Text);
}
[Test]
@@ -149,13 +148,13 @@ public void TestEventExtractor()
extractor.IncludeSheetNames = (true);
String text = extractor.Text;
- Assert.AreEqual("Sheet1\nreplaceme\nreplaceme\nreplacemereplaceme\nSheet2\nSheet3\n", text);
+ ClassicAssert.AreEqual("Sheet1\nreplaceme\nreplaceme\nreplacemereplaceme\nSheet2\nSheet3\n", text);
extractor.IncludeSheetNames = (false);
extractor.FormulasNotResults = (true);
text = extractor.Text;
- Assert.AreEqual("replaceme\nreplaceme\nCONCATENATE(A1,A2)\n", text);
+ ClassicAssert.AreEqual("replaceme\nreplaceme\nCONCATENATE(A1,A2)\n", text);
// Now, a slightly longer file with numeric formulas
@@ -168,7 +167,7 @@ public void TestEventExtractor()
extractor.FormulasNotResults = (true);
text = extractor.Text;
- Assert.AreEqual(
+ ClassicAssert.AreEqual(
"1000\t1\tSUMIF(A1:A5,\">4000\",B1:B5)\n" +
"2000\t2\n" +
"3000\t3\n" +
@@ -184,7 +183,7 @@ public void TestWithComments()
extractor.IncludeSheetNames = (false);
// Check without comments
- Assert.AreEqual(
+ ClassicAssert.AreEqual(
"1\tone\n" +
"2\ttwo\n" +
"3\tthree\n",
@@ -193,7 +192,7 @@ public void TestWithComments()
// Now with
extractor.IncludeCellComments = (true);
- Assert.AreEqual(
+ ClassicAssert.AreEqual(
"1\tone Comment by Yegor Kozlov: Yegor Kozlov: first cell\n" +
"2\ttwo Comment by Yegor Kozlov: Yegor Kozlov: second cell\n" +
"3\tthree Comment by Yegor Kozlov: Yegor Kozlov: third cell\n",
@@ -208,14 +207,14 @@ public void TestWithBlank()
extractor.IncludeBlankCells = (true);
String padded = extractor.Text;
- Assert.IsTrue(def.StartsWith(
+ ClassicAssert.IsTrue(def.StartsWith(
"Sheet1\n" +
"&[TAB]\t\n" +
"Hello\n" +
"11\t23\n"
));
- Assert.IsTrue(padded.StartsWith(
+ ClassicAssert.IsTrue(padded.StartsWith(
"Sheet1\n" +
"&[TAB]\t\n" +
"Hello\n" +
@@ -235,36 +234,36 @@ public void TestFormatting()
// actually quite match what they claim to
// be, as some are auto-local builtins...
- Assert.IsTrue(text.StartsWith(
+ ClassicAssert.IsTrue(text.StartsWith(
"Dates, all 24th November 2006\n"
));
- Assert.IsTrue(
+ ClassicAssert.IsTrue(
text.IndexOf(
"yyyy/mm/dd\t2006/11/24\n"
) > -1
);
- Assert.IsTrue(
+ ClassicAssert.IsTrue(
text.IndexOf(
"yyyy-mm-dd\t2006-11-24\n"
) > -1
);
- Assert.IsTrue(
+ ClassicAssert.IsTrue(
text.IndexOf(
"dd-mm-yy\t24-11-06\n"
) > -1
);
- Assert.IsTrue(
+ ClassicAssert.IsTrue(
text.IndexOf(
"nn.nn\t10.52\n"
) > -1
);
- Assert.IsTrue(
+ ClassicAssert.IsTrue(
text.IndexOf(
"nn.nnn\t10.520\n"
) > -1
);
- Assert.IsTrue(
+ ClassicAssert.IsTrue(
text.IndexOf(
"\u00a3nn.nn\t\u00a310.52\n"
) > -1
@@ -291,13 +290,13 @@ public void TestWithEmbeded()
ExcelExtractor exA = new ExcelExtractor(wbA);
ExcelExtractor exB = new ExcelExtractor(wbB);
- Assert.AreEqual("Sheet1\nTest excel file\nThis is the first file\nSheet2\nSheet3\n",
+ ClassicAssert.AreEqual("Sheet1\nTest excel file\nThis is the first file\nSheet2\nSheet3\n",
exA.Text);
- Assert.AreEqual("Sample Excel", exA.SummaryInformation.Title);
+ ClassicAssert.AreEqual("Sample Excel", exA.SummaryInformation.Title);
- Assert.AreEqual("Sheet1\nAnother excel file\nThis is the second file\nSheet2\nSheet3\n",
+ ClassicAssert.AreEqual("Sheet1\nAnother excel file\nThis is the second file\nSheet2\nSheet3\n",
exB.Text);
- Assert.AreEqual("Sample Excel 2", exB.SummaryInformation.Title);
+ ClassicAssert.AreEqual("Sample Excel 2", exB.SummaryInformation.Title);
}
/**
@@ -319,19 +318,19 @@ public void TestWithEmbededInOwn()
ExcelExtractor exA = new ExcelExtractor(wbA);
ExcelExtractor exB = new ExcelExtractor(wbB);
- Assert.AreEqual("Sheet1\nTest excel file\nThis is the first file\nSheet2\nSheet3\n",
+ ClassicAssert.AreEqual("Sheet1\nTest excel file\nThis is the first file\nSheet2\nSheet3\n",
exA.Text);
- Assert.AreEqual("Sample Excel", exA.SummaryInformation.Title);
+ ClassicAssert.AreEqual("Sample Excel", exA.SummaryInformation.Title);
- Assert.AreEqual("Sheet1\nAnother excel file\nThis is the second file\nSheet2\nSheet3\n",
+ ClassicAssert.AreEqual("Sheet1\nAnother excel file\nThis is the second file\nSheet2\nSheet3\n",
exB.Text);
- Assert.AreEqual("Sample Excel 2", exB.SummaryInformation.Title);
+ ClassicAssert.AreEqual("Sample Excel 2", exB.SummaryInformation.Title);
// And the base file too
ExcelExtractor ex = new ExcelExtractor(fs);
- Assert.AreEqual("Sheet1\nI have lots of embeded files in me\nSheet2\nSheet3\n",
+ ClassicAssert.AreEqual("Sheet1\nI have lots of embeded files in me\nSheet2\nSheet3\n",
ex.Text);
- Assert.AreEqual("Excel With Embeded", ex.SummaryInformation.Title);
+ ClassicAssert.AreEqual("Excel With Embeded", ex.SummaryInformation.Title);
}
/**
@@ -348,8 +347,8 @@ public void Test45538()
{
ExcelExtractor extractor = CreateExtractor(files[i]);
String text = extractor.Text;
- Assert.IsTrue(text.IndexOf("testdoc") >= 0, "Unable to find expected word in text\n" + text);
- Assert.IsTrue(text.IndexOf("test phrase") >= 0, "Unable to find expected word in text\n" + text);
+ ClassicAssert.IsTrue(text.IndexOf("testdoc") >= 0, "Unable to find expected word in text\n" + text);
+ ClassicAssert.IsTrue(text.IndexOf("test phrase") >= 0, "Unable to find expected word in text\n" + text);
}
}
[Test]
@@ -361,14 +360,14 @@ public void TestPassword()
String text = extractor.Text;
Biff8EncryptionKey.CurrentUserPassword = (null);
- Assert.IsTrue(text.Contains("ZIP"));
+ ClassicAssert.IsTrue(text.Contains("ZIP"));
}
[Test]
public void TestNullPointerException()
{
ExcelExtractor extractor = CreateExtractor("ar.org.apsme.www_Form%20Inscripcion%20Curso%20NO%20Socios.xls");
- Assert.IsNotNull(extractor);
- Assert.IsNotNull(extractor.Text);
+ ClassicAssert.IsNotNull(extractor);
+ ClassicAssert.IsNotNull(extractor.Text);
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/Extractor/TestOldExcelExtractor.cs b/testcases/main/HSSF/Extractor/TestOldExcelExtractor.cs
index 28980ae97..68c130f5b 100644
--- a/testcases/main/HSSF/Extractor/TestOldExcelExtractor.cs
+++ b/testcases/main/HSSF/Extractor/TestOldExcelExtractor.cs
@@ -21,7 +21,7 @@ namespace TestCases.HSSF.Extractor
using NPOI.HSSF.Extractor;
using NPOI.POIFS.FileSystem;
using NPOI.Util;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using System;
using System.IO;
using System.Text;
@@ -68,8 +68,8 @@ public void TestSimpleExcel3()
AssertContains(text, "1981/82");
// Check the type
- Assert.AreEqual(3, extractor.BiffVersion);
- Assert.AreEqual(0x10, extractor.FileType);
+ ClassicAssert.AreEqual(3, extractor.BiffVersion);
+ ClassicAssert.AreEqual(0x10, extractor.FileType);
extractor.Close();
}
@@ -77,7 +77,7 @@ public void TestSimpleExcel3()
public void TestSimpleExcel3NoReading()
{
OldExcelExtractor extractor = CreateExtractor("testEXCEL_3.xls");
- Assert.IsNotNull(extractor);
+ ClassicAssert.IsNotNull(extractor);
extractor.Close();
}
@@ -99,8 +99,8 @@ public void TestSimpleExcel4()
AssertContains(text, "784");
// Check the type
- Assert.AreEqual(4, extractor.BiffVersion);
- Assert.AreEqual(0x10, extractor.FileType);
+ ClassicAssert.AreEqual(4, extractor.BiffVersion);
+ ClassicAssert.AreEqual(0x10, extractor.FileType);
extractor.Close();
}
@@ -126,8 +126,8 @@ public void TestSimpleExcel5()
AssertContains(text, "Sheet: Feuil3");
// Check the type
- Assert.AreEqual(5, extractor.BiffVersion);
- Assert.AreEqual(0x05, extractor.FileType);
+ ClassicAssert.AreEqual(5, extractor.BiffVersion);
+ ClassicAssert.AreEqual(0x05, extractor.FileType);
extractor.Close();
}
@@ -215,8 +215,8 @@ public void TestFromFile()
OldExcelExtractor extractor = new OldExcelExtractor(f);
String text = extractor.Text;
- Assert.IsNotNull(text);
- Assert.IsTrue(text.Length > 100);
+ ClassicAssert.IsNotNull(text);
+ ClassicAssert.IsTrue(text.Length > 100);
extractor.Close();
}
@@ -268,7 +268,7 @@ public void TestInputStream()
{
OldExcelExtractor extractor = new OldExcelExtractor(stream);
String text = extractor.Text;
- Assert.IsNotNull(text);
+ ClassicAssert.IsNotNull(text);
extractor.Close();
}
finally
@@ -385,7 +385,7 @@ public void TestMain()
out1.Close();
}
String string1 = Encoding.UTF8.GetString(out1.ToByteArray());
- Assert.IsTrue(string1.Contains("Table C-13--Lemons"), "Had: " + string1);
+ ClassicAssert.IsTrue(string1.Contains("Table C-13--Lemons"), "Had: " + string1);
}
finally
{
@@ -398,8 +398,8 @@ public void TestEncryptionException()
//test file derives from Common Crawl
FileInfo file = HSSFTestDataSamples.GetSampleFile("60284.xls");
OldExcelExtractor ex = new OldExcelExtractor(file);
- Assert.AreEqual(5, ex.BiffVersion);
- Assert.AreEqual(5, ex.FileType);
+ ClassicAssert.AreEqual(5, ex.BiffVersion);
+ ClassicAssert.AreEqual(5, ex.FileType);
try
{
var x = ex.Text;
@@ -407,7 +407,7 @@ public void TestEncryptionException()
}
catch (EncryptedDocumentException)
{
- Assert.IsTrue(true, "correct exception thrown");
+ ClassicAssert.IsTrue(true, "correct exception thrown");
}
ex.Close();
}
diff --git a/testcases/main/HSSF/Model/TestDrawingAggregate.cs b/testcases/main/HSSF/Model/TestDrawingAggregate.cs
index 6dc3ec87a..40f17589f 100644
--- a/testcases/main/HSSF/Model/TestDrawingAggregate.cs
+++ b/testcases/main/HSSF/Model/TestDrawingAggregate.cs
@@ -22,7 +22,7 @@ limitations Under the License.
using NPOI.HSSF.UserModel;
using System.IO;
using NPOI.Util;
-using NUnit.Framework;
+using NUnit.Framework;using NUnit.Framework.Legacy;
using TestCases.HSSF.UserModel;
using NPOI.HSSF.Model;
using NPOI.DDF;
@@ -144,8 +144,8 @@ private static void assertWriteAndReadBack(HSSFWorkbook wb)
byte[] dgBytes1 = info.GetRawBytes();
byte[] dgBytes2 = agg.Serialize();
- Assert.AreEqual(dgBytes1.Length, dgBytes2.Length, "different size of raw data ande aggregate.Serialize()");
- Assert.IsTrue(Arrays.Equals(dgBytes1, dgBytes2), "raw Drawing data (" + dgBytes1.Length + " bytes) and aggregate.Serialize() are different.");
+ ClassicAssert.AreEqual(dgBytes1.Length, dgBytes2.Length, "different size of raw data ande aggregate.Serialize()");
+ ClassicAssert.IsTrue(Arrays.Equals(dgBytes1, dgBytes2), "raw Drawing data (" + dgBytes1.Length + " bytes) and aggregate.Serialize() are different.");
}
}
@@ -161,8 +161,8 @@ private static void assertWriteAndReadBack(HSSFWorkbook wb)
DrawingAggregateInfo info2 = DrawingAggregateInfo.Get(sheet2);
byte[] dgBytes1 = info1.GetRawBytes();
byte[] dgBytes2 = info2.GetRawBytes();
- Assert.AreEqual(dgBytes1.Length, dgBytes2.Length, "different size of Drawing data before and After save");
- Assert.IsTrue(Arrays.Equals(dgBytes1, dgBytes2), "drawing data (" + dgBytes1.Length + " bytes) before and After save is different.");
+ ClassicAssert.AreEqual(dgBytes1.Length, dgBytes2.Length, "different size of Drawing data before and After save");
+ ClassicAssert.IsTrue(Arrays.Equals(dgBytes1, dgBytes2), "drawing data (" + dgBytes1.Length + " bytes) before and After save is different.");
}
}
wb2.Close();
@@ -184,7 +184,7 @@ public void TestAllTestSamples()
// }
// }
//);
- //Assert.IsNotNull(xls,
+ //ClassicAssert.IsNotNull(xls,
// "Need to find files in test-data path, had path: " + new File(System.getProperty("POI.testdata.path"), "spreadsheet"));
//foreach(File file in xls) {
// HSSFWorkbook wb;
@@ -235,7 +235,7 @@ public void TestIncompleteData()
records.Add(r);
pos += bytesRead;
}
- Assert.AreEqual(dgBytes.Length, pos, "data was not fully Read");
+ ClassicAssert.AreEqual(dgBytes.Length, pos, "data was not fully Read");
// serialize to byte array
MemoryStream out1 = new MemoryStream();
@@ -246,7 +246,7 @@ public void TestIncompleteData()
out1.Write(data1, 0, data1.Length);
}
- Assert.AreEqual(HexDump.ToHex(dgBytes, 10), HexDump.ToHex(out1.ToArray(), 10));
+ ClassicAssert.AreEqual(HexDump.ToHex(dgBytes, 10), HexDump.ToHex(out1.ToArray(), 10));
}
/**
@@ -294,23 +294,23 @@ public void TestSolverContainerMustBeSavedDuringSerialization()
byte[] dgBytes = ToArray(dgRecords);
HSSFPatriarch p = sh.DrawingPatriarch as HSSFPatriarch;
EscherAggregate agg = (EscherAggregate)ish.FindFirstRecordBySid(EscherAggregate.sid);
- Assert.AreEqual(agg.EscherRecords[0].ChildRecords.Count, 3);
- Assert.AreEqual(agg.EscherRecords[0].GetChild(2).RecordId, EscherContainerRecord.SOLVER_CONTAINER);
+ ClassicAssert.AreEqual(agg.EscherRecords[0].ChildRecords.Count, 3);
+ ClassicAssert.AreEqual(agg.EscherRecords[0].GetChild(2).RecordId, EscherContainerRecord.SOLVER_CONTAINER);
HSSFWorkbook wb2 = HSSFTestDataSamples.WriteOutAndReadBack(wb1);
wb1.Close();
sh = wb2.GetSheetAt(0) as HSSFSheet;
p = sh.DrawingPatriarch as HSSFPatriarch;
ish = HSSFTestHelper.GetSheetForTest(sh);
agg = (EscherAggregate)ish.FindFirstRecordBySid(EscherAggregate.sid);
- Assert.AreEqual(agg.EscherRecords[0].ChildRecords.Count, 3);
- Assert.AreEqual(agg.EscherRecords[0].GetChild(2).RecordId, EscherContainerRecord.SOLVER_CONTAINER);
+ ClassicAssert.AreEqual(agg.EscherRecords[0].ChildRecords.Count, 3);
+ ClassicAssert.AreEqual(agg.EscherRecords[0].GetChild(2).RecordId, EscherContainerRecord.SOLVER_CONTAINER);
// collect Drawing records into a byte buffer.
agg = (EscherAggregate)ish.FindFirstRecordBySid(EscherAggregate.sid);
byte[] dgBytesAfterSave = agg.Serialize();
- Assert.AreEqual(dgBytes.Length, dgBytesAfterSave.Length, "different size of Drawing data before and After save");
- Assert.IsTrue(Arrays.Equals(dgBytes, dgBytesAfterSave), "drawing data before and After save is different");
+ ClassicAssert.AreEqual(dgBytes.Length, dgBytesAfterSave.Length, "different size of Drawing data before and After save");
+ ClassicAssert.IsTrue(Arrays.Equals(dgBytes, dgBytesAfterSave), "drawing data before and After save is different");
wb2.Close();
}
@@ -329,8 +329,8 @@ public void TestFileWithTextbox()
// collect Drawing records into a byte buffer.
EscherAggregate agg = (EscherAggregate)ish.FindFirstRecordBySid(EscherAggregate.sid);
byte[] dgBytesAfterSave = agg.Serialize();
- Assert.AreEqual(dgBytes.Length, dgBytesAfterSave.Length, "different size of Drawing data before and After save");
- Assert.IsTrue(Arrays.Equals(dgBytes, dgBytesAfterSave), "drawing data before and After save is different");
+ ClassicAssert.AreEqual(dgBytes.Length, dgBytesAfterSave.Length, "different size of Drawing data before and After save");
+ ClassicAssert.IsTrue(Arrays.Equals(dgBytes, dgBytesAfterSave), "drawing data before and After save is different");
wb.Close();
}
@@ -349,7 +349,7 @@ public void TestFileWithCharts()
// collect Drawing records into a byte buffer.
EscherAggregate agg = (EscherAggregate)ish.FindFirstRecordBySid(EscherAggregate.sid);
byte[] dgBytesAfterSave = agg.Serialize();
- Assert.AreEqual(dgBytes.Length, dgBytesAfterSave.Length, "different size of Drawing data before and After save");
+ ClassicAssert.AreEqual(dgBytes.Length, dgBytesAfterSave.Length, "different size of Drawing data before and After save");
for (int i = 0; i < dgBytes.Length; i++)
{
if (dgBytes[i] != dgBytesAfterSave[i])
@@ -357,7 +357,7 @@ public void TestFileWithCharts()
Console.WriteLine("pos = " + i);
}
}
- Assert.IsTrue(Arrays.Equals(dgBytes, dgBytesAfterSave), "drawing data before and After save is different");
+ ClassicAssert.IsTrue(Arrays.Equals(dgBytes, dgBytesAfterSave), "drawing data before and After save is different");
wb.Close();
}
@@ -377,9 +377,9 @@ public void Test45129()
List records = isheet.Records;
// the sheet's Drawing is not aggregated
- Assert.AreEqual(394, records.Count, "wrong size of sheet records stream");
+ ClassicAssert.AreEqual(394, records.Count, "wrong size of sheet records stream");
// the last record before the Drawing block
- Assert.IsTrue(records[(18)] is RowRecordsAggregate,
+ ClassicAssert.IsTrue(records[(18)] is RowRecordsAggregate,
"records.Get(18) is expected to be RowRecordsAggregate but was " + records[(18)].GetType().Name);
// records to be aggregated
@@ -393,7 +393,7 @@ public void Test45129()
short sid = r.Sid;
// we expect that Drawing block consists of either
// DrawingRecord or ContinueRecord or ObjRecord or TextObjectRecord
- Assert.IsTrue(
+ ClassicAssert.IsTrue(
sid == DrawingRecord.sid ||
sid == ContinueRecord.sid ||
sid == ObjRecord.sid ||
@@ -401,7 +401,7 @@ public void Test45129()
}
// the first record After the Drawing block
- Assert.IsTrue(records[(389)] is WindowTwoRecord, "records.Get(389) is expected to be Window2");
+ ClassicAssert.IsTrue(records[(389)] is WindowTwoRecord, "records.Get(389) is expected to be Window2");
// aggregate Drawing records.
// The subrange [19, 388] is expected to be Replaced with a EscherAggregate object
@@ -409,17 +409,17 @@ public void Test45129()
int loc = isheet.AggregateDrawingRecords(drawingManager, false);
EscherAggregate agg = (EscherAggregate)records[(loc)];
- Assert.AreEqual(25, records.Count, "wrong size of the aggregated sheet records stream");
- Assert.IsTrue(records[18] is RowRecordsAggregate,
+ ClassicAssert.AreEqual(25, records.Count, "wrong size of the aggregated sheet records stream");
+ ClassicAssert.IsTrue(records[18] is RowRecordsAggregate,
"records.Get(18) is expected to be RowRecordsAggregate but was " + records[18].GetType().Name);
- Assert.IsTrue(records[19] is EscherAggregate,
+ ClassicAssert.IsTrue(records[19] is EscherAggregate,
"records.Get(19) is expected to be EscherAggregate but was " + records[19].GetType().Name);
- Assert.IsTrue(records[20] is WindowTwoRecord,
+ ClassicAssert.IsTrue(records[20] is WindowTwoRecord,
"records.Get(20) is expected to be Window2 but was " + records[20].GetType().Name);
byte[] dgBytesAfterSave = agg.Serialize();
- Assert.AreEqual(dgBytes.Length, dgBytesAfterSave.Length, "different size of Drawing data before and After save");
- Assert.IsTrue(Arrays.Equals(dgBytes, dgBytesAfterSave), "drawing data before and After save is different");
+ ClassicAssert.AreEqual(dgBytes.Length, dgBytesAfterSave.Length, "different size of Drawing data before and After save");
+ ClassicAssert.IsTrue(Arrays.Equals(dgBytes, dgBytesAfterSave), "drawing data before and After save is different");
wb.Close();
}
@@ -443,9 +443,9 @@ public void TestSerializeDrawingBigger8k()
List records = isheet.Records;
// the sheet's Drawing is not aggregated
- Assert.AreEqual(32, records.Count, "wrong size of sheet records stream");
+ ClassicAssert.AreEqual(32, records.Count, "wrong size of sheet records stream");
// the last record before the Drawing block
- Assert.IsTrue(records[18] is RowRecordsAggregate,
+ ClassicAssert.IsTrue(records[18] is RowRecordsAggregate,
"records.Get(18) is expected to be RowRecordsAggregate but was " + records[18].GetType().Name);
// records to be aggregated
@@ -456,7 +456,7 @@ public void TestSerializeDrawingBigger8k()
short sid = r.Sid;
// we expect that Drawing block consists of either
// DrawingRecord or ContinueRecord or ObjRecord or TextObjectRecord
- Assert.IsTrue(
+ ClassicAssert.IsTrue(
sid == DrawingRecord.sid ||
sid == ContinueRecord.sid ||
sid == ObjRecord.sid ||
@@ -467,7 +467,7 @@ public void TestSerializeDrawingBigger8k()
byte[] dgBytes = ToArray(dgRecords);
// the first record After the Drawing block
- Assert.IsTrue(records[(26)] is WindowTwoRecord, "records.Get(26) is expected to be Window2");
+ ClassicAssert.IsTrue(records[(26)] is WindowTwoRecord, "records.Get(26) is expected to be Window2");
// aggregate Drawing records.
// The subrange [19, 38] is expected to be Replaced with a EscherAggregate object
@@ -475,17 +475,17 @@ public void TestSerializeDrawingBigger8k()
int loc = isheet.AggregateDrawingRecords(drawingManager, false);
EscherAggregate agg = (EscherAggregate)records[(loc)];
- Assert.AreEqual(26, records.Count, "wrong size of the aggregated sheet records stream");
- Assert.IsTrue(records[(18)] is RowRecordsAggregate,
+ ClassicAssert.AreEqual(26, records.Count, "wrong size of the aggregated sheet records stream");
+ ClassicAssert.IsTrue(records[(18)] is RowRecordsAggregate,
"records.Get(18) is expected to be RowRecordsAggregate but was " + records[(18)].GetType().Name);
- Assert.IsTrue(records[(19)] is EscherAggregate,
+ ClassicAssert.IsTrue(records[(19)] is EscherAggregate,
"records.Get(19) is expected to be EscherAggregate but was " + records[19].GetType().Name);
- Assert.IsTrue(records[(20)] is WindowTwoRecord,
+ ClassicAssert.IsTrue(records[(20)] is WindowTwoRecord,
"records.Get(20) is expected to be Window2 but was " + records[20].GetType().Name);
byte[] dgBytesAfterSave = agg.Serialize();
- Assert.AreEqual(dgBytes.Length, dgBytesAfterSave.Length,"different size of Drawing data before and After save");
- Assert.IsTrue(Arrays.Equals(dgBytes, dgBytesAfterSave), "drawing data before and After save is different");
+ ClassicAssert.AreEqual(dgBytes.Length, dgBytesAfterSave.Length,"different size of Drawing data before and After save");
+ ClassicAssert.IsTrue(Arrays.Equals(dgBytes, dgBytesAfterSave), "drawing data before and After save is different");
wb.Close();
@@ -504,17 +504,17 @@ public void TestSerializeDrawingBigger8k_noAggregation()
InternalSheet isheet2 = HSSFTestHelper.GetSheetForTest(wb2.GetSheetAt(0) as HSSFSheet);
List records2 = isheet2.Records;
- Assert.AreEqual(records.Count, records2.Count);
+ ClassicAssert.AreEqual(records.Count, records2.Count);
for (int i = 0; i < records.Count; i++)
{
RecordBase r1 = records[(i)];
RecordBase r2 = records2[(i)];
- Assert.IsTrue(r1.GetType() == r2.GetType());
- Assert.AreEqual(r1.RecordSize, r2.RecordSize);
+ ClassicAssert.IsTrue(r1.GetType() == r2.GetType());
+ ClassicAssert.AreEqual(r1.RecordSize, r2.RecordSize);
if (r1 is NPOI.HSSF.Record.Record)
{
- Assert.AreEqual(((NPOI.HSSF.Record.Record)r1).Sid, ((NPOI.HSSF.Record.Record)r2).Sid);
- Assert.IsTrue(Arrays.Equals(((NPOI.HSSF.Record.Record)r1).Serialize(), ((NPOI.HSSF.Record.Record)r2).Serialize()));
+ ClassicAssert.AreEqual(((NPOI.HSSF.Record.Record)r1).Sid, ((NPOI.HSSF.Record.Record)r2).Sid);
+ ClassicAssert.IsTrue(Arrays.Equals(((NPOI.HSSF.Record.Record)r1).Serialize(), ((NPOI.HSSF.Record.Record)r2).Serialize()));
}
}
wb2.Close();
@@ -530,9 +530,9 @@ public void TestSerializeDrawingWithComments()
List records = isheet.Records;
// the sheet's Drawing is not aggregated
- Assert.AreEqual(46, records.Count, "wrong size of sheet records stream");
+ ClassicAssert.AreEqual(46, records.Count, "wrong size of sheet records stream");
// the last record before the Drawing block
- Assert.IsTrue(records[(18)] is RowRecordsAggregate,
+ ClassicAssert.IsTrue(records[(18)] is RowRecordsAggregate,
"records.Get(18) is expected to be RowRecordsAggregate but was " + records[(18)].GetType().Name);
// records to be aggregated
@@ -543,7 +543,7 @@ public void TestSerializeDrawingWithComments()
short sid = r.Sid;
// we expect that Drawing block consists of either
// DrawingRecord or ContinueRecord or ObjRecord or TextObjectRecord
- Assert.IsTrue(
+ ClassicAssert.IsTrue(
sid == DrawingRecord.sid ||
sid == ContinueRecord.sid ||
sid == ObjRecord.sid ||
@@ -554,7 +554,7 @@ public void TestSerializeDrawingWithComments()
byte[] dgBytes = ToArray(dgRecords);
// the first record After the Drawing block
- Assert.IsTrue(records[(39)] is WindowTwoRecord, "records.Get(39) is expected to be Window2");
+ ClassicAssert.IsTrue(records[(39)] is WindowTwoRecord, "records.Get(39) is expected to be Window2");
// aggregate Drawing records.
// The subrange [19, 38] is expected to be Replaced with a EscherAggregate object
@@ -562,17 +562,17 @@ public void TestSerializeDrawingWithComments()
int loc = isheet.AggregateDrawingRecords(drawingManager, false);
EscherAggregate agg = (EscherAggregate)records[(loc)];
- Assert.AreEqual(27, records.Count, "wrong size of the aggregated sheet records stream");
- Assert.IsTrue(records[(18)] is RowRecordsAggregate,
+ ClassicAssert.AreEqual(27, records.Count, "wrong size of the aggregated sheet records stream");
+ ClassicAssert.IsTrue(records[(18)] is RowRecordsAggregate,
"records.Get(18) is expected to be RowRecordsAggregate but was " + records[(18)].GetType().Name);
- Assert.IsTrue(records[(19)] is EscherAggregate,
+ ClassicAssert.IsTrue(records[(19)] is EscherAggregate,
"records.Get(19) is expected to be EscherAggregate but was " + records[(19)].GetType().Name);
- Assert.IsTrue(records[(20)] is WindowTwoRecord,
+ ClassicAssert.IsTrue(records[(20)] is WindowTwoRecord,
"records.Get(20) is expected to be Window2 but was " + records[20].GetType().Name);
byte[] dgBytesAfterSave = agg.Serialize();
- Assert.AreEqual(dgBytes.Length, dgBytesAfterSave.Length, "different size of Drawing data before and After save");
- Assert.IsTrue(Arrays.Equals(dgBytes, dgBytesAfterSave), "drawing data before and After save is different");
+ ClassicAssert.AreEqual(dgBytes.Length, dgBytesAfterSave.Length, "different size of Drawing data before and After save");
+ ClassicAssert.IsTrue(Arrays.Equals(dgBytes, dgBytesAfterSave), "drawing data before and After save is different");
wb.Close();
}
@@ -588,9 +588,9 @@ public void TestFileWithPictures()
List records = isheet.Records;
// the sheet's Drawing is not aggregated
- Assert.AreEqual(315, records.Count, "wrong size of sheet records stream");
+ ClassicAssert.AreEqual(315, records.Count, "wrong size of sheet records stream");
// the last record before the Drawing block
- Assert.IsTrue(records[(21)] is RowRecordsAggregate,
+ ClassicAssert.IsTrue(records[(21)] is RowRecordsAggregate,
"records.Get(21) is expected to be RowRecordsAggregate but was " + records[(21)].GetType().Name);
// records to be aggregated
@@ -601,7 +601,7 @@ public void TestFileWithPictures()
short sid = r.Sid;
// we expect that Drawing block consists of either
// DrawingRecord or ContinueRecord or ObjRecord or TextObjectRecord
- Assert.IsTrue(
+ ClassicAssert.IsTrue(
sid == DrawingRecord.sid ||
sid == ContinueRecord.sid ||
sid == ObjRecord.sid ||
@@ -611,7 +611,7 @@ public void TestFileWithPictures()
byte[] dgBytes = ToArray(dgRecords);
// the first record After the Drawing block
- Assert.IsTrue(records[(300)] is WindowTwoRecord, "records.Get(300) is expected to be Window2");
+ ClassicAssert.IsTrue(records[(300)] is WindowTwoRecord, "records.Get(300) is expected to be Window2");
// aggregate Drawing records.
// The subrange [19, 299] is expected to be Replaced with a EscherAggregate object
@@ -619,17 +619,17 @@ public void TestFileWithPictures()
int loc = isheet.AggregateDrawingRecords(drawingManager, false);
EscherAggregate agg = (EscherAggregate)records[(loc)];
- Assert.AreEqual(38, records.Count, "wrong size of the aggregated sheet records stream");
- Assert.IsTrue(records[(21)] is RowRecordsAggregate,
+ ClassicAssert.AreEqual(38, records.Count, "wrong size of the aggregated sheet records stream");
+ ClassicAssert.IsTrue(records[(21)] is RowRecordsAggregate,
"records.Get(21) is expected to be RowRecordsAggregate but was " + records[(21)].GetType().Name);
- Assert.IsTrue(records[(22)] is EscherAggregate,
+ ClassicAssert.IsTrue(records[(22)] is EscherAggregate,
"records.Get(22) is expected to be EscherAggregate but was " + records[22].GetType().Name);
- Assert.IsTrue(records[23] is WindowTwoRecord,
+ ClassicAssert.IsTrue(records[23] is WindowTwoRecord,
"records.Get(23) is expected to be Window2 but was " + records[23].GetType().Name);
byte[] dgBytesAfterSave = agg.Serialize();
- Assert.AreEqual(dgBytes.Length, dgBytesAfterSave.Length, "different size of Drawing data before and After save");
- Assert.IsTrue(Arrays.Equals(dgBytes, dgBytesAfterSave), "drawing data before and After save is different");
+ ClassicAssert.AreEqual(dgBytes.Length, dgBytesAfterSave.Length, "different size of Drawing data before and After save");
+ ClassicAssert.IsTrue(Arrays.Equals(dgBytes, dgBytesAfterSave), "drawing data before and After save is different");
wb.Close();
}
[Test]
@@ -738,7 +738,7 @@ public void TestUnhandledContinue()
byte[] dgBytes = Decompress(data);
IList dgRecords = RecordFactory.CreateRecords(new MemoryStream(dgBytes));
- Assert.AreEqual(20, dgRecords.Count);
+ ClassicAssert.AreEqual(20, dgRecords.Count);
short[] expectedSids = {
DrawingRecord.sid,
@@ -764,7 +764,7 @@ public void TestUnhandledContinue()
};
for (int i = 0; i < expectedSids.Length; i++)
{
- Assert.AreEqual(expectedSids[i], dgRecords[(i)].Sid, "unexpected record.sid and index[" + i + "]");
+ ClassicAssert.AreEqual(expectedSids[i], dgRecords[(i)].Sid, "unexpected record.sid and index[" + i + "]");
}
DrawingManager2 drawingManager = new DrawingManager2(new EscherDggRecord());
@@ -777,14 +777,14 @@ public void TestUnhandledContinue()
sheet.AggregateDrawingRecords(drawingManager, false);
- Assert.AreEqual(2, records.Count, "drawing was not fully aggregated");
- Assert.IsTrue(records[(0)] is EscherAggregate, "expected EscherAggregate");
- Assert.IsTrue(records[(1)] is EOFRecord, "expected EOFRecord");
+ ClassicAssert.AreEqual(2, records.Count, "drawing was not fully aggregated");
+ ClassicAssert.IsTrue(records[(0)] is EscherAggregate, "expected EscherAggregate");
+ ClassicAssert.IsTrue(records[(1)] is EOFRecord, "expected EOFRecord");
EscherAggregate agg = (EscherAggregate)records[(0)];
byte[] dgBytesAfterSave = agg.Serialize();
- Assert.AreEqual(dgBytes.Length, dgBytesAfterSave.Length, "different size of Drawing data before and After save");
- Assert.IsTrue(Arrays.Equals(dgBytes, dgBytesAfterSave), "drawing data before and After save is different");
+ ClassicAssert.AreEqual(dgBytes.Length, dgBytesAfterSave.Length, "different size of Drawing data before and After save");
+ ClassicAssert.IsTrue(Arrays.Equals(dgBytes, dgBytesAfterSave), "drawing data before and After save is different");
}
[Test]
public void TestUnhandledContinue2()
@@ -918,7 +918,7 @@ public void TestUnhandledContinue2()
byte[] dgBytes = Decompress(data);
IList dgRecords = RecordFactory.CreateRecords(new MemoryStream(dgBytes));
- Assert.AreEqual(14, dgRecords.Count);
+ ClassicAssert.AreEqual(14, dgRecords.Count);
short[] expectedSids = {
DrawingRecord.sid,
@@ -939,7 +939,7 @@ public void TestUnhandledContinue2()
for (int i = 0; i < expectedSids.Length; i++)
{
- Assert.AreEqual(expectedSids[i], dgRecords[(i)].Sid, "unexpected record.sid and index[" + i + "]");
+ ClassicAssert.AreEqual(expectedSids[i], dgRecords[(i)].Sid, "unexpected record.sid and index[" + i + "]");
}
DrawingManager2 drawingManager = new DrawingManager2(new EscherDggRecord());
@@ -951,15 +951,15 @@ public void TestUnhandledContinue2()
records.Add(EOFRecord.instance);
sheet.AggregateDrawingRecords(drawingManager, false);
- Assert.AreEqual(2, records.Count, "drawing was not fully aggregated");
- Assert.IsTrue(records[(0)] is EscherAggregate , "expected EscherAggregate");
- Assert.IsTrue(records[(1)] is EOFRecord , "expected EOFRecord");
+ ClassicAssert.AreEqual(2, records.Count, "drawing was not fully aggregated");
+ ClassicAssert.IsTrue(records[(0)] is EscherAggregate , "expected EscherAggregate");
+ ClassicAssert.IsTrue(records[(1)] is EOFRecord , "expected EOFRecord");
EscherAggregate agg = (EscherAggregate)records[(0)];
byte[] dgBytesAfterSave = agg.Serialize();
- Assert.AreEqual(dgBytes.Length, dgBytesAfterSave.Length, "different size of Drawing data before and After save");
- Assert.IsTrue(Arrays.Equals(dgBytes, dgBytesAfterSave), "drawing data brefpore and After save is different");
+ ClassicAssert.AreEqual(dgBytes.Length, dgBytesAfterSave.Length, "different size of Drawing data before and After save");
+ ClassicAssert.IsTrue(Arrays.Equals(dgBytes, dgBytesAfterSave), "drawing data brefpore and After save is different");
}
}
}
diff --git a/testcases/main/HSSF/Model/TestDrawingManager.cs b/testcases/main/HSSF/Model/TestDrawingManager.cs
index f195eddc1..bb393af9f 100644
--- a/testcases/main/HSSF/Model/TestDrawingManager.cs
+++ b/testcases/main/HSSF/Model/TestDrawingManager.cs
@@ -20,7 +20,7 @@ namespace TestCases.HSSF.Model
using NPOI.DDF;
using NPOI.HSSF.Model;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
[TestFixture]
[Obsolete("deprecated in POI 3.15-beta2, scheduled for removal in 3.17, use DrawingManager2 instead")]
@@ -32,11 +32,11 @@ public void TestFindFreeSPIDBlock()
EscherDggRecord dgg = new EscherDggRecord();
DrawingManager dm = new DrawingManager(dgg);
dgg.ShapeIdMax = (1024);
- Assert.AreEqual(2048, dm.FindFreeSPIDBlock());
+ ClassicAssert.AreEqual(2048, dm.FindFreeSPIDBlock());
dgg.ShapeIdMax = (1025);
- Assert.AreEqual(2048, dm.FindFreeSPIDBlock());
+ ClassicAssert.AreEqual(2048, dm.FindFreeSPIDBlock());
dgg.ShapeIdMax = (2047);
- Assert.AreEqual(2048, dm.FindFreeSPIDBlock());
+ ClassicAssert.AreEqual(2048, dm.FindFreeSPIDBlock());
}
[Test]
@@ -47,11 +47,11 @@ public void TestFindNewDrawingGroupId()
dgg.FileIdClusters=(new EscherDggRecord.FileIdCluster[]{
new EscherDggRecord.FileIdCluster( 2, 10 )});
DrawingManager dm = new DrawingManager(dgg);
- Assert.AreEqual(1, dm.FindNewDrawingGroupId());
+ ClassicAssert.AreEqual(1, dm.FindNewDrawingGroupId());
dgg.FileIdClusters=(new EscherDggRecord.FileIdCluster[]{
new EscherDggRecord.FileIdCluster( 1, 10 ),
new EscherDggRecord.FileIdCluster( 2, 10 )});
- Assert.AreEqual(3, dm.FindNewDrawingGroupId());
+ ClassicAssert.AreEqual(3, dm.FindNewDrawingGroupId());
}
[Test]
public void TestDrawingGroupExists()
@@ -61,9 +61,9 @@ public void TestDrawingGroupExists()
dgg.FileIdClusters=(new EscherDggRecord.FileIdCluster[]{
new EscherDggRecord.FileIdCluster( 2, 10 )});
DrawingManager dm = new DrawingManager(dgg);
- Assert.IsFalse(dm.DrawingGroupExists((short)1));
- Assert.IsTrue(dm.DrawingGroupExists((short)2));
- Assert.IsFalse(dm.DrawingGroupExists((short)3));
+ ClassicAssert.IsFalse(dm.DrawingGroupExists((short)1));
+ ClassicAssert.IsTrue(dm.DrawingGroupExists((short)2));
+ ClassicAssert.IsFalse(dm.DrawingGroupExists((short)3));
}
[Test]
public void TestCreateDgRecord()
@@ -74,12 +74,12 @@ public void TestCreateDgRecord()
DrawingManager dm = new DrawingManager(dgg);
EscherDgRecord dgRecord = dm.CreateDgRecord();
- Assert.AreEqual(-1, dgRecord.LastMSOSPID);
- Assert.AreEqual(0, dgRecord.NumShapes);
- Assert.AreEqual(1, dm.Dgg.DrawingsSaved);
- Assert.AreEqual(1, dm.Dgg.FileIdClusters.Length);
- Assert.AreEqual(1, dm.Dgg.FileIdClusters[0].DrawingGroupId);
- Assert.AreEqual(0, dm.Dgg.FileIdClusters[0].NumShapeIdsUsed);
+ ClassicAssert.AreEqual(-1, dgRecord.LastMSOSPID);
+ ClassicAssert.AreEqual(0, dgRecord.NumShapes);
+ ClassicAssert.AreEqual(1, dm.Dgg.DrawingsSaved);
+ ClassicAssert.AreEqual(1, dm.Dgg.FileIdClusters.Length);
+ ClassicAssert.AreEqual(1, dm.Dgg.FileIdClusters[0].DrawingGroupId);
+ ClassicAssert.AreEqual(0, dm.Dgg.FileIdClusters[0].NumShapeIdsUsed);
}
[Test]
public void TestAllocateShapeId()
@@ -91,13 +91,13 @@ public void TestAllocateShapeId()
EscherDgRecord dg = dm.CreateDgRecord();
int shapeId = dm.AllocateShapeId(dg.DrawingGroupId);
- Assert.AreEqual(1024, shapeId);
- Assert.AreEqual(1025, dgg.ShapeIdMax);
- Assert.AreEqual(1, dgg.DrawingsSaved);
- Assert.AreEqual(1, dgg.FileIdClusters[0].DrawingGroupId);
- Assert.AreEqual(1, dgg.FileIdClusters[0].NumShapeIdsUsed);
- Assert.AreEqual(1024, dg.LastMSOSPID);
- Assert.AreEqual(1, dg.NumShapes);
+ ClassicAssert.AreEqual(1024, shapeId);
+ ClassicAssert.AreEqual(1025, dgg.ShapeIdMax);
+ ClassicAssert.AreEqual(1, dgg.DrawingsSaved);
+ ClassicAssert.AreEqual(1, dgg.FileIdClusters[0].DrawingGroupId);
+ ClassicAssert.AreEqual(1, dgg.FileIdClusters[0].NumShapeIdsUsed);
+ ClassicAssert.AreEqual(1024, dg.LastMSOSPID);
+ ClassicAssert.AreEqual(1, dg.NumShapes);
}
}
diff --git a/testcases/main/HSSF/Model/TestDrawingManager2.cs b/testcases/main/HSSF/Model/TestDrawingManager2.cs
index df012b18d..9e24bdb6f 100644
--- a/testcases/main/HSSF/Model/TestDrawingManager2.cs
+++ b/testcases/main/HSSF/Model/TestDrawingManager2.cs
@@ -19,7 +19,7 @@ namespace TestCases.HSSF.Model
using System;
using NPOI.DDF;
using NPOI.HSSF.Model;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
[TestFixture]
public class TestDrawingManager2
@@ -38,17 +38,17 @@ public void SetUp()
public void TestCreateDgRecord()
{
EscherDgRecord dgRecord1 = drawingManager2.CreateDgRecord();
- Assert.AreEqual(1, dgRecord1.DrawingGroupId);
- Assert.AreEqual(-1, dgRecord1.LastMSOSPID);
+ ClassicAssert.AreEqual(1, dgRecord1.DrawingGroupId);
+ ClassicAssert.AreEqual(-1, dgRecord1.LastMSOSPID);
EscherDgRecord dgRecord2 = drawingManager2.CreateDgRecord();
- Assert.AreEqual(2, dgRecord2.DrawingGroupId);
- Assert.AreEqual(-1, dgRecord2.LastMSOSPID);
+ ClassicAssert.AreEqual(2, dgRecord2.DrawingGroupId);
+ ClassicAssert.AreEqual(-1, dgRecord2.LastMSOSPID);
- Assert.AreEqual(2, dgg.DrawingsSaved);
- Assert.AreEqual(2, dgg.FileIdClusters.Length);
- Assert.AreEqual(3, dgg.NumIdClusters);
- Assert.AreEqual(0, dgg.NumShapesSaved);
+ ClassicAssert.AreEqual(2, dgg.DrawingsSaved);
+ ClassicAssert.AreEqual(2, dgg.FileIdClusters.Length);
+ ClassicAssert.AreEqual(3, dgg.NumIdClusters);
+ ClassicAssert.AreEqual(0, dgg.NumShapesSaved);
}
[Test]
public void TestAllocateShapeId()
@@ -56,30 +56,30 @@ public void TestAllocateShapeId()
EscherDgRecord dgRecord1 = drawingManager2.CreateDgRecord();
EscherDgRecord dgRecord2 = drawingManager2.CreateDgRecord();
- Assert.AreEqual(1024, drawingManager2.AllocateShapeId((short)1));
- Assert.AreEqual(1024, dgRecord1.LastMSOSPID);
- Assert.AreEqual(1025, dgg.ShapeIdMax);
- Assert.AreEqual(1025, drawingManager2.AllocateShapeId((short)1));
- Assert.AreEqual(1025, dgRecord1.LastMSOSPID);
- Assert.AreEqual(1026, dgg.ShapeIdMax);
- Assert.AreEqual(1026, drawingManager2.AllocateShapeId((short)1));
- Assert.AreEqual(1026, dgRecord1.LastMSOSPID);
- Assert.AreEqual(1027, dgg.ShapeIdMax);
- Assert.AreEqual(2048, drawingManager2.AllocateShapeId((short)2));
- Assert.AreEqual(2048, dgRecord2.LastMSOSPID);
- Assert.AreEqual(2049, dgg.ShapeIdMax);
+ ClassicAssert.AreEqual(1024, drawingManager2.AllocateShapeId((short)1));
+ ClassicAssert.AreEqual(1024, dgRecord1.LastMSOSPID);
+ ClassicAssert.AreEqual(1025, dgg.ShapeIdMax);
+ ClassicAssert.AreEqual(1025, drawingManager2.AllocateShapeId((short)1));
+ ClassicAssert.AreEqual(1025, dgRecord1.LastMSOSPID);
+ ClassicAssert.AreEqual(1026, dgg.ShapeIdMax);
+ ClassicAssert.AreEqual(1026, drawingManager2.AllocateShapeId((short)1));
+ ClassicAssert.AreEqual(1026, dgRecord1.LastMSOSPID);
+ ClassicAssert.AreEqual(1027, dgg.ShapeIdMax);
+ ClassicAssert.AreEqual(2048, drawingManager2.AllocateShapeId((short)2));
+ ClassicAssert.AreEqual(2048, dgRecord2.LastMSOSPID);
+ ClassicAssert.AreEqual(2049, dgg.ShapeIdMax);
for (int i = 0; i < 1021; i++)
{
drawingManager2.AllocateShapeId((short)1);
- Assert.AreEqual(2049, dgg.ShapeIdMax);
+ ClassicAssert.AreEqual(2049, dgg.ShapeIdMax);
}
- Assert.AreEqual(3072, drawingManager2.AllocateShapeId((short)1));
- Assert.AreEqual(3073, dgg.ShapeIdMax);
+ ClassicAssert.AreEqual(3072, drawingManager2.AllocateShapeId((short)1));
+ ClassicAssert.AreEqual(3073, dgg.ShapeIdMax);
- Assert.AreEqual(2, dgg.DrawingsSaved);
- Assert.AreEqual(4, dgg.NumIdClusters);
- Assert.AreEqual(1026, dgg.NumShapesSaved);
+ ClassicAssert.AreEqual(2, dgg.DrawingsSaved);
+ ClassicAssert.AreEqual(4, dgg.NumIdClusters);
+ ClassicAssert.AreEqual(1026, dgg.NumShapesSaved);
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/Model/TestDrawingShapes.cs b/testcases/main/HSSF/Model/TestDrawingShapes.cs
index 94212e48d..25e4fb3a8 100644
--- a/testcases/main/HSSF/Model/TestDrawingShapes.cs
+++ b/testcases/main/HSSF/Model/TestDrawingShapes.cs
@@ -19,7 +19,7 @@ limitations Under the License.
using NPOI.HSSF.UserModel;
using NPOI.SS.UserModel;
using NPOI.Util;
-using NUnit.Framework;
+using NUnit.Framework;using NUnit.Framework.Legacy;
using System;
using System.Collections.Generic;
using TestCases.HSSF.UserModel;
@@ -55,13 +55,13 @@ public void TestDrawingGroups()
HSSFWorkbook wb = HSSFTestDataSamples.OpenSampleWorkbook("drawings.xls");
HSSFSheet sheet = wb.GetSheet("groups") as HSSFSheet;
HSSFPatriarch patriarch = sheet.DrawingPatriarch as HSSFPatriarch;
- Assert.AreEqual(patriarch.Children.Count, 2);
+ ClassicAssert.AreEqual(patriarch.Children.Count, 2);
HSSFShapeGroup group = (HSSFShapeGroup)patriarch.Children[1];
- Assert.AreEqual(3, group.Children.Count);
+ ClassicAssert.AreEqual(3, group.Children.Count);
HSSFShapeGroup group1 = (HSSFShapeGroup)group.Children[0];
- Assert.AreEqual(2, group1.Children.Count);
+ ClassicAssert.AreEqual(2, group1.Children.Count);
group1 = (HSSFShapeGroup)group.Children[2];
- Assert.AreEqual(2, group1.Children.Count);
+ ClassicAssert.AreEqual(2, group1.Children.Count);
wb.Close();
}
@@ -70,29 +70,29 @@ public void TestHSSFShapeCompatibility()
{
HSSFSimpleShape shape = new HSSFSimpleShape(null, new HSSFClientAnchor());
shape.ShapeType=(HSSFSimpleShape.OBJECT_TYPE_LINE);
- Assert.AreEqual(0x08000040, shape.LineStyleColor);
- Assert.AreEqual(0x08000009, shape.FillColor);
- Assert.AreEqual(HSSFShape.LINEWIDTH_DEFAULT, shape.LineWidth);
- Assert.AreEqual(HSSFShape.LINESTYLE_SOLID, shape.LineStyle);
- Assert.IsFalse(shape.IsNoFill);
+ ClassicAssert.AreEqual(0x08000040, shape.LineStyleColor);
+ ClassicAssert.AreEqual(0x08000009, shape.FillColor);
+ ClassicAssert.AreEqual(HSSFShape.LINEWIDTH_DEFAULT, shape.LineWidth);
+ ClassicAssert.AreEqual(HSSFShape.LINESTYLE_SOLID, shape.LineStyle);
+ ClassicAssert.IsFalse(shape.IsNoFill);
EscherOptRecord opt = shape.GetOptRecord();
- Assert.AreEqual(7, opt.EscherProperties.Count);
- Assert.IsTrue(((EscherBoolProperty)opt.Lookup(EscherProperties.GROUPSHAPE__PRINT)).IsTrue);
- Assert.IsTrue(((EscherBoolProperty)opt.Lookup(EscherProperties.LINESTYLE__NOLINEDRAWDASH)).IsTrue);
- Assert.AreEqual(0x00000004, ((EscherSimpleProperty)opt.Lookup(EscherProperties.GEOMETRY__SHAPEPATH)).PropertyValue);
- Assert.IsNull(opt.Lookup(EscherProperties.TEXT__SIZE_TEXT_TO_FIT_SHAPE));
+ ClassicAssert.AreEqual(7, opt.EscherProperties.Count);
+ ClassicAssert.IsTrue(((EscherBoolProperty)opt.Lookup(EscherProperties.GROUPSHAPE__PRINT)).IsTrue);
+ ClassicAssert.IsTrue(((EscherBoolProperty)opt.Lookup(EscherProperties.LINESTYLE__NOLINEDRAWDASH)).IsTrue);
+ ClassicAssert.AreEqual(0x00000004, ((EscherSimpleProperty)opt.Lookup(EscherProperties.GEOMETRY__SHAPEPATH)).PropertyValue);
+ ClassicAssert.IsNull(opt.Lookup(EscherProperties.TEXT__SIZE_TEXT_TO_FIT_SHAPE));
}
public void TestDefaultPictureSettings()
{
HSSFPicture picture = new HSSFPicture(null, new HSSFClientAnchor());
- Assert.AreEqual(picture.LineWidth, HSSFShape.LINEWIDTH_DEFAULT);
- Assert.AreEqual(picture.FillColor, HSSFShape.FILL__FILLCOLOR_DEFAULT);
- Assert.AreEqual(picture.LineStyle, HSSFShape.LINESTYLE_NONE);
- Assert.AreEqual(picture.LineStyleColor, HSSFShape.LINESTYLE__COLOR_DEFAULT);
- Assert.IsFalse(picture.IsNoFill);
- Assert.AreEqual(picture.PictureIndex, -1);//not Set yet
+ ClassicAssert.AreEqual(picture.LineWidth, HSSFShape.LINEWIDTH_DEFAULT);
+ ClassicAssert.AreEqual(picture.FillColor, HSSFShape.FILL__FILLCOLOR_DEFAULT);
+ ClassicAssert.AreEqual(picture.LineStyle, HSSFShape.LINESTYLE_NONE);
+ ClassicAssert.AreEqual(picture.LineStyleColor, HSSFShape.LINESTYLE__COLOR_DEFAULT);
+ ClassicAssert.IsFalse(picture.IsNoFill);
+ ClassicAssert.AreEqual(picture.PictureIndex, -1);//not Set yet
}
/**
@@ -110,12 +110,12 @@ public void TestDefaultSettingsWithEmptyContainer()
obj.AddSubRecord(cod);
HSSFPicture picture = new HSSFPicture(Container, obj);
- Assert.AreEqual(picture.LineWidth, HSSFShape.LINEWIDTH_DEFAULT);
- Assert.AreEqual(picture.FillColor, HSSFShape.FILL__FILLCOLOR_DEFAULT);
- Assert.AreEqual(picture.LineStyle, HSSFShape.LINESTYLE_DEFAULT);
- Assert.AreEqual(picture.LineStyleColor, HSSFShape.LINESTYLE__COLOR_DEFAULT);
- Assert.AreEqual(picture.IsNoFill, HSSFShape.NO_FILL_DEFAULT);
- Assert.AreEqual(picture.PictureIndex, -1);//not Set yet
+ ClassicAssert.AreEqual(picture.LineWidth, HSSFShape.LINEWIDTH_DEFAULT);
+ ClassicAssert.AreEqual(picture.FillColor, HSSFShape.FILL__FILLCOLOR_DEFAULT);
+ ClassicAssert.AreEqual(picture.LineStyle, HSSFShape.LINESTYLE_DEFAULT);
+ ClassicAssert.AreEqual(picture.LineStyleColor, HSSFShape.LINESTYLE__COLOR_DEFAULT);
+ ClassicAssert.AreEqual(picture.IsNoFill, HSSFShape.NO_FILL_DEFAULT);
+ ClassicAssert.AreEqual(picture.PictureIndex, -1);//not Set yet
}
/**
@@ -130,58 +130,58 @@ public void TestReadWriteRectangle()
HSSFPatriarch drawing = sheet.CreateDrawingPatriarch() as HSSFPatriarch;
HSSFClientAnchor anchor = new HSSFClientAnchor(10, 10, 50, 50, (short)2, 2, (short)4, 4);
anchor.AnchorType = AnchorType.MoveDontResize;
- Assert.AreEqual(AnchorType.MoveDontResize, anchor.AnchorType);
+ ClassicAssert.AreEqual(AnchorType.MoveDontResize, anchor.AnchorType);
//noinspection deprecation
//anchor.AnchorType = (AnchorType.MoveDontResize.value);
- //Assert.AreEqual(AnchorType.MoveDontResize, anchor.AnchorType);
+ //ClassicAssert.AreEqual(AnchorType.MoveDontResize, anchor.AnchorType);
HSSFSimpleShape rectangle = drawing.CreateSimpleShape(anchor);
rectangle.ShapeType=(HSSFSimpleShape.OBJECT_TYPE_RECTANGLE);
rectangle.LineWidth=(10000);
rectangle.FillColor=(777);
- Assert.AreEqual(rectangle.FillColor, 777);
- Assert.AreEqual(10000, rectangle.LineWidth);
+ ClassicAssert.AreEqual(rectangle.FillColor, 777);
+ ClassicAssert.AreEqual(10000, rectangle.LineWidth);
rectangle.LineStyle= (LineStyle)(10);
- Assert.AreEqual(10, rectangle.LineStyle);
- Assert.AreEqual(rectangle.WrapText, HSSFSimpleShape.WRAP_SQUARE);
+ ClassicAssert.AreEqual(10, rectangle.LineStyle);
+ ClassicAssert.AreEqual(rectangle.WrapText, HSSFSimpleShape.WRAP_SQUARE);
rectangle.LineStyleColor=(1111);
rectangle.IsNoFill=(true);
rectangle.WrapText=(HSSFSimpleShape.WRAP_NONE);
rectangle.String=(new HSSFRichTextString("teeeest"));
- Assert.AreEqual(rectangle.LineStyleColor, 1111);
- //Assert.AreEqual(((EscherSimpleProperty)((EscherOptRecord)HSSFTestHelper.GetEscherContainer(rectangle).GetChildById(EscherOptRecord.RECORD_ID))
+ ClassicAssert.AreEqual(rectangle.LineStyleColor, 1111);
+ //ClassicAssert.AreEqual(((EscherSimpleProperty)((EscherOptRecord)HSSFTestHelper.GetEscherContainer(rectangle).GetChildById(EscherOptRecord.RECORD_ID))
// .Lookup(EscherProperties.TEXT__TEXTID)).PropertyValue, "teeeest".GetHashCode());
EscherContainerRecord escherContainer = HSSFTestHelper.GetEscherContainer(rectangle);
- Assert.IsNotNull(escherContainer);
+ ClassicAssert.IsNotNull(escherContainer);
EscherRecord childById = escherContainer.GetChildById(EscherOptRecord.RECORD_ID);
- Assert.IsNotNull(childById);
+ ClassicAssert.IsNotNull(childById);
EscherProperty lookup = ((EscherOptRecord)childById).Lookup(EscherProperties.TEXT__TEXTID);
- Assert.IsNotNull(lookup);
- Assert.AreEqual("teeeest".GetHashCode(), ((EscherSimpleProperty)lookup).PropertyValue);
+ ClassicAssert.IsNotNull(lookup);
+ ClassicAssert.AreEqual("teeeest".GetHashCode(), ((EscherSimpleProperty)lookup).PropertyValue);
- Assert.AreEqual(rectangle.IsNoFill, true);
- Assert.AreEqual(rectangle.WrapText, HSSFSimpleShape.WRAP_NONE);
- Assert.AreEqual(rectangle.String.String, "teeeest");
+ ClassicAssert.AreEqual(rectangle.IsNoFill, true);
+ ClassicAssert.AreEqual(rectangle.WrapText, HSSFSimpleShape.WRAP_NONE);
+ ClassicAssert.AreEqual(rectangle.String.String, "teeeest");
HSSFWorkbook wb2 = HSSFTestDataSamples.WriteOutAndReadBack(wb1);
wb1.Close();
sheet = wb2.GetSheetAt(0) as HSSFSheet;
drawing = sheet.DrawingPatriarch as HSSFPatriarch;
- Assert.AreEqual(1, drawing.Children.Count);
+ ClassicAssert.AreEqual(1, drawing.Children.Count);
HSSFSimpleShape rectangle2 =
(HSSFSimpleShape)drawing.Children[0];
- Assert.AreEqual(HSSFSimpleShape.OBJECT_TYPE_RECTANGLE,
+ ClassicAssert.AreEqual(HSSFSimpleShape.OBJECT_TYPE_RECTANGLE,
rectangle2.ShapeType);
- Assert.AreEqual(10000, rectangle2.LineWidth);
- Assert.AreEqual(10, (int)rectangle2.LineStyle);
- Assert.AreEqual(anchor, rectangle2.Anchor);
- Assert.AreEqual(rectangle2.LineStyleColor, 1111);
- Assert.AreEqual(rectangle2.FillColor, 777);
- Assert.AreEqual(rectangle2.IsNoFill, true);
- Assert.AreEqual(rectangle2.String.String, "teeeest");
- Assert.AreEqual(rectangle.WrapText, HSSFSimpleShape.WRAP_NONE);
+ ClassicAssert.AreEqual(10000, rectangle2.LineWidth);
+ ClassicAssert.AreEqual(10, (int)rectangle2.LineStyle);
+ ClassicAssert.AreEqual(anchor, rectangle2.Anchor);
+ ClassicAssert.AreEqual(rectangle2.LineStyleColor, 1111);
+ ClassicAssert.AreEqual(rectangle2.FillColor, 777);
+ ClassicAssert.AreEqual(rectangle2.IsNoFill, true);
+ ClassicAssert.AreEqual(rectangle2.String.String, "teeeest");
+ ClassicAssert.AreEqual(rectangle.WrapText, HSSFSimpleShape.WRAP_NONE);
rectangle2.FillColor=(3333);
rectangle2.LineStyle = (LineStyle)(9);
@@ -199,20 +199,20 @@ public void TestReadWriteRectangle()
wb2.Close();
sheet = wb3.GetSheetAt(0) as HSSFSheet;
drawing = sheet.DrawingPatriarch as HSSFPatriarch;
- Assert.AreEqual(1, drawing.Children.Count);
+ ClassicAssert.AreEqual(1, drawing.Children.Count);
rectangle2 = (HSSFSimpleShape)drawing.Children[0];
- Assert.AreEqual(HSSFSimpleShape.OBJECT_TYPE_RECTANGLE, rectangle2.ShapeType);
- Assert.AreEqual(rectangle.WrapText, HSSFSimpleShape.WRAP_BY_POINTS);
- Assert.AreEqual(77, rectangle2.LineWidth);
- Assert.AreEqual(9, rectangle2.LineStyle);
- Assert.AreEqual(rectangle2.LineStyleColor, 4444);
- Assert.AreEqual(rectangle2.FillColor, 3333);
- Assert.AreEqual(rectangle2.Anchor.Dx1, 2);
- Assert.AreEqual(rectangle2.Anchor.Dx2, 3);
- Assert.AreEqual(rectangle2.Anchor.Dy1, 4);
- Assert.AreEqual(rectangle2.Anchor.Dy2, 5);
- Assert.AreEqual(rectangle2.IsNoFill, false);
- Assert.AreEqual(rectangle2.String.String, "test22");
+ ClassicAssert.AreEqual(HSSFSimpleShape.OBJECT_TYPE_RECTANGLE, rectangle2.ShapeType);
+ ClassicAssert.AreEqual(rectangle.WrapText, HSSFSimpleShape.WRAP_BY_POINTS);
+ ClassicAssert.AreEqual(77, rectangle2.LineWidth);
+ ClassicAssert.AreEqual(9, rectangle2.LineStyle);
+ ClassicAssert.AreEqual(rectangle2.LineStyleColor, 4444);
+ ClassicAssert.AreEqual(rectangle2.FillColor, 3333);
+ ClassicAssert.AreEqual(rectangle2.Anchor.Dx1, 2);
+ ClassicAssert.AreEqual(rectangle2.Anchor.Dx2, 3);
+ ClassicAssert.AreEqual(rectangle2.Anchor.Dy1, 4);
+ ClassicAssert.AreEqual(rectangle2.Anchor.Dy2, 5);
+ ClassicAssert.AreEqual(rectangle2.IsNoFill, false);
+ ClassicAssert.AreEqual(rectangle2.String.String, "test22");
HSSFSimpleShape rect3 = drawing.CreateSimpleShape(new HSSFClientAnchor());
rect3.ShapeType=(HSSFSimpleShape.OBJECT_TYPE_RECTANGLE);
@@ -220,7 +220,7 @@ public void TestReadWriteRectangle()
wb3.Close();
drawing = (wb4.GetSheetAt(0) as HSSFSheet).DrawingPatriarch as HSSFPatriarch;
- Assert.AreEqual(drawing.Children.Count, 2);
+ ClassicAssert.AreEqual(drawing.Children.Count, 2);
wb4.Close();
}
@@ -229,18 +229,18 @@ public void TestReadExistingImage()
HSSFWorkbook wb = HSSFTestDataSamples.OpenSampleWorkbook("drawings.xls");
HSSFSheet sheet = wb.GetSheet("pictures") as HSSFSheet;
HSSFPatriarch Drawing = sheet.DrawingPatriarch as HSSFPatriarch;
- Assert.AreEqual(1, Drawing.Children.Count);
+ ClassicAssert.AreEqual(1, Drawing.Children.Count);
HSSFPicture picture = (HSSFPicture)Drawing.Children[0];
- Assert.AreEqual(picture.PictureIndex, 2);
- Assert.AreEqual(picture.LineStyleColor, HSSFShape.LINESTYLE__COLOR_DEFAULT);
- Assert.AreEqual(picture.FillColor, 0x5DC943);
- Assert.AreEqual(picture.LineWidth, HSSFShape.LINEWIDTH_DEFAULT);
- Assert.AreEqual(picture.LineStyle, HSSFShape.LINESTYLE_DEFAULT);
- Assert.AreEqual(picture.IsNoFill, false);
+ ClassicAssert.AreEqual(picture.PictureIndex, 2);
+ ClassicAssert.AreEqual(picture.LineStyleColor, HSSFShape.LINESTYLE__COLOR_DEFAULT);
+ ClassicAssert.AreEqual(picture.FillColor, 0x5DC943);
+ ClassicAssert.AreEqual(picture.LineWidth, HSSFShape.LINEWIDTH_DEFAULT);
+ ClassicAssert.AreEqual(picture.LineStyle, HSSFShape.LINESTYLE_DEFAULT);
+ ClassicAssert.AreEqual(picture.IsNoFill, false);
picture.PictureIndex=(2);
- Assert.AreEqual(picture.PictureIndex, 2);
+ ClassicAssert.AreEqual(picture.PictureIndex, 2);
wb.Close();
}
@@ -253,16 +253,16 @@ public void TestReadExistingRectangle()
HSSFWorkbook wb = HSSFTestDataSamples.OpenSampleWorkbook("drawings.xls");
HSSFSheet sheet = wb.GetSheet("rectangles") as HSSFSheet;
HSSFPatriarch Drawing = sheet.DrawingPatriarch as HSSFPatriarch;
- Assert.AreEqual(1, Drawing.Children.Count);
+ ClassicAssert.AreEqual(1, Drawing.Children.Count);
HSSFSimpleShape shape = (HSSFSimpleShape)Drawing.Children[0];
- Assert.AreEqual(shape.IsNoFill, false);
- Assert.AreEqual((int)shape.LineStyle, HSSFShape.LINESTYLE_DASHDOTGEL);
- Assert.AreEqual(shape.LineStyleColor, 0x616161);
- Assert.AreEqual(shape.FillColor, 0x2CE03D, HexDump.ToHex(shape.FillColor));
- Assert.AreEqual(shape.LineWidth, HSSFShape.LINEWIDTH_ONE_PT * 2);
- Assert.AreEqual(shape.String.String, "POItest");
- Assert.AreEqual(shape.RotationDegree, 27);
+ ClassicAssert.AreEqual(shape.IsNoFill, false);
+ ClassicAssert.AreEqual((int)shape.LineStyle, HSSFShape.LINESTYLE_DASHDOTGEL);
+ ClassicAssert.AreEqual(shape.LineStyleColor, 0x616161);
+ ClassicAssert.AreEqual(shape.FillColor, 0x2CE03D, HexDump.ToHex(shape.FillColor));
+ ClassicAssert.AreEqual(shape.LineWidth, HSSFShape.LINEWIDTH_ONE_PT * 2);
+ ClassicAssert.AreEqual(shape.String.String, "POItest");
+ ClassicAssert.AreEqual(shape.RotationDegree, 27);
wb.Close();
}
[Test]
@@ -286,25 +286,25 @@ public void TestShapeIds()
// last shape ID cached in EscherDgRecord
EscherDgRecord dg1 =
agg1.GetEscherContainer().GetChildById(EscherDgRecord.RECORD_ID) as EscherDgRecord;
- Assert.AreEqual(1026, dg1.LastMSOSPID);
+ ClassicAssert.AreEqual(1026, dg1.LastMSOSPID);
// iterate over shapes and check shapeId
EscherContainerRecord spgrContainer =
agg1.GetEscherContainer().ChildContainers[0] as EscherContainerRecord;
// root spContainer + 2 spContainers for shapes
- Assert.AreEqual(3, spgrContainer.ChildRecords.Count);
+ ClassicAssert.AreEqual(3, spgrContainer.ChildRecords.Count);
EscherSpRecord sp0 =
((EscherContainerRecord)spgrContainer.GetChild(0)).GetChildById(EscherSpRecord.RECORD_ID) as EscherSpRecord;
- Assert.AreEqual(1024, sp0.ShapeId);
+ ClassicAssert.AreEqual(1024, sp0.ShapeId);
EscherSpRecord sp1 =
((EscherContainerRecord)spgrContainer.GetChild(1)).GetChildById(EscherSpRecord.RECORD_ID) as EscherSpRecord;
- Assert.AreEqual(1025, sp1.ShapeId);
+ ClassicAssert.AreEqual(1025, sp1.ShapeId);
EscherSpRecord sp2 =
((EscherContainerRecord)spgrContainer.GetChild(2)).GetChildById(EscherSpRecord.RECORD_ID) as EscherSpRecord;
- Assert.AreEqual(1026, sp2.ShapeId);
+ ClassicAssert.AreEqual(1026, sp2.ShapeId);
wb2.Close();
}
@@ -323,9 +323,9 @@ public void TestAllocateNewIds()
* 2048 - main SpContainer id
* 2049 - existing shape id
*/
- Assert.AreEqual(HSSFTestHelper.AllocateNewShapeId(patriarch), 2050);
- Assert.AreEqual(HSSFTestHelper.AllocateNewShapeId(patriarch), 2051);
- Assert.AreEqual(HSSFTestHelper.AllocateNewShapeId(patriarch), 2052);
+ ClassicAssert.AreEqual(HSSFTestHelper.AllocateNewShapeId(patriarch), 2050);
+ ClassicAssert.AreEqual(HSSFTestHelper.AllocateNewShapeId(patriarch), 2051);
+ ClassicAssert.AreEqual(HSSFTestHelper.AllocateNewShapeId(patriarch), 2052);
sheet = wb.GetSheetAt(1) as HSSFSheet;
patriarch = sheet.DrawingPatriarch as HSSFPatriarch;
@@ -334,17 +334,17 @@ public void TestAllocateNewIds()
* 3072 - main SpContainer id
* 3073 - existing shape id
*/
- Assert.AreEqual(HSSFTestHelper.AllocateNewShapeId(patriarch), 3074);
- Assert.AreEqual(HSSFTestHelper.AllocateNewShapeId(patriarch), 3075);
- Assert.AreEqual(HSSFTestHelper.AllocateNewShapeId(patriarch), 3076);
+ ClassicAssert.AreEqual(HSSFTestHelper.AllocateNewShapeId(patriarch), 3074);
+ ClassicAssert.AreEqual(HSSFTestHelper.AllocateNewShapeId(patriarch), 3075);
+ ClassicAssert.AreEqual(HSSFTestHelper.AllocateNewShapeId(patriarch), 3076);
sheet = wb.GetSheetAt(2) as HSSFSheet;
patriarch = sheet.DrawingPatriarch as HSSFPatriarch;
- Assert.AreEqual(HSSFTestHelper.AllocateNewShapeId(patriarch), 1026);
- Assert.AreEqual(HSSFTestHelper.AllocateNewShapeId(patriarch), 1027);
- Assert.AreEqual(HSSFTestHelper.AllocateNewShapeId(patriarch), 1028);
+ ClassicAssert.AreEqual(HSSFTestHelper.AllocateNewShapeId(patriarch), 1026);
+ ClassicAssert.AreEqual(HSSFTestHelper.AllocateNewShapeId(patriarch), 1027);
+ ClassicAssert.AreEqual(HSSFTestHelper.AllocateNewShapeId(patriarch), 1028);
wb.Close();
}
[Test]
@@ -358,7 +358,7 @@ public void TestOpt() {
HSSFTextbox textbox = patriarch.CreateTextbox(new HSSFClientAnchor()) as HSSFTextbox;
EscherOptRecord opt1 = HSSFTestHelper.GetOptRecord(textbox);
EscherOptRecord opt2 = HSSFTestHelper.GetEscherContainer(textbox).GetChildById(EscherOptRecord.RECORD_ID) as EscherOptRecord;
- Assert.AreSame(opt1, opt2);
+ ClassicAssert.AreSame(opt1, opt2);
wb.Close();
}
[Test]
@@ -376,13 +376,13 @@ public void TestCorrectOrderInOptRecord()
textbox.FillColor = textbox.FillColor;
EscherContainerRecord Container = HSSFTestHelper.GetEscherContainer(textbox);
EscherOptRecord optRecord = Container.GetChildById(EscherOptRecord.RECORD_ID) as EscherOptRecord;
- Assert.AreEqual(opt1Str, optRecord.ToXml());
+ ClassicAssert.AreEqual(opt1Str, optRecord.ToXml());
textbox.LineStyle = textbox.LineStyle;
- Assert.AreEqual(opt1Str, optRecord.ToXml());
+ ClassicAssert.AreEqual(opt1Str, optRecord.ToXml());
textbox.LineWidth = textbox.LineWidth;
- Assert.AreEqual(opt1Str, optRecord.ToXml());
+ ClassicAssert.AreEqual(opt1Str, optRecord.ToXml());
textbox.LineStyleColor = textbox.LineStyleColor;
- Assert.AreEqual(opt1Str, optRecord.ToXml());
+ ClassicAssert.AreEqual(opt1Str, optRecord.ToXml());
wb.Close();
}
@@ -395,7 +395,7 @@ public void TestDgRecordNumShapes()
EscherAggregate aggregate = HSSFTestHelper.GetEscherAggregate(patriarch);
EscherDgRecord dgRecord = (EscherDgRecord)aggregate.GetEscherRecord(0).GetChild(0) as EscherDgRecord;
- Assert.AreEqual(dgRecord.NumShapes, 1);
+ ClassicAssert.AreEqual(dgRecord.NumShapes, 1);
wb.Close();
}
@@ -410,7 +410,7 @@ public void TestTextForSimpleShape()
shape.ShapeType = HSSFSimpleShape.OBJECT_TYPE_RECTANGLE;
EscherAggregate agg = HSSFTestHelper.GetEscherAggregate(patriarch);
- Assert.AreEqual(agg.GetShapeToObjMapping().Count, 2);
+ ClassicAssert.AreEqual(agg.GetShapeToObjMapping().Count, 2);
HSSFWorkbook wb2 = HSSFTestDataSamples.WriteOutAndReadBack(wb1);
wb1.Close();
@@ -420,13 +420,13 @@ public void TestTextForSimpleShape()
shape = (HSSFSimpleShape)patriarch.Children[0];
agg = HSSFTestHelper.GetEscherAggregate(patriarch);
- Assert.AreEqual(agg.GetShapeToObjMapping().Count, 2);
+ ClassicAssert.AreEqual(agg.GetShapeToObjMapping().Count, 2);
shape.String = new HSSFRichTextString("string1");
- Assert.AreEqual(shape.String.String, "string1");
+ ClassicAssert.AreEqual(shape.String.String, "string1");
- Assert.IsNotNull(HSSFTestHelper.GetEscherContainer(shape).GetChildById(EscherTextboxRecord.RECORD_ID));
- Assert.AreEqual(agg.GetShapeToObjMapping().Count, 2);
+ ClassicAssert.IsNotNull(HSSFTestHelper.GetEscherContainer(shape).GetChildById(EscherTextboxRecord.RECORD_ID));
+ ClassicAssert.AreEqual(agg.GetShapeToObjMapping().Count, 2);
HSSFWorkbook wb3 = HSSFTestDataSamples.WriteOutAndReadBack(wb2);
wb2.Close();
@@ -439,10 +439,10 @@ public void TestTextForSimpleShape()
shape = (HSSFSimpleShape)patriarch.Children[0];
- Assert.IsNotNull(HSSFTestHelper.GetTextObjRecord(shape));
- Assert.AreEqual(shape.String.String, "string1");
- Assert.IsNotNull(HSSFTestHelper.GetEscherContainer(shape).GetChildById(EscherTextboxRecord.RECORD_ID));
- Assert.AreEqual(agg.GetShapeToObjMapping().Count, 2);
+ ClassicAssert.IsNotNull(HSSFTestHelper.GetTextObjRecord(shape));
+ ClassicAssert.AreEqual(shape.String.String, "string1");
+ ClassicAssert.IsNotNull(HSSFTestHelper.GetEscherContainer(shape).GetChildById(EscherTextboxRecord.RECORD_ID));
+ ClassicAssert.AreEqual(agg.GetShapeToObjMapping().Count, 2);
wb4.Close();
}
@@ -470,130 +470,130 @@ public void TestRemoveShapes()
group.CreateTextbox(new HSSFChildAnchor());
group.CreatePicture(new HSSFChildAnchor(), idx);
- Assert.AreEqual(patriarch.Children.Count, 6);
- Assert.AreEqual(group.Children.Count, 2);
+ ClassicAssert.AreEqual(patriarch.Children.Count, 6);
+ ClassicAssert.AreEqual(group.Children.Count, 2);
- Assert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).GetShapeToObjMapping().Count, 12);
- Assert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).TailRecords.Count, 1);
+ ClassicAssert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).GetShapeToObjMapping().Count, 12);
+ ClassicAssert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).TailRecords.Count, 1);
HSSFWorkbook wb2 = HSSFTestDataSamples.WriteOutAndReadBack(wb1);
wb1.Close();
sheet = wb2.GetSheetAt(0) as HSSFSheet;
patriarch = sheet.DrawingPatriarch as HSSFPatriarch;
- Assert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).GetShapeToObjMapping().Count, 12);
- Assert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).TailRecords.Count, 1);
+ ClassicAssert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).GetShapeToObjMapping().Count, 12);
+ ClassicAssert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).TailRecords.Count, 1);
- Assert.AreEqual(patriarch.Children.Count, 6);
+ ClassicAssert.AreEqual(patriarch.Children.Count, 6);
group = (HSSFShapeGroup)patriarch.Children[5];
group.RemoveShape(group.Children[0]);
- Assert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).GetShapeToObjMapping().Count, 10);
- Assert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).TailRecords.Count, 1);
+ ClassicAssert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).GetShapeToObjMapping().Count, 10);
+ ClassicAssert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).TailRecords.Count, 1);
HSSFWorkbook wb3 = HSSFTestDataSamples.WriteOutAndReadBack(wb2);
wb2.Close();
sheet = wb3.GetSheetAt(0) as HSSFSheet;
patriarch = sheet.DrawingPatriarch as HSSFPatriarch;
- Assert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).GetShapeToObjMapping().Count, 10);
- Assert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).TailRecords.Count, 1);
+ ClassicAssert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).GetShapeToObjMapping().Count, 10);
+ ClassicAssert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).TailRecords.Count, 1);
group = (HSSFShapeGroup)patriarch.Children[(5)];
patriarch.RemoveShape(group);
- Assert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).GetShapeToObjMapping().Count, 8);
- Assert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).TailRecords.Count, 1);
+ ClassicAssert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).GetShapeToObjMapping().Count, 8);
+ ClassicAssert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).TailRecords.Count, 1);
HSSFWorkbook wb4 = HSSFTestDataSamples.WriteOutAndReadBack(wb3);
wb3.Close();
sheet = wb4.GetSheetAt(0) as HSSFSheet;
patriarch = sheet.DrawingPatriarch as HSSFPatriarch;
- Assert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).GetShapeToObjMapping().Count, 8);
- Assert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).TailRecords.Count, 1);
- Assert.AreEqual(patriarch.Children.Count, 5);
+ ClassicAssert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).GetShapeToObjMapping().Count, 8);
+ ClassicAssert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).TailRecords.Count, 1);
+ ClassicAssert.AreEqual(patriarch.Children.Count, 5);
HSSFShape shape = patriarch.Children[0];
patriarch.RemoveShape(shape);
- Assert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).GetShapeToObjMapping().Count, 6);
- Assert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).TailRecords.Count, 1);
- Assert.AreEqual(patriarch.Children.Count, 4);
+ ClassicAssert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).GetShapeToObjMapping().Count, 6);
+ ClassicAssert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).TailRecords.Count, 1);
+ ClassicAssert.AreEqual(patriarch.Children.Count, 4);
HSSFWorkbook wb5 = HSSFTestDataSamples.WriteOutAndReadBack(wb4);
wb4.Close();
sheet = wb5.GetSheetAt(0) as HSSFSheet;
patriarch = sheet.DrawingPatriarch as HSSFPatriarch;
- Assert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).GetShapeToObjMapping().Count, 6);
- Assert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).TailRecords.Count, 1);
- Assert.AreEqual(patriarch.Children.Count, 4);
+ ClassicAssert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).GetShapeToObjMapping().Count, 6);
+ ClassicAssert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).TailRecords.Count, 1);
+ ClassicAssert.AreEqual(patriarch.Children.Count, 4);
HSSFPicture picture = (HSSFPicture)patriarch.Children[0];
patriarch.RemoveShape(picture);
- Assert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).GetShapeToObjMapping().Count, 5);
- Assert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).TailRecords.Count, 1);
- Assert.AreEqual(patriarch.Children.Count, 3);
+ ClassicAssert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).GetShapeToObjMapping().Count, 5);
+ ClassicAssert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).TailRecords.Count, 1);
+ ClassicAssert.AreEqual(patriarch.Children.Count, 3);
HSSFWorkbook wb6 = HSSFTestDataSamples.WriteOutAndReadBack(wb5);
wb5.Close();
sheet = wb6.GetSheetAt(0) as HSSFSheet;
patriarch = sheet.DrawingPatriarch as HSSFPatriarch;
- Assert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).GetShapeToObjMapping().Count, 5);
- Assert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).TailRecords.Count, 1);
- Assert.AreEqual(patriarch.Children.Count, 3);
+ ClassicAssert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).GetShapeToObjMapping().Count, 5);
+ ClassicAssert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).TailRecords.Count, 1);
+ ClassicAssert.AreEqual(patriarch.Children.Count, 3);
HSSFComment comment = (HSSFComment)patriarch.Children[0];
patriarch.RemoveShape(comment);
- Assert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).GetShapeToObjMapping().Count, 3);
- Assert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).TailRecords.Count, 0);
- Assert.AreEqual(patriarch.Children.Count, 2);
+ ClassicAssert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).GetShapeToObjMapping().Count, 3);
+ ClassicAssert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).TailRecords.Count, 0);
+ ClassicAssert.AreEqual(patriarch.Children.Count, 2);
HSSFWorkbook wb7 = HSSFTestDataSamples.WriteOutAndReadBack(wb6);
wb6.Close();
sheet = wb7.GetSheetAt(0) as HSSFSheet;
patriarch = sheet.DrawingPatriarch as HSSFPatriarch;
- Assert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).GetShapeToObjMapping().Count, 3);
- Assert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).TailRecords.Count, 0);
- Assert.AreEqual(patriarch.Children.Count, 2);
+ ClassicAssert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).GetShapeToObjMapping().Count, 3);
+ ClassicAssert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).TailRecords.Count, 0);
+ ClassicAssert.AreEqual(patriarch.Children.Count, 2);
polygon = (HSSFPolygon)patriarch.Children[0];
patriarch.RemoveShape(polygon);
- Assert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).GetShapeToObjMapping().Count, 2);
- Assert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).TailRecords.Count, 0);
- Assert.AreEqual(patriarch.Children.Count, 1);
+ ClassicAssert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).GetShapeToObjMapping().Count, 2);
+ ClassicAssert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).TailRecords.Count, 0);
+ ClassicAssert.AreEqual(patriarch.Children.Count, 1);
HSSFWorkbook wb8 = HSSFTestDataSamples.WriteOutAndReadBack(wb7);
wb7.Close();
sheet = wb8.GetSheetAt(0) as HSSFSheet;
patriarch = sheet.DrawingPatriarch as HSSFPatriarch;
- Assert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).GetShapeToObjMapping().Count, 2);
- Assert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).TailRecords.Count, 0);
- Assert.AreEqual(patriarch.Children.Count, 1);
+ ClassicAssert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).GetShapeToObjMapping().Count, 2);
+ ClassicAssert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).TailRecords.Count, 0);
+ ClassicAssert.AreEqual(patriarch.Children.Count, 1);
HSSFTextbox textbox = (HSSFTextbox)patriarch.Children[0];
patriarch.RemoveShape(textbox);
- Assert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).GetShapeToObjMapping().Count, 0);
- Assert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).TailRecords.Count, 0);
- Assert.AreEqual(patriarch.Children.Count, 0);
+ ClassicAssert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).GetShapeToObjMapping().Count, 0);
+ ClassicAssert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).TailRecords.Count, 0);
+ ClassicAssert.AreEqual(patriarch.Children.Count, 0);
HSSFWorkbook wb9 = HSSFTestDataSamples.WriteOutAndReadBack(wb8);
wb8.Close();
sheet = wb9.GetSheetAt(0) as HSSFSheet;
patriarch = sheet.DrawingPatriarch as HSSFPatriarch;
- Assert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).GetShapeToObjMapping().Count, 0);
- Assert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).TailRecords.Count, 0);
- Assert.AreEqual(patriarch.Children.Count, 0);
+ ClassicAssert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).GetShapeToObjMapping().Count, 0);
+ ClassicAssert.AreEqual(HSSFTestHelper.GetEscherAggregate(patriarch).TailRecords.Count, 0);
+ ClassicAssert.AreEqual(patriarch.Children.Count, 0);
wb9.Close();
}
@@ -607,13 +607,13 @@ public void TestShapeFlip()
HSSFSimpleShape rectangle = patriarch.CreateSimpleShape(new HSSFClientAnchor());
rectangle.ShapeType = HSSFSimpleShape.OBJECT_TYPE_RECTANGLE;
- Assert.AreEqual(rectangle.IsFlipVertical, false);
- Assert.AreEqual(rectangle.IsFlipHorizontal, false);
+ ClassicAssert.AreEqual(rectangle.IsFlipVertical, false);
+ ClassicAssert.AreEqual(rectangle.IsFlipHorizontal, false);
rectangle.IsFlipVertical = true;
- Assert.AreEqual(rectangle.IsFlipVertical, true);
+ ClassicAssert.AreEqual(rectangle.IsFlipVertical, true);
rectangle.IsFlipHorizontal = true;
- Assert.AreEqual(rectangle.IsFlipHorizontal, true);
+ ClassicAssert.AreEqual(rectangle.IsFlipHorizontal, true);
HSSFWorkbook wb2 = HSSFTestDataSamples.WriteOutAndReadBack(wb1);
wb1.Close();
@@ -622,13 +622,13 @@ public void TestShapeFlip()
rectangle = (HSSFSimpleShape)patriarch.Children[0];
- Assert.AreEqual(rectangle.IsFlipHorizontal, true);
+ ClassicAssert.AreEqual(rectangle.IsFlipHorizontal, true);
rectangle.IsFlipHorizontal = false;
- Assert.AreEqual(rectangle.IsFlipHorizontal, false);
+ ClassicAssert.AreEqual(rectangle.IsFlipHorizontal, false);
- Assert.AreEqual(rectangle.IsFlipVertical, true);
+ ClassicAssert.AreEqual(rectangle.IsFlipVertical, true);
rectangle.IsFlipVertical = false;
- Assert.AreEqual(rectangle.IsFlipVertical, false);
+ ClassicAssert.AreEqual(rectangle.IsFlipVertical, false);
HSSFWorkbook wb3 = HSSFTestDataSamples.WriteOutAndReadBack(wb2);
wb2.Close();
@@ -637,8 +637,8 @@ public void TestShapeFlip()
rectangle = (HSSFSimpleShape)patriarch.Children[0];
- Assert.AreEqual(rectangle.IsFlipVertical, false);
- Assert.AreEqual(rectangle.IsFlipHorizontal, false);
+ ClassicAssert.AreEqual(rectangle.IsFlipVertical, false);
+ ClassicAssert.AreEqual(rectangle.IsFlipHorizontal, false);
wb3.Close();
}
@@ -652,9 +652,9 @@ public void TestRotation()
HSSFSimpleShape rectangle = patriarch.CreateSimpleShape(new HSSFClientAnchor(0, 0, 100, 100, (short)0, 0, (short)5, 5));
rectangle.ShapeType = HSSFSimpleShape.OBJECT_TYPE_RECTANGLE;
- Assert.AreEqual(rectangle.RotationDegree, 0);
+ ClassicAssert.AreEqual(rectangle.RotationDegree, 0);
rectangle.RotationDegree = (short)45;
- Assert.AreEqual(rectangle.RotationDegree, 45);
+ ClassicAssert.AreEqual(rectangle.RotationDegree, 45);
rectangle.IsFlipHorizontal = true;
HSSFWorkbook wb2 = HSSFTestDataSamples.WriteOutAndReadBack(wb1);
@@ -663,9 +663,9 @@ public void TestRotation()
sheet = wb2.GetSheetAt(0) as HSSFSheet;
patriarch = sheet.DrawingPatriarch as HSSFPatriarch;
rectangle = (HSSFSimpleShape)patriarch.Children[0];
- Assert.AreEqual(rectangle.RotationDegree, 45);
+ ClassicAssert.AreEqual(rectangle.RotationDegree, 45);
rectangle.RotationDegree = (short)30;
- Assert.AreEqual(rectangle.RotationDegree, 30);
+ ClassicAssert.AreEqual(rectangle.RotationDegree, 30);
patriarch.SetCoordinates(0, 0, 10, 10);
rectangle.String = new HSSFRichTextString("1234");
@@ -687,7 +687,7 @@ public void TestShapeContainerImplementsIterable(){
{
i--;
}
- Assert.AreEqual(i, 0);
+ ClassicAssert.AreEqual(i, 0);
wb.Close();
}
[Test]
@@ -703,24 +703,24 @@ public void TestClearShapesForPatriarch()
EscherAggregate agg = HSSFTestHelper.GetEscherAggregate(patriarch);
- Assert.AreEqual(agg.GetShapeToObjMapping().Count, 6);
- Assert.AreEqual(agg.TailRecords.Count, 1);
- Assert.AreEqual(patriarch.Children.Count, 3);
+ ClassicAssert.AreEqual(agg.GetShapeToObjMapping().Count, 6);
+ ClassicAssert.AreEqual(agg.TailRecords.Count, 1);
+ ClassicAssert.AreEqual(patriarch.Children.Count, 3);
patriarch.Clear();
- Assert.AreEqual(agg.GetShapeToObjMapping().Count, 0);
- Assert.AreEqual(agg.TailRecords.Count, 0);
- Assert.AreEqual(patriarch.Children.Count, 0);
+ ClassicAssert.AreEqual(agg.GetShapeToObjMapping().Count, 0);
+ ClassicAssert.AreEqual(agg.TailRecords.Count, 0);
+ ClassicAssert.AreEqual(patriarch.Children.Count, 0);
HSSFWorkbook wb2 = HSSFTestDataSamples.WriteOutAndReadBack(wb1);
wb1.Close();
sheet = wb2.GetSheetAt(0) as HSSFSheet;
patriarch = sheet.DrawingPatriarch as HSSFPatriarch;
- Assert.AreEqual(agg.GetShapeToObjMapping().Count, 0);
- Assert.AreEqual(agg.TailRecords.Count, 0);
- Assert.AreEqual(patriarch.Children.Count, 0);
+ ClassicAssert.AreEqual(agg.GetShapeToObjMapping().Count, 0);
+ ClassicAssert.AreEqual(agg.TailRecords.Count, 0);
+ ClassicAssert.AreEqual(patriarch.Children.Count, 0);
wb2.Close();
}
@@ -781,71 +781,71 @@ public void TestBug45312()
private void CheckWorkbookBack(HSSFWorkbook wb)
{
HSSFWorkbook wbBack = HSSFTestDataSamples.WriteOutAndReadBack(wb);
- Assert.IsNotNull(wbBack);
+ ClassicAssert.IsNotNull(wbBack);
HSSFSheet sheetBack = wbBack.GetSheetAt(0) as HSSFSheet;
- Assert.IsNotNull(sheetBack);
+ ClassicAssert.IsNotNull(sheetBack);
HSSFPatriarch patriarchBack = sheetBack.DrawingPatriarch as HSSFPatriarch;
- Assert.IsNotNull(patriarchBack);
+ ClassicAssert.IsNotNull(patriarchBack);
IList children = patriarchBack.Children;
- Assert.AreEqual(4, children.Count);
+ ClassicAssert.AreEqual(4, children.Count);
HSSFShape hssfShape = children[(0)];
- Assert.IsTrue(hssfShape is HSSFSimpleShape);
+ ClassicAssert.IsTrue(hssfShape is HSSFSimpleShape);
HSSFAnchor anchor = hssfShape.Anchor as HSSFAnchor;
- Assert.IsTrue(anchor is HSSFClientAnchor);
- Assert.AreEqual(0, anchor.Dx1);
- Assert.AreEqual(512, anchor.Dx2);
- Assert.AreEqual(0, anchor.Dy1);
- Assert.AreEqual(100, anchor.Dy2);
+ ClassicAssert.IsTrue(anchor is HSSFClientAnchor);
+ ClassicAssert.AreEqual(0, anchor.Dx1);
+ ClassicAssert.AreEqual(512, anchor.Dx2);
+ ClassicAssert.AreEqual(0, anchor.Dy1);
+ ClassicAssert.AreEqual(100, anchor.Dy2);
HSSFClientAnchor cAnchor = (HSSFClientAnchor)anchor;
- Assert.AreEqual(1, cAnchor.Col1);
- Assert.AreEqual(1, cAnchor.Col2);
- Assert.AreEqual(1, cAnchor.Row1);
- Assert.AreEqual(1, cAnchor.Row2);
+ ClassicAssert.AreEqual(1, cAnchor.Col1);
+ ClassicAssert.AreEqual(1, cAnchor.Col2);
+ ClassicAssert.AreEqual(1, cAnchor.Row1);
+ ClassicAssert.AreEqual(1, cAnchor.Row2);
hssfShape = children[(1)];
- Assert.IsTrue(hssfShape is HSSFSimpleShape);
+ ClassicAssert.IsTrue(hssfShape is HSSFSimpleShape);
anchor = hssfShape.Anchor as HSSFAnchor;
- Assert.IsTrue(anchor is HSSFClientAnchor);
- Assert.AreEqual(512, anchor.Dx1);
- Assert.AreEqual(1023, anchor.Dx2);
- Assert.AreEqual(0, anchor.Dy1);
- Assert.AreEqual(100, anchor.Dy2);
+ ClassicAssert.IsTrue(anchor is HSSFClientAnchor);
+ ClassicAssert.AreEqual(512, anchor.Dx1);
+ ClassicAssert.AreEqual(1023, anchor.Dx2);
+ ClassicAssert.AreEqual(0, anchor.Dy1);
+ ClassicAssert.AreEqual(100, anchor.Dy2);
cAnchor = (HSSFClientAnchor)anchor;
- Assert.AreEqual(1, cAnchor.Col1);
- Assert.AreEqual(1, cAnchor.Col2);
- Assert.AreEqual(1, cAnchor.Row1);
- Assert.AreEqual(1, cAnchor.Row2);
+ ClassicAssert.AreEqual(1, cAnchor.Col1);
+ ClassicAssert.AreEqual(1, cAnchor.Col2);
+ ClassicAssert.AreEqual(1, cAnchor.Row1);
+ ClassicAssert.AreEqual(1, cAnchor.Row2);
hssfShape = children[(2)];
- Assert.IsTrue(hssfShape is HSSFSimpleShape);
+ ClassicAssert.IsTrue(hssfShape is HSSFSimpleShape);
anchor = hssfShape.Anchor as HSSFAnchor;
- Assert.IsTrue(anchor is HSSFClientAnchor);
- Assert.AreEqual(0, anchor.Dx1);
- Assert.AreEqual(512, anchor.Dx2);
- Assert.AreEqual(0, anchor.Dy1);
- Assert.AreEqual(100, anchor.Dy2);
+ ClassicAssert.IsTrue(anchor is HSSFClientAnchor);
+ ClassicAssert.AreEqual(0, anchor.Dx1);
+ ClassicAssert.AreEqual(512, anchor.Dx2);
+ ClassicAssert.AreEqual(0, anchor.Dy1);
+ ClassicAssert.AreEqual(100, anchor.Dy2);
cAnchor = (HSSFClientAnchor)anchor;
- Assert.AreEqual(2, cAnchor.Col1);
- Assert.AreEqual(2, cAnchor.Col2);
- Assert.AreEqual(2, cAnchor.Row1);
- Assert.AreEqual(2, cAnchor.Row2);
+ ClassicAssert.AreEqual(2, cAnchor.Col1);
+ ClassicAssert.AreEqual(2, cAnchor.Col2);
+ ClassicAssert.AreEqual(2, cAnchor.Row1);
+ ClassicAssert.AreEqual(2, cAnchor.Row2);
hssfShape = children[(3)];
- Assert.IsTrue(hssfShape is HSSFSimpleShape);
+ ClassicAssert.IsTrue(hssfShape is HSSFSimpleShape);
anchor = hssfShape.Anchor as HSSFAnchor;
- Assert.IsTrue(anchor is HSSFClientAnchor);
- Assert.AreEqual(0, anchor.Dx1);
- Assert.AreEqual(512, anchor.Dx2);
- Assert.AreEqual(100, anchor.Dy1);
- Assert.AreEqual(200, anchor.Dy2);
+ ClassicAssert.IsTrue(anchor is HSSFClientAnchor);
+ ClassicAssert.AreEqual(0, anchor.Dx1);
+ ClassicAssert.AreEqual(512, anchor.Dx2);
+ ClassicAssert.AreEqual(100, anchor.Dy1);
+ ClassicAssert.AreEqual(200, anchor.Dy2);
cAnchor = (HSSFClientAnchor)anchor;
- Assert.AreEqual(2, cAnchor.Col1);
- Assert.AreEqual(2, cAnchor.Col2);
- Assert.AreEqual(2, cAnchor.Row1);
- Assert.AreEqual(2, cAnchor.Row2);
+ ClassicAssert.AreEqual(2, cAnchor.Col1);
+ ClassicAssert.AreEqual(2, cAnchor.Col2);
+ ClassicAssert.AreEqual(2, cAnchor.Row1);
+ ClassicAssert.AreEqual(2, cAnchor.Row2);
wbBack.Close();
}
diff --git a/testcases/main/HSSF/Model/TestEscherRecordFactory.cs b/testcases/main/HSSF/Model/TestEscherRecordFactory.cs
index 9988b41aa..0517f01a4 100644
--- a/testcases/main/HSSF/Model/TestEscherRecordFactory.cs
+++ b/testcases/main/HSSF/Model/TestEscherRecordFactory.cs
@@ -21,7 +21,7 @@ limitations Under the License.
using System.IO;
using NPOI.HSSF.Record;
using NPOI.Util;
-using NUnit.Framework;
+using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.DDF;
using NPOI.HSSF.UserModel;
using NPOI.SS.UserModel;
@@ -59,27 +59,27 @@ private static byte[] toByteArray(List records)
public void TestDetectContainer()
{
Random rnd = new Random();
- Assert.AreEqual(true, DefaultEscherRecordFactory.IsContainer((short)0x0, EscherContainerRecord.DG_CONTAINER));
- Assert.AreEqual(true, DefaultEscherRecordFactory.IsContainer((short)0x0, EscherContainerRecord.SOLVER_CONTAINER));
- Assert.AreEqual(true, DefaultEscherRecordFactory.IsContainer((short)0x0, EscherContainerRecord.SP_CONTAINER));
- Assert.AreEqual(true, DefaultEscherRecordFactory.IsContainer((short)0x0, EscherContainerRecord.DGG_CONTAINER));
- Assert.AreEqual(true, DefaultEscherRecordFactory.IsContainer((short)0x0, EscherContainerRecord.BSTORE_CONTAINER));
- Assert.AreEqual(true, DefaultEscherRecordFactory.IsContainer((short)0x0, EscherContainerRecord.SPGR_CONTAINER));
+ ClassicAssert.AreEqual(true, DefaultEscherRecordFactory.IsContainer((short)0x0, EscherContainerRecord.DG_CONTAINER));
+ ClassicAssert.AreEqual(true, DefaultEscherRecordFactory.IsContainer((short)0x0, EscherContainerRecord.SOLVER_CONTAINER));
+ ClassicAssert.AreEqual(true, DefaultEscherRecordFactory.IsContainer((short)0x0, EscherContainerRecord.SP_CONTAINER));
+ ClassicAssert.AreEqual(true, DefaultEscherRecordFactory.IsContainer((short)0x0, EscherContainerRecord.DGG_CONTAINER));
+ ClassicAssert.AreEqual(true, DefaultEscherRecordFactory.IsContainer((short)0x0, EscherContainerRecord.BSTORE_CONTAINER));
+ ClassicAssert.AreEqual(true, DefaultEscherRecordFactory.IsContainer((short)0x0, EscherContainerRecord.SPGR_CONTAINER));
for (short i = EscherContainerRecord.DGG_CONTAINER; i <= EscherContainerRecord.SOLVER_CONTAINER; i++)
{
- Assert.AreEqual(true, DefaultEscherRecordFactory.IsContainer((short)rnd.Next(short.MaxValue), i));
+ ClassicAssert.AreEqual(true, DefaultEscherRecordFactory.IsContainer((short)rnd.Next(short.MaxValue), i));
}
- Assert.AreEqual(false, DefaultEscherRecordFactory.IsContainer((short)0x0, EscherContainerRecord.DGG_CONTAINER - 1));
- Assert.AreEqual(false, DefaultEscherRecordFactory.IsContainer((short)0x0, EscherContainerRecord.SOLVER_CONTAINER + 1));
+ ClassicAssert.AreEqual(false, DefaultEscherRecordFactory.IsContainer((short)0x0, EscherContainerRecord.DGG_CONTAINER - 1));
+ ClassicAssert.AreEqual(false, DefaultEscherRecordFactory.IsContainer((short)0x0, EscherContainerRecord.SOLVER_CONTAINER + 1));
- Assert.AreEqual(true, DefaultEscherRecordFactory.IsContainer((short)0x000F, EscherContainerRecord.DGG_CONTAINER - 1));
- Assert.AreEqual(true, DefaultEscherRecordFactory.IsContainer(unchecked((short)0xFFFF), EscherContainerRecord.DGG_CONTAINER - 1));
- Assert.AreEqual(false, DefaultEscherRecordFactory.IsContainer((short)0x000C, EscherContainerRecord.DGG_CONTAINER - 1));
- Assert.AreEqual(false, DefaultEscherRecordFactory.IsContainer(unchecked((short)0xCCCC), EscherContainerRecord.DGG_CONTAINER - 1));
- Assert.AreEqual(false, DefaultEscherRecordFactory.IsContainer((short)0x000F, EscherTextboxRecord.RECORD_ID));
- Assert.AreEqual(false, DefaultEscherRecordFactory.IsContainer(unchecked((short)0xCCCC), EscherTextboxRecord.RECORD_ID));
+ ClassicAssert.AreEqual(true, DefaultEscherRecordFactory.IsContainer((short)0x000F, EscherContainerRecord.DGG_CONTAINER - 1));
+ ClassicAssert.AreEqual(true, DefaultEscherRecordFactory.IsContainer(unchecked((short)0xFFFF), EscherContainerRecord.DGG_CONTAINER - 1));
+ ClassicAssert.AreEqual(false, DefaultEscherRecordFactory.IsContainer((short)0x000C, EscherContainerRecord.DGG_CONTAINER - 1));
+ ClassicAssert.AreEqual(false, DefaultEscherRecordFactory.IsContainer(unchecked((short)0xCCCC), EscherContainerRecord.DGG_CONTAINER - 1));
+ ClassicAssert.AreEqual(false, DefaultEscherRecordFactory.IsContainer((short)0x000F, EscherTextboxRecord.RECORD_ID));
+ ClassicAssert.AreEqual(false, DefaultEscherRecordFactory.IsContainer(unchecked((short)0xCCCC), EscherTextboxRecord.RECORD_ID));
}
[Test]
public void TestDgContainerMustBeRootOfHSSFSheetEscherRecords()
@@ -93,13 +93,13 @@ public void TestDgContainerMustBeRootOfHSSFSheetEscherRecords()
byte[] dgBytes = toByteArray(dgRecords);
IDrawing d = sh.DrawingPatriarch;
EscherAggregate agg = (EscherAggregate)ish.FindFirstRecordBySid(EscherAggregate.sid);
- Assert.AreEqual(true, agg.EscherRecords[0] is EscherContainerRecord);
- Assert.AreEqual(EscherContainerRecord.DG_CONTAINER, agg.EscherRecords[0].RecordId);
- Assert.AreEqual((short)0x0, agg.EscherRecords[0].Options);
+ ClassicAssert.AreEqual(true, agg.EscherRecords[0] is EscherContainerRecord);
+ ClassicAssert.AreEqual(EscherContainerRecord.DG_CONTAINER, agg.EscherRecords[0].RecordId);
+ ClassicAssert.AreEqual((short)0x0, agg.EscherRecords[0].Options);
agg = (EscherAggregate)ish.FindFirstRecordBySid(EscherAggregate.sid);
byte[] dgBytesAfterSave = agg.Serialize();
- Assert.AreEqual(dgBytes.Length, dgBytesAfterSave.Length, "different size of drawing data before and after save");
- Assert.IsTrue(Arrays.Equals(dgBytes, dgBytesAfterSave), "drawing data before and after save is different");
+ ClassicAssert.AreEqual(dgBytes.Length, dgBytesAfterSave.Length, "different size of drawing data before and after save");
+ ClassicAssert.IsTrue(Arrays.Equals(dgBytes, dgBytesAfterSave), "drawing data before and after save is different");
}
}
}
diff --git a/testcases/main/HSSF/Model/TestFormulaParser.cs b/testcases/main/HSSF/Model/TestFormulaParser.cs
index 6f73fb084..cb33cf3da 100644
--- a/testcases/main/HSSF/Model/TestFormulaParser.cs
+++ b/testcases/main/HSSF/Model/TestFormulaParser.cs
@@ -18,7 +18,7 @@ limitations under the License.
namespace TestCases.HSSF.Model
{
using System;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.Model;
using NPOI.HSSF.Record;
using NPOI.HSSF.UserModel;
@@ -57,55 +57,55 @@ public void PrepareCulture()
public static Ptg[] ParseFormula(String formula)
{
Ptg[] result = HSSFFormulaParser.Parse(formula, null);
- Assert.IsNotNull(result, "Ptg array should not be null");
+ ClassicAssert.IsNotNull(result, "Ptg array should not be null");
return result;
}
[Test]
public void TestSimpleFormula()
{
Ptg[] ptgs = ParseFormula("2+2");
- Assert.AreEqual(3, ptgs.Length);
+ ClassicAssert.AreEqual(3, ptgs.Length);
}
[Test]
public void TestFormulaWithSpace1()
{
Ptg[] ptgs = ParseFormula(" 2 + 2 ");
- Assert.AreEqual(3, ptgs.Length);
- Assert.IsTrue((ptgs[0] is IntPtg));
- Assert.IsTrue((ptgs[1] is IntPtg));
- Assert.IsTrue((ptgs[2] is AddPtg));
+ ClassicAssert.AreEqual(3, ptgs.Length);
+ ClassicAssert.IsTrue((ptgs[0] is IntPtg));
+ ClassicAssert.IsTrue((ptgs[1] is IntPtg));
+ ClassicAssert.IsTrue((ptgs[2] is AddPtg));
}
[Test]
public void TestFormulaWithSpace2()
{
Ptg[] ptgs = ParseFormula("2+ sum( 3 , 4) ");
- Assert.AreEqual(5, ptgs.Length);
+ ClassicAssert.AreEqual(5, ptgs.Length);
}
[Test]
public void TestFormulaWithSpaceNRef()
{
Ptg[] ptgs = ParseFormula("sum( A2:A3 )");
- Assert.AreEqual(2, ptgs.Length);
+ ClassicAssert.AreEqual(2, ptgs.Length);
}
[Test]
public void TestFormulaWithString()
{
Ptg[] ptgs = ParseFormula("\"hello\" & \"world\" ");
- Assert.AreEqual(3, ptgs.Length);
+ ClassicAssert.AreEqual(3, ptgs.Length);
}
[Test]
public void TestTRUE()
{
Ptg[] ptgs = ParseFormula("TRUE");
- Assert.AreEqual(1, ptgs.Length);
+ ClassicAssert.AreEqual(1, ptgs.Length);
BoolPtg flag = (BoolPtg)ptgs[0];
- Assert.AreEqual(true, flag.Value);
+ ClassicAssert.AreEqual(true, flag.Value);
}
[Test]
public void TestSumIf()
{
Ptg[] ptgs = ParseFormula("SUMIF(A1:A5,\">4000\",B1:B5)");
- Assert.AreEqual(4, ptgs.Length);
+ ClassicAssert.AreEqual(4, ptgs.Length);
}
/**
@@ -118,11 +118,11 @@ public void TestNonAlphaFormula()
{
String currencyCell = "F3";
Ptg[] ptgs = ParseFormula("\"TOTAL[\"&" + currencyCell + "&\"]\"");
- Assert.AreEqual(5, ptgs.Length);
- Assert.IsTrue((ptgs[0] is StringPtg), "Ptg[0] is1 a string");
+ ClassicAssert.AreEqual(5, ptgs.Length);
+ ClassicAssert.IsTrue((ptgs[0] is StringPtg), "Ptg[0] is1 a string");
StringPtg firstString = (StringPtg)ptgs[0];
- Assert.AreEqual("TOTAL[", firstString.Value);
+ ClassicAssert.AreEqual("TOTAL[", firstString.Value);
//the PTG order isn't 100% correct but it still works - dmui
}
[Test]
@@ -137,21 +137,21 @@ public void TestMacroFunction()
//Expected ptg stack: [NamePtg(myFunc), StringPtg(arg), (additional operands go here...), FunctionPtg(myFunc)]
Ptg[] ptg = FormulaParser.Parse("myFunc(\"arg\")", book, FormulaType.Cell, -1);
- Assert.AreEqual(3, ptg.Length);
+ ClassicAssert.AreEqual(3, ptg.Length);
// the name gets encoded as the first operand on the stack
NamePtg tname = (NamePtg)ptg[0];
- Assert.AreEqual("myFunc", tname.ToFormulaString(book));
+ ClassicAssert.AreEqual("myFunc", tname.ToFormulaString(book));
// the function's arguments are pushed onto the stack from left-to-right as OperandPtgs
StringPtg arg = (StringPtg)ptg[1];
- Assert.AreEqual("arg", arg.Value);
+ ClassicAssert.AreEqual("arg", arg.Value);
// The external FunctionPtg is the last Ptg added to the stack
// During formula evaluation, this Ptg pops off the the appropriate number of
// arguments (getNumberOfOperands()) and pushes the result on the stack
AbstractFunctionPtg tfunc = (AbstractFunctionPtg)ptg[2]; //FuncVarPtg
- Assert.IsTrue(tfunc.IsExternalFunction);
+ ClassicAssert.IsTrue(tfunc.IsExternalFunction);
// confirm formula parsing is case-insensitive
FormulaParser.Parse("mYfUnC(\"arg\")", book, FormulaType.Cell, -1);
@@ -170,9 +170,9 @@ public void TestMacroFunction()
try
{
// HSSFWorkbook/EXCEL97-specific side-effects user-defined function names must be added to Workbook's defined names in order to be saved.
- Assert.IsNotNull(wb2.GetName("myFunc"));
+ ClassicAssert.IsNotNull(wb2.GetName("myFunc"));
assertEqualsIgnoreCase("myFunc", wb2.GetName("myFunc").NameName);
- Assert.IsNotNull(wb2.GetName("yourFunc"));
+ ClassicAssert.IsNotNull(wb2.GetName("yourFunc"));
assertEqualsIgnoreCase("yourFunc", wb2.GetName("yourFunc").NameName);
// Manually check to make sure file isn't corrupted
@@ -200,22 +200,22 @@ public void TestMacroFunction()
private static void assertEqualsIgnoreCase(String expected, String actual)
{
CultureInfo cultureUS = CultureInfo.GetCultureInfo("en-US");
- Assert.AreEqual(expected.ToLower(cultureUS), actual.ToLower(cultureUS));
+ ClassicAssert.AreEqual(expected.ToLower(cultureUS), actual.ToLower(cultureUS));
}
[Test]
public void TestEmbeddedSlash()
{
Ptg[] ptgs = ParseFormula("HYPERLINK(\"http://www.jakarta.org\",\"Jakarta\")");
- Assert.IsTrue(ptgs[0] is StringPtg, "first ptg is1 string");
- Assert.IsTrue(ptgs[1] is StringPtg, "second ptg is1 string");
+ ClassicAssert.IsTrue(ptgs[0] is StringPtg, "first ptg is1 string");
+ ClassicAssert.IsTrue(ptgs[1] is StringPtg, "second ptg is1 string");
}
[Test]
public void TestConcatenate()
{
Ptg[] ptgs = ParseFormula("CONCATENATE(\"first\",\"second\")");
- Assert.IsTrue(ptgs[0] is StringPtg, "first ptg is1 string");
- Assert.IsTrue(ptgs[1] is StringPtg, "second ptg is1 string");
+ ClassicAssert.IsTrue(ptgs[0] is StringPtg, "first ptg is1 string");
+ ClassicAssert.IsTrue(ptgs[1] is StringPtg, "second ptg is1 string");
}
[Test]
public void TestWorksheetReferences()
@@ -241,17 +241,17 @@ public void TestWorksheetReferences()
public void TestUnaryMinus()
{
Ptg[] ptgs = ParseFormula("-A1");
- Assert.AreEqual(2, ptgs.Length);
- Assert.IsTrue(ptgs[0] is RefPtg, "first ptg is1 reference");
- Assert.IsTrue(ptgs[1] is UnaryMinusPtg, "second ptg is1 Minus");
+ ClassicAssert.AreEqual(2, ptgs.Length);
+ ClassicAssert.IsTrue(ptgs[0] is RefPtg, "first ptg is1 reference");
+ ClassicAssert.IsTrue(ptgs[1] is UnaryMinusPtg, "second ptg is1 Minus");
}
[Test]
public void TestUnaryPlus()
{
Ptg[] ptgs = ParseFormula("+A1");
- Assert.AreEqual(2, ptgs.Length);
- Assert.IsTrue(ptgs[0] is RefPtg, "first ptg is1 reference");
- Assert.IsTrue(ptgs[1] is UnaryPlusPtg, "second ptg is1 Plus");
+ ClassicAssert.AreEqual(2, ptgs.Length);
+ ClassicAssert.IsTrue(ptgs[0] is RefPtg, "first ptg is1 reference");
+ ClassicAssert.IsTrue(ptgs[1] is UnaryPlusPtg, "second ptg is1 Plus");
}
[Test]
public void TestLeadingSpaceInString()
@@ -259,22 +259,22 @@ public void TestLeadingSpaceInString()
String value = " hi ";
Ptg[] ptgs = ParseFormula("\"" + value + "\"");
- Assert.AreEqual(1, ptgs.Length);
- Assert.IsTrue(ptgs[0] is StringPtg, "ptg0 is1 a StringPtg");
- Assert.IsTrue(((StringPtg)ptgs[0]).Value.Equals(value), "ptg0 contains exact value");
+ ClassicAssert.AreEqual(1, ptgs.Length);
+ ClassicAssert.IsTrue(ptgs[0] is StringPtg, "ptg0 is1 a StringPtg");
+ ClassicAssert.IsTrue(((StringPtg)ptgs[0]).Value.Equals(value), "ptg0 contains exact value");
}
[Test]
public void TestLookupAndMatchFunctionArgs()
{
Ptg[] ptgs = ParseFormula("lookup(A1, A3:A52, B3:B52)");
- Assert.AreEqual(4, ptgs.Length);
- Assert.IsTrue(ptgs[0].PtgClass == Ptg.CLASS_VALUE, "ptg0 has Value class");
+ ClassicAssert.AreEqual(4, ptgs.Length);
+ ClassicAssert.IsTrue(ptgs[0].PtgClass == Ptg.CLASS_VALUE, "ptg0 has Value class");
ptgs = ParseFormula("match(A1, A3:A52)");
- Assert.AreEqual(3, ptgs.Length);
- Assert.IsTrue(ptgs[0].PtgClass == Ptg.CLASS_VALUE, "ptg0 has Value class");
+ ClassicAssert.AreEqual(3, ptgs.Length);
+ ClassicAssert.IsTrue(ptgs[0].PtgClass == Ptg.CLASS_VALUE, "ptg0 has Value class");
}
/** bug 33160*/
@@ -282,10 +282,10 @@ public void TestLookupAndMatchFunctionArgs()
public void TestLargeInt()
{
Ptg[] ptgs = ParseFormula("40");
- Assert.IsTrue(ptgs[0] is IntPtg, "ptg is1 Int, is1 " + ptgs[0].GetType());
+ ClassicAssert.IsTrue(ptgs[0] is IntPtg, "ptg is1 Int, is1 " + ptgs[0].GetType());
ptgs = ParseFormula("40000");
- Assert.IsTrue(ptgs[0] is IntPtg, "ptg should be IntPtg, is1 " + ptgs[0].GetType());
+ ClassicAssert.IsTrue(ptgs[0] is IntPtg, "ptg should be IntPtg, is1 " + ptgs[0].GetType());
}
/** bug 33160, Testcase by Amol Deshmukh*/
@@ -293,10 +293,10 @@ public void TestLargeInt()
public void TestSimpleLongFormula()
{
Ptg[] ptgs = ParseFormula("40000/2");
- Assert.AreEqual(3, ptgs.Length);
- Assert.IsTrue((ptgs[0] is IntPtg), "IntPtg");
- Assert.IsTrue((ptgs[1] is IntPtg), "IntPtg");
- Assert.IsTrue((ptgs[2] is DividePtg), "DividePtg");
+ ClassicAssert.AreEqual(3, ptgs.Length);
+ ClassicAssert.IsTrue((ptgs[0] is IntPtg), "IntPtg");
+ ClassicAssert.IsTrue((ptgs[1] is IntPtg), "IntPtg");
+ ClassicAssert.IsTrue((ptgs[2] is DividePtg), "DividePtg");
}
/** bug 35027, underscore in sheet name */
@@ -353,13 +353,13 @@ public void TestNamesWithUnderscore()
ICell cell = row.CreateCell(0);
cell.CellFormula = ("DA6_LEO_WBS_Number*2");
- Assert.AreEqual("DA6_LEO_WBS_Number*2", cell.CellFormula);
+ ClassicAssert.AreEqual("DA6_LEO_WBS_Number*2", cell.CellFormula);
cell.CellFormula = ("(A1_*_A1+A_1)/A_1_");
- Assert.AreEqual("(A1_*_A1+A_1)/A_1_", cell.CellFormula);
+ ClassicAssert.AreEqual("(A1_*_A1+A_1)/A_1_", cell.CellFormula);
cell.CellFormula = ("INDEX(DA6_LEO_WBS_Name,MATCH($A3,DA6_LEO_WBS_Number,0))");
- Assert.AreEqual("INDEX(DA6_LEO_WBS_Name,MATCH($A3,DA6_LEO_WBS_Number,0))", cell.CellFormula);
+ ClassicAssert.AreEqual("INDEX(DA6_LEO_WBS_Name,MATCH($A3,DA6_LEO_WBS_Number,0))", cell.CellFormula);
wb.Close();
}
@@ -369,22 +369,22 @@ public void TestExponentialParsing()
{
Ptg[] ptgs;
ptgs = ParseFormula("1.3E21/2");
- Assert.AreEqual(3, ptgs.Length);
- Assert.IsTrue((ptgs[0] is NumberPtg), "NumberPtg");
- Assert.IsTrue((ptgs[1] is IntPtg), "IntPtg");
- Assert.IsTrue((ptgs[2] is DividePtg), "DividePtg");
+ ClassicAssert.AreEqual(3, ptgs.Length);
+ ClassicAssert.IsTrue((ptgs[0] is NumberPtg), "NumberPtg");
+ ClassicAssert.IsTrue((ptgs[1] is IntPtg), "IntPtg");
+ ClassicAssert.IsTrue((ptgs[2] is DividePtg), "DividePtg");
ptgs = ParseFormula("1322E21/2");
- Assert.AreEqual(3, ptgs.Length);
- Assert.IsTrue((ptgs[0] is NumberPtg), "NumberPtg");
- Assert.IsTrue((ptgs[1] is IntPtg), "IntPtg");
- Assert.IsTrue((ptgs[2] is DividePtg), "DividePtg");
+ ClassicAssert.AreEqual(3, ptgs.Length);
+ ClassicAssert.IsTrue((ptgs[0] is NumberPtg), "NumberPtg");
+ ClassicAssert.IsTrue((ptgs[1] is IntPtg), "IntPtg");
+ ClassicAssert.IsTrue((ptgs[2] is DividePtg), "DividePtg");
ptgs = ParseFormula("1.3E1/2");
- Assert.AreEqual(3, ptgs.Length);
- Assert.IsTrue((ptgs[0] is NumberPtg), "NumberPtg");
- Assert.IsTrue((ptgs[1] is IntPtg), "IntPtg");
- Assert.IsTrue((ptgs[2] is DividePtg), "DividePtg");
+ ClassicAssert.AreEqual(3, ptgs.Length);
+ ClassicAssert.IsTrue((ptgs[0] is NumberPtg), "NumberPtg");
+ ClassicAssert.IsTrue((ptgs[1] is IntPtg), "IntPtg");
+ ClassicAssert.IsTrue((ptgs[2] is DividePtg), "DividePtg");
}
///
/// Tests the exponential in sheet.
@@ -406,63 +406,63 @@ public void TestExponentialInSheet()
cell.CellFormula = ("1.3E21/3");
formula = cell.CellFormula;
- Assert.AreEqual("1.3E+21/3", formula, "Exponential formula string");
+ ClassicAssert.AreEqual("1.3E+21/3", formula, "Exponential formula string");
cell.CellFormula = ("-1.3E21/3");
formula = cell.CellFormula;
- Assert.AreEqual("-1.3E+21/3", formula, "Exponential formula string");
+ ClassicAssert.AreEqual("-1.3E+21/3", formula, "Exponential formula string");
cell.CellFormula = ("1322E21/3");
formula = cell.CellFormula;
- Assert.AreEqual("1.322E+24/3", formula, "Exponential formula string");
+ ClassicAssert.AreEqual("1.322E+24/3", formula, "Exponential formula string");
cell.CellFormula = ("-1322E21/3");
formula = cell.CellFormula;
- Assert.AreEqual("-1.322E+24/3", formula, "Exponential formula string");
+ ClassicAssert.AreEqual("-1.322E+24/3", formula, "Exponential formula string");
cell.CellFormula = ("1.3E1/3");
formula = cell.CellFormula;
- Assert.AreEqual("13/3", formula, "Exponential formula string");
+ ClassicAssert.AreEqual("13/3", formula, "Exponential formula string");
cell.CellFormula = ("-1.3E1/3");
formula = cell.CellFormula;
- Assert.AreEqual("-13/3", formula, "Exponential formula string");
+ ClassicAssert.AreEqual("-13/3", formula, "Exponential formula string");
cell.CellFormula = ("1.3E-4/3");
formula = cell.CellFormula;
- Assert.AreEqual("0.00013/3", formula, "Exponential formula string");
+ ClassicAssert.AreEqual("0.00013/3", formula, "Exponential formula string");
cell.CellFormula = ("-1.3E-4/3");
formula = cell.CellFormula;
- Assert.AreEqual("-0.00013/3", formula, "Exponential formula string");
+ ClassicAssert.AreEqual("-0.00013/3", formula, "Exponential formula string");
cell.CellFormula = ("13E-15/3");
formula = cell.CellFormula;
- Assert.AreEqual("0.000000000000013/3", formula, "Exponential formula string");
+ ClassicAssert.AreEqual("0.000000000000013/3", formula, "Exponential formula string");
cell.CellFormula = ("-13E-15/3");
formula = cell.CellFormula;
- Assert.AreEqual("-0.000000000000013/3", formula, "Exponential formula string");
+ ClassicAssert.AreEqual("-0.000000000000013/3", formula, "Exponential formula string");
cell.CellFormula = ("1.3E3/3");
formula = cell.CellFormula;
- Assert.AreEqual("1300/3", formula, "Exponential formula string");
+ ClassicAssert.AreEqual("1300/3", formula, "Exponential formula string");
cell.CellFormula = ("-1.3E3/3");
formula = cell.CellFormula;
- Assert.AreEqual("-1300/3", formula, "Exponential formula string");
+ ClassicAssert.AreEqual("-1300/3", formula, "Exponential formula string");
cell.CellFormula = ("1300000000000000/3");
formula = cell.CellFormula;
- Assert.AreEqual("1300000000000000/3", formula, "Exponential formula string");
+ ClassicAssert.AreEqual("1300000000000000/3", formula, "Exponential formula string");
cell.CellFormula = ("-1300000000000000/3");
formula = cell.CellFormula;
- Assert.AreEqual("-1300000000000000/3", formula, "Exponential formula string");
+ ClassicAssert.AreEqual("-1300000000000000/3", formula, "Exponential formula string");
cell.CellFormula = ("-10E-1/3.1E2*4E3/3E4");
formula = cell.CellFormula;
- Assert.AreEqual("-1/310*4000/30000", formula, "Exponential formula string");
+ ClassicAssert.AreEqual("-1/310*4000/30000", formula, "Exponential formula string");
wb.Close();
}
@@ -484,29 +484,29 @@ public void TestNumbers()
cell.CellFormula = (".1");
formula = cell.CellFormula;
- Assert.AreEqual("0.1", formula);
+ ClassicAssert.AreEqual("0.1", formula);
cell.CellFormula = ("+.1");
formula = cell.CellFormula;
- Assert.AreEqual("0.1", formula);
+ ClassicAssert.AreEqual("0.1", formula);
cell.CellFormula = ("-.1");
formula = cell.CellFormula;
- Assert.AreEqual("-0.1", formula);
+ ClassicAssert.AreEqual("-0.1", formula);
// has exponent
cell.CellFormula = ("10E1");
formula = cell.CellFormula;
- Assert.AreEqual("100", formula);
+ ClassicAssert.AreEqual("100", formula);
cell.CellFormula = ("10E+1");
formula = cell.CellFormula;
- Assert.AreEqual("100", formula);
+ ClassicAssert.AreEqual("100", formula);
cell.CellFormula = ("10E-1");
formula = cell.CellFormula;
- Assert.AreEqual("1", formula);
+ ClassicAssert.AreEqual("1", formula);
wb.Close();
}
@@ -524,15 +524,15 @@ public void TestRanges()
cell.CellFormula = ("A1.A2");
formula = cell.CellFormula;
- Assert.AreEqual("A1:A2", formula);
+ ClassicAssert.AreEqual("A1:A2", formula);
cell.CellFormula = ("A1..A2");
formula = cell.CellFormula;
- Assert.AreEqual("A1:A2", formula);
+ ClassicAssert.AreEqual("A1:A2", formula);
cell.CellFormula = ("A1...A2");
formula = cell.CellFormula;
- Assert.AreEqual("A1:A2", formula);
+ ClassicAssert.AreEqual("A1:A2", formula);
wb.Close();
}
@@ -555,34 +555,34 @@ public void TestMultiSheetReference()
// One sheet
cell.CellFormula = (/*setter*/"Cash_Flow!A1");
formula = cell.CellFormula;
- Assert.AreEqual("Cash_Flow!A1", formula);
+ ClassicAssert.AreEqual("Cash_Flow!A1", formula);
// Then the other
cell.CellFormula = (/*setter*/"\'Test Sheet\'!A1");
formula = cell.CellFormula;
- Assert.AreEqual("\'Test Sheet\'!A1", formula);
+ ClassicAssert.AreEqual("\'Test Sheet\'!A1", formula);
// Now both
cell.CellFormula = (/*setter*/"Cash_Flow:\'Test Sheet\'!A1");
formula = cell.CellFormula;
- Assert.AreEqual("Cash_Flow:\'Test Sheet\'!A1", formula);
+ ClassicAssert.AreEqual("Cash_Flow:\'Test Sheet\'!A1", formula);
// References to a range (area) of cells:
// One sheet
cell.CellFormula = ("Cash_Flow!A1:B2");
formula = cell.CellFormula;
- Assert.AreEqual("Cash_Flow!A1:B2", formula);
+ ClassicAssert.AreEqual("Cash_Flow!A1:B2", formula);
// Then the other
cell.CellFormula = ("\'Test Sheet\'!A1:B2");
formula = cell.CellFormula;
- Assert.AreEqual("\'Test Sheet\'!A1:B2", formula);
+ ClassicAssert.AreEqual("\'Test Sheet\'!A1:B2", formula);
// Now both
cell.CellFormula = ("Cash_Flow:\'Test Sheet\'!A1:B2");
formula = cell.CellFormula;
- Assert.AreEqual("Cash_Flow:\'Test Sheet\'!A1:B2", formula);
+ ClassicAssert.AreEqual("Cash_Flow:\'Test Sheet\'!A1:B2", formula);
wb.Close();
}
@@ -600,7 +600,7 @@ public void TestToFormulaStringZeroArgFunction()
Ptg[] ptgs = {
FuncPtg.Create(10),
};
- Assert.AreEqual("NA()", HSSFFormulaParser.ToFormulaString(book, ptgs));
+ ClassicAssert.AreEqual("NA()", HSSFFormulaParser.ToFormulaString(book, ptgs));
book.Close();
}
@@ -609,56 +609,56 @@ public void TestPercent()
{
Ptg[] ptgs;
ptgs = ParseFormula("5%");
- Assert.AreEqual(2, ptgs.Length);
- Assert.AreEqual(ptgs[0].GetType(), typeof(IntPtg));
- Assert.AreEqual(ptgs[1].GetType(), typeof(PercentPtg));
+ ClassicAssert.AreEqual(2, ptgs.Length);
+ ClassicAssert.AreEqual(ptgs[0].GetType(), typeof(IntPtg));
+ ClassicAssert.AreEqual(ptgs[1].GetType(), typeof(PercentPtg));
// spaces OK
ptgs = ParseFormula(" 250 % ");
- Assert.AreEqual(2, ptgs.Length);
- Assert.AreEqual(ptgs[0].GetType(), typeof(IntPtg));
- Assert.AreEqual(ptgs[1].GetType(), typeof(PercentPtg));
+ ClassicAssert.AreEqual(2, ptgs.Length);
+ ClassicAssert.AreEqual(ptgs[0].GetType(), typeof(IntPtg));
+ ClassicAssert.AreEqual(ptgs[1].GetType(), typeof(PercentPtg));
// double percent OK
ptgs = ParseFormula("12345.678%%");
- Assert.AreEqual(3, ptgs.Length);
- Assert.AreEqual(ptgs[0].GetType(), typeof(NumberPtg));
- Assert.AreEqual(ptgs[1].GetType(), typeof(PercentPtg));
- Assert.AreEqual(ptgs[2].GetType(), typeof(PercentPtg));
+ ClassicAssert.AreEqual(3, ptgs.Length);
+ ClassicAssert.AreEqual(ptgs[0].GetType(), typeof(NumberPtg));
+ ClassicAssert.AreEqual(ptgs[1].GetType(), typeof(PercentPtg));
+ ClassicAssert.AreEqual(ptgs[2].GetType(), typeof(PercentPtg));
// percent of a bracketed expression
ptgs = ParseFormula("(A1+35)%*B1%");
- Assert.AreEqual(8, ptgs.Length);
- Assert.AreEqual(ptgs[4].GetType(), typeof(PercentPtg));
- Assert.AreEqual(ptgs[6].GetType(), typeof(PercentPtg));
+ ClassicAssert.AreEqual(8, ptgs.Length);
+ ClassicAssert.AreEqual(ptgs[4].GetType(), typeof(PercentPtg));
+ ClassicAssert.AreEqual(ptgs[6].GetType(), typeof(PercentPtg));
// percent of a text quantity
ptgs = ParseFormula("\"8.75\"%");
- Assert.AreEqual(2, ptgs.Length);
- Assert.AreEqual(ptgs[0].GetType(), typeof(StringPtg));
- Assert.AreEqual(ptgs[1].GetType(), typeof(PercentPtg));
+ ClassicAssert.AreEqual(2, ptgs.Length);
+ ClassicAssert.AreEqual(ptgs[0].GetType(), typeof(StringPtg));
+ ClassicAssert.AreEqual(ptgs[1].GetType(), typeof(PercentPtg));
// percent to the power of
ptgs = ParseFormula("50%^3");
- Assert.AreEqual(4, ptgs.Length);
- Assert.AreEqual(ptgs[0].GetType(), typeof(IntPtg));
- Assert.AreEqual(ptgs[1].GetType(), typeof(PercentPtg));
- Assert.AreEqual(ptgs[2].GetType(), typeof(IntPtg));
- Assert.AreEqual(ptgs[3].GetType(), typeof(PowerPtg));
+ ClassicAssert.AreEqual(4, ptgs.Length);
+ ClassicAssert.AreEqual(ptgs[0].GetType(), typeof(IntPtg));
+ ClassicAssert.AreEqual(ptgs[1].GetType(), typeof(PercentPtg));
+ ClassicAssert.AreEqual(ptgs[2].GetType(), typeof(IntPtg));
+ ClassicAssert.AreEqual(ptgs[3].GetType(), typeof(PowerPtg));
//
// things that Parse OK but would *evaluate* to an error
ptgs = ParseFormula("\"abc\"%");
- Assert.AreEqual(2, ptgs.Length);
- Assert.AreEqual(ptgs[0].GetType(), typeof(StringPtg));
- Assert.AreEqual(ptgs[1].GetType(), typeof(PercentPtg));
+ ClassicAssert.AreEqual(2, ptgs.Length);
+ ClassicAssert.AreEqual(ptgs[0].GetType(), typeof(StringPtg));
+ ClassicAssert.AreEqual(ptgs[1].GetType(), typeof(PercentPtg));
ptgs = ParseFormula("#N/A%");
- Assert.AreEqual(2, ptgs.Length);
- Assert.AreEqual(ptgs[0].GetType(), typeof(ErrPtg));
- Assert.AreEqual(ptgs[1].GetType(), typeof(PercentPtg));
+ ClassicAssert.AreEqual(2, ptgs.Length);
+ ClassicAssert.AreEqual(ptgs[0].GetType(), typeof(ErrPtg));
+ ClassicAssert.AreEqual(ptgs[1].GetType(), typeof(PercentPtg));
}
/**
@@ -706,7 +706,7 @@ public void TestPrecedenceAndAssociativity()
public static Ptg[] ConfirmTokenClasses(String formula, params Type[] expectedClasses)
{
Ptg[] ptgs = ParseFormula(formula);
- Assert.AreEqual(expectedClasses.Length, ptgs.Length);
+ ClassicAssert.AreEqual(expectedClasses.Length, ptgs.Length);
for (int i = 0; i < expectedClasses.Length; i++)
{
if (expectedClasses[i] != ptgs[i].GetType())
@@ -750,12 +750,12 @@ private static void ConfirmUnary(String formulaText, double val, params Type[] e
if (ptg0 is IntPtg)
{
IntPtg intPtg = (IntPtg)ptg0;
- Assert.AreEqual((int)val, intPtg.Value);
+ ClassicAssert.AreEqual((int)val, intPtg.Value);
}
else if (ptg0 is NumberPtg)
{
NumberPtg numberPtg = (NumberPtg)ptg0;
- Assert.AreEqual(val, numberPtg.Value, 0.0);
+ ClassicAssert.AreEqual(val, numberPtg.Value, 0.0);
}
else
{
@@ -771,9 +771,9 @@ public void TestPower()
private static Ptg ParseSingleToken(String formula, Type ptgClass)
{
Ptg[] ptgs = ParseFormula(formula);
- Assert.AreEqual(1, ptgs.Length);
+ ClassicAssert.AreEqual(1, ptgs.Length);
Ptg result = ptgs[0];
- Assert.AreEqual(ptgClass, result.GetType());
+ ClassicAssert.AreEqual(ptgClass, result.GetType());
return result;
}
[Test]
@@ -786,18 +786,18 @@ public void TestParseNumber()
// bug 33160
ip = (IntPtg)ParseSingleToken("40", typeof(IntPtg));
- Assert.AreEqual(40, ip.Value);
+ ClassicAssert.AreEqual(40, ip.Value);
ip = (IntPtg)ParseSingleToken("40000", typeof(IntPtg));
- Assert.AreEqual(40000, ip.Value);
+ ClassicAssert.AreEqual(40000, ip.Value);
// check the upper edge of the IntPtg range:
ip = (IntPtg)ParseSingleToken("65535", typeof(IntPtg));
- Assert.AreEqual(65535, ip.Value);
+ ClassicAssert.AreEqual(65535, ip.Value);
NumberPtg np = (NumberPtg)ParseSingleToken("65536", typeof(NumberPtg));
- Assert.AreEqual(65536, np.Value, 0);
+ ClassicAssert.AreEqual(65536, np.Value, 0);
np = (NumberPtg)ParseSingleToken("65534.6", typeof(NumberPtg));
- Assert.AreEqual(65534.6, np.Value, 0);
+ ClassicAssert.AreEqual(65534.6, np.Value, 0);
}
[Test]
public void TestMissingArgs()
@@ -836,7 +836,7 @@ public void TestParseErrorLiterals()
private static void ConfirmParseErrorLiteral(ErrPtg expectedToken, String formula)
{
- Assert.AreEqual(expectedToken, ParseSingleToken(formula, typeof(ErrPtg)));
+ ClassicAssert.AreEqual(expectedToken, ParseSingleToken(formula, typeof(ErrPtg)));
}
/**
@@ -851,7 +851,7 @@ private static void ConfirmStringParse(String singleQuotedValue)
String expectedValue = singleQuotedValue.Replace('\'', '"');
StringPtg sp = (StringPtg)ParseSingleToken(formula, typeof(StringPtg));
- Assert.AreEqual(expectedValue, sp.Value);
+ ClassicAssert.AreEqual(expectedValue, sp.Value);
}
[Test]
public void TestParseStringLiterals_bug28754()
@@ -870,7 +870,7 @@ public void TestParseStringLiterals_bug28754()
}
throw;
}
- Assert.AreEqual("test\"ing", sp.Value);
+ ClassicAssert.AreEqual("test\"ing", sp.Value);
HSSFWorkbook wb = new HSSFWorkbook();
try
@@ -886,7 +886,7 @@ public void TestParseStringLiterals_bug28754()
{
Assert.Fail("Identified bug 28754b");
}
- Assert.AreEqual("RIGHT(\"test\"\"ing\",3)", actualCellFormula);
+ ClassicAssert.AreEqual("RIGHT(\"test\"\"ing\",3)", actualCellFormula);
}
finally
{
@@ -913,11 +913,11 @@ public void TestParseSumIfSum()
Ptg[] ptgs;
ptgs = ParseFormula("sum(5, 2, if(3>2, sum(A1:A2), 6))");
formulaString = HSSFFormulaParser.ToFormulaString(null, ptgs);
- Assert.AreEqual("SUM(5,2,IF(3>2,SUM(A1:A2),6))", formulaString);
+ ClassicAssert.AreEqual("SUM(5,2,IF(3>2,SUM(A1:A2),6))", formulaString);
ptgs = ParseFormula("if(1<2,sum(5, 2, if(3>2, sum(A1:A2), 6)),4)");
formulaString = HSSFFormulaParser.ToFormulaString(null, ptgs);
- Assert.AreEqual("IF(1<2,SUM(5,2,IF(3>2,SUM(A1:A2),6)),4)", formulaString);
+ ClassicAssert.AreEqual("IF(1<2,SUM(5,2,IF(3>2,SUM(A1:A2),6)),4)", formulaString);
}
[Test]
public void TestParserErrors()
@@ -952,7 +952,7 @@ private static void ParseExpectedException(String formula)
catch (FormulaParseException e)
{
// expected during successful test
- Assert.IsNotNull(e.Message);
+ ClassicAssert.IsNotNull(e.Message);
}
}
[Test]
@@ -970,7 +970,7 @@ public void TestSetFormulaWithRowBeyond32768_Bug44539()
{
Assert.Fail("Identified bug 44539");
}
- Assert.AreEqual("SUM(A32769:A32770)", cell.CellFormula);
+ ClassicAssert.AreEqual("SUM(A32769:A32770)", cell.CellFormula);
wb.Close();
}
@@ -997,11 +997,11 @@ public void TestSpaceAtStartOfFormula()
throw e;
}
// FormulaParser strips spaces anyway
- Assert.AreEqual("4", formulaString);
+ ClassicAssert.AreEqual("4", formulaString);
ptgs = new Ptg[] { new IntPtg(3), spacePtg, new IntPtg(4), spacePtg, AddPtg.instance, };
formulaString = HSSFFormulaParser.ToFormulaString(null, ptgs);
- Assert.AreEqual("3+4", formulaString);
+ ClassicAssert.AreEqual("3+4", formulaString);
}
/**
@@ -1025,7 +1025,7 @@ public void TestTooFewOperandArgs()
catch (InvalidOperationException e)
{
// expected during successful Test
- Assert.IsTrue(e.Message.StartsWith("Too few arguments supplied to operation"));
+ ClassicAssert.IsTrue(e.Message.StartsWith("Too few arguments supplied to operation"));
}
}
/**
@@ -1042,15 +1042,15 @@ public void TestFuncPtgSelection()
Ptg[] ptgs;
ptgs = ParseFormula("countif(A1:A2, 1)");
- Assert.AreEqual(3, ptgs.Length);
+ ClassicAssert.AreEqual(3, ptgs.Length);
if (typeof(FuncVarPtg) == ptgs[2].GetType())
{
Assert.Fail("Identified bug 44675");
}
- Assert.AreEqual(typeof(FuncPtg), ptgs[2].GetType());
+ ClassicAssert.AreEqual(typeof(FuncPtg), ptgs[2].GetType());
ptgs = ParseFormula("sin(1)");
- Assert.AreEqual(2, ptgs.Length);
- Assert.AreEqual(typeof(FuncPtg), ptgs[1].GetType());
+ ClassicAssert.AreEqual(2, ptgs.Length);
+ ClassicAssert.AreEqual(typeof(FuncPtg), ptgs[1].GetType());
}
[Test]
public void TestWrongNumberOfFunctionArgs()
@@ -1071,7 +1071,7 @@ private static void ConfirmArgCountMsg(String formula, String expectedMessage)
}
catch (Exception e)
{
- Assert.AreEqual(expectedMessage, e.Message);
+ ClassicAssert.AreEqual(expectedMessage, e.Message);
}
}
@@ -1096,12 +1096,12 @@ public void TestRange_bug46643()
typeof(RangePtg)
);
MemFuncPtg mf = (MemFuncPtg)ptgs[0];
- Assert.AreEqual(15, mf.LenRefSubexpression);
+ ClassicAssert.AreEqual(15, mf.LenRefSubexpression);
}
/* package */
private static void ConfirmTokenClasses(Ptg[] ptgs, params Type[] expectedClasses)
{
- Assert.AreEqual(expectedClasses.Length, ptgs.Length);
+ ClassicAssert.AreEqual(expectedClasses.Length, ptgs.Length);
for (int i = 0; i < expectedClasses.Length; i++)
{
if (expectedClasses[i] != ptgs[i].GetType())
@@ -1160,7 +1160,7 @@ public void TestParseErrorTypeFunction()
throw e;
}
ConfirmTokenClasses(ptgs, typeof(RefPtg), typeof(FuncPtg));
- Assert.AreEqual("ERROR.TYPE", ((FuncPtg)ptgs[1]).Name);
+ ClassicAssert.AreEqual("ERROR.TYPE", ((FuncPtg)ptgs[1]).Name);
}
[Test]
public void TestNamedRangeThatLooksLikeCell()
@@ -1189,7 +1189,7 @@ public void TestNamedRangeThatLooksLikeCell()
ICell cell = sheet.CreateRow(0).CreateCell(0);
cell.CellFormula = ("count(pfy1)");
- Assert.AreEqual("COUNT(pfy1)", cell.CellFormula);
+ ClassicAssert.AreEqual("COUNT(pfy1)", cell.CellFormula);
try
{
cell.CellFormula = ("count(pf1)");
@@ -1218,16 +1218,16 @@ public void TestParseAreaRefHighRow_bug45358()
{
Assert.Fail("Identified bug 45358");
}
- Assert.AreEqual(39999, aptg.LastRow);
+ ClassicAssert.AreEqual(39999, aptg.LastRow);
ptgs = HSSFFormulaParser.Parse("Sheet1!A10:A65536", book);
aptg = (AreaI)ptgs[0];
- Assert.AreEqual(65535, aptg.LastRow);
+ ClassicAssert.AreEqual(65535, aptg.LastRow);
// plain area refs should be ok too
ptgs = ParseFormula("A10:A65536");
aptg = (AreaI)ptgs[0];
- Assert.AreEqual(65535, aptg.LastRow);
+ ClassicAssert.AreEqual(65535, aptg.LastRow);
book.Close();
}
[Test]
@@ -1236,12 +1236,12 @@ public void TestParseArray()
Ptg[] ptgs;
ptgs = ParseFormula("mode({1,2,2,#REF!;FALSE,3,3,2})");
ConfirmTokenClasses(ptgs, typeof(ArrayPtg), typeof(FuncVarPtg));
- Assert.AreEqual("{1,2,2,#REF!;FALSE,3,3,2}", ptgs[0].ToFormulaString());
+ ClassicAssert.AreEqual("{1,2,2,#REF!;FALSE,3,3,2}", ptgs[0].ToFormulaString());
ArrayPtg aptg = (ArrayPtg)ptgs[0];
Object[,] values = aptg.GetTokenArrayValues();
- Assert.AreEqual(ErrorConstant.ValueOf(FormulaError.REF.Code), values[0, 3]);
- Assert.AreEqual(false, values[1, 0]);
+ ClassicAssert.AreEqual(ErrorConstant.ValueOf(FormulaError.REF.Code), values[0, 3]);
+ ClassicAssert.AreEqual(false, values[1, 0]);
}
[Test]
public void TestParseStringElementInArray()
@@ -1255,7 +1255,7 @@ public void TestParseStringElementInArray()
// this would cause ClassCastException below
Assert.Fail("Wrong encoding of array element value");
}
- Assert.AreEqual(typeof(String), element.GetType());
+ ClassicAssert.AreEqual(typeof(String), element.GetType());
// make sure the formula encodes OK
int encSize = Ptg.GetEncodedSize(ptgs);
@@ -1268,7 +1268,7 @@ public void TestParseStringElementInArray()
+ "00 00 00 " // Array data: 1 col, 1 row
+ "02 01 00 00 35" // elem (type=string, len=1, "5")
);
- Assert.IsTrue(Arrays.Equals(expData, data));
+ ClassicAssert.IsTrue(Arrays.Equals(expData, data));
int initSize = Ptg.GetEncodedSizeWithoutArrayData(ptgs);
Ptg[] ptgs2 = Ptg.ReadTokens(initSize, new LittleEndianByteArrayInputStream(data));
ConfirmTokenClasses(ptgs2, typeof(ArrayPtg), typeof(IntPtg), typeof(FuncVarPtg));
@@ -1292,13 +1292,13 @@ public void TestParseArrayNegativeElement()
ConfirmTokenClasses(ptgs, typeof(ArrayPtg));
Object element = ((ArrayPtg)ptgs[0]).GetTokenArrayValues()[0, 0];
- Assert.AreEqual(-42.0, (Double)element, 0.0);
+ ClassicAssert.AreEqual(-42.0, (Double)element, 0.0);
// Should be able to handle whitespace between unary minus and digits (Excel
// accepts this formula after presenting the user with a Confirmation dialog).
ptgs = ParseFormula("{- 5}");
element = ((ArrayPtg)ptgs[0]).GetTokenArrayValues()[0, 0];
- Assert.AreEqual(-5.0, (Double)element, 0.0);
+ ClassicAssert.AreEqual(-5.0, (Double)element, 0.0);
}
[Test]
public void TestRangeOperator()
@@ -1309,18 +1309,18 @@ public void TestRangeOperator()
wb.SetSheetName(0, "Sheet1");
cell.CellFormula = ("Sheet1!B$4:Sheet1!$C1"); // explicit range ':' operator
- Assert.AreEqual("Sheet1!B$4:Sheet1!$C1", cell.CellFormula);
+ ClassicAssert.AreEqual("Sheet1!B$4:Sheet1!$C1", cell.CellFormula);
cell.CellFormula = ("Sheet1!B$4:$C1"); // plain area ref
- Assert.AreEqual("Sheet1!B1:$C$4", cell.CellFormula); // note - area ref is normalised
+ ClassicAssert.AreEqual("Sheet1!B1:$C$4", cell.CellFormula); // note - area ref is normalised
cell.CellFormula = ("Sheet1!$C1...B$4"); // different syntax for plain area ref
- Assert.AreEqual("Sheet1!B1:$C$4", cell.CellFormula);
+ ClassicAssert.AreEqual("Sheet1!B1:$C$4", cell.CellFormula);
// with funny sheet name
wb.SetSheetName(0, "A1...A2");
cell.CellFormula = ("A1...A2!B1");
- Assert.AreEqual("A1...A2!B1", cell.CellFormula);
+ ClassicAssert.AreEqual("A1...A2!B1", cell.CellFormula);
wb.Close();
}
@@ -1333,7 +1333,7 @@ public void TestBooleanNamedSheet()
ICell cell = sheet.CreateRow(0).CreateCell(0);
cell.CellFormula = ("'true'!B2");
- Assert.AreEqual("'true'!B2", cell.CellFormula);
+ ClassicAssert.AreEqual("'true'!B2", cell.CellFormula);
wb.Close();
}
@@ -1344,7 +1344,7 @@ public void TestParseExternalWorkbookReference()
ICell cell = wbA.GetSheetAt(0).GetRow(0).GetCell(0);
// make sure formula in sample is as expected
- Assert.AreEqual("[multibookFormulaB.xls]BSheet1!B1", cell.CellFormula);
+ ClassicAssert.AreEqual("[multibookFormulaB.xls]BSheet1!B1", cell.CellFormula);
Ptg[] expectedPtgs = FormulaExtractor.GetPtgs(cell);
ConfirmSingle3DRef(expectedPtgs, 1);
@@ -1358,16 +1358,16 @@ public void TestParseExternalWorkbookReference()
// try setting the same formula in a cell
cell.CellFormula = ("[multibookFormulaB.xls]AnotherSheet!B1");
- Assert.AreEqual("[multibookFormulaB.xls]AnotherSheet!B1", cell.CellFormula);
+ ClassicAssert.AreEqual("[multibookFormulaB.xls]AnotherSheet!B1", cell.CellFormula);
wbA.Close();
}
private static void ConfirmSingle3DRef(Ptg[] ptgs, int expectedExternSheetIndex)
{
- Assert.AreEqual(1, ptgs.Length);
+ ClassicAssert.AreEqual(1, ptgs.Length);
Ptg ptg0 = ptgs[0];
- Assert.IsTrue(ptg0 is Ref3DPtg);
- Assert.AreEqual(expectedExternSheetIndex, ((Ref3DPtg)ptg0).ExternSheetIndex);
+ ClassicAssert.IsTrue(ptg0 is Ref3DPtg);
+ ClassicAssert.AreEqual(expectedExternSheetIndex, ((Ref3DPtg)ptg0).ExternSheetIndex);
}
[Test]
public void TestUnion()
@@ -1390,7 +1390,7 @@ public void TestUnion()
typeof(UnionPtg)
);
MemFuncPtg mf = (MemFuncPtg)ptgs[0];
- Assert.AreEqual(45, mf.LenRefSubexpression);
+ ClassicAssert.AreEqual(45, mf.LenRefSubexpression);
// We don't check the type of the operands.
ConfirmTokenClasses("1,2", typeof(MemAreaPtg), typeof(IntPtg), typeof(IntPtg), typeof(UnionPtg));
@@ -1418,7 +1418,7 @@ public void TestIntersection()
typeof(IntersectionPtg)
);
MemFuncPtg mf = (MemFuncPtg)ptgs[0];
- Assert.AreEqual(45, mf.LenRefSubexpression);
+ ClassicAssert.AreEqual(45, mf.LenRefSubexpression);
// This used to be an error but now parses. Union has the same behaviour.
ConfirmTokenClasses("1 2", typeof(MemAreaPtg), typeof(IntPtg), typeof(IntPtg), typeof(IntersectionPtg));
@@ -1473,11 +1473,11 @@ public void TestBackSlashInNames()
ICell cell_C1 = row.CreateCell(2);
cell_C1.CellFormula = ("POI\\2009");
- Assert.AreEqual("POI\\2009", cell_C1.CellFormula);
+ ClassicAssert.AreEqual("POI\\2009", cell_C1.CellFormula);
ICell cell_D1 = row.CreateCell(2);
cell_D1.CellFormula = ("NOT(POI\\2009=\"3.5-final\")");
- Assert.AreEqual("NOT(POI\\2009=\"3.5-final\")", cell_D1.CellFormula);
+ ClassicAssert.AreEqual("NOT(POI\\2009=\"3.5-final\")", cell_D1.CellFormula);
wb.Close();
}
@@ -1585,7 +1585,7 @@ public void TestExplicitRangeWithTwoSheetNames()
);
MemFuncPtg mf;
mf = (MemFuncPtg)ptgs[0];
- Assert.AreEqual(15, mf.LenRefSubexpression);
+ ClassicAssert.AreEqual(15, mf.LenRefSubexpression);
wb.Close();
}
@@ -1620,9 +1620,9 @@ public void TestComplexExplicitRangeEncodings()
);
MemFuncPtg mf = (MemFuncPtg)ptgs[0];
- Assert.AreEqual(57, mf.LenRefSubexpression);
- Assert.AreEqual("D4:E5", ((AreaPtgBase)ptgs[7]).ToFormulaString());
- Assert.IsTrue(((AttrPtg)ptgs[16]).IsSum);
+ ClassicAssert.AreEqual(57, mf.LenRefSubexpression);
+ ClassicAssert.AreEqual("D4:E5", ((AreaPtgBase)ptgs[7]).ToFormulaString());
+ ClassicAssert.IsTrue(((AttrPtg)ptgs[16]).IsSum);
ptgs = ParseFormula("SUM(A1:B2:C3:D4)");
ConfirmTokenClasses(ptgs,
@@ -1634,7 +1634,7 @@ public void TestComplexExplicitRangeEncodings()
typeof(AttrPtg) // [sum ]
);
MemAreaPtg ma = (MemAreaPtg)ptgs[0];
- Assert.AreEqual(19, ma.LenRefSubexpression);
+ ClassicAssert.AreEqual(19, ma.LenRefSubexpression);
}
@@ -1745,7 +1745,7 @@ public void TestZeroRowRefs()
try
{
ptgs = HSSFFormulaParser.Parse(leadingZeroCellRef, wb);
- Assert.AreEqual("B1", ((RefPtg)ptgs[0]).ToFormulaString());
+ ClassicAssert.AreEqual("B1", ((RefPtg)ptgs[0]).ToFormulaString());
}
catch (FormulaParseException e)
{
@@ -1767,7 +1767,7 @@ public void TestZeroRowRefs()
private static void ConfirmParseException(FormulaParseException e, String expMsg)
{
- Assert.AreEqual(expMsg, e.Message);
+ ClassicAssert.AreEqual(expMsg, e.Message);
}
[Test]
@@ -1775,7 +1775,7 @@ public void Test57196_Formula()
{
HSSFWorkbook wb = new HSSFWorkbook();
Ptg[] ptgs = HSSFFormulaParser.Parse("DEC2HEX(HEX2DEC(O8)-O2+D2)", wb, FormulaType.Cell, -1);
- Assert.IsNotNull(ptgs, "Ptg array should not be null");
+ ClassicAssert.IsNotNull(ptgs, "Ptg array should not be null");
ConfirmTokenClasses(ptgs,
typeof(NameXPtg), // ??
@@ -1795,12 +1795,12 @@ public void Test57196_Formula()
RefPtg d2 = (RefPtg)ptgs[6];
FuncVarPtg dec2Hex = (FuncVarPtg)ptgs[8];
- Assert.AreEqual("O8", o8.ToFormulaString());
- Assert.AreEqual(255, hex2Dec.FunctionIndex);
- //Assert.AreEqual("", hex2Dec.ToString());
- Assert.AreEqual("O2", o2.ToFormulaString());
- Assert.AreEqual("D2", d2.ToFormulaString());
- Assert.AreEqual(255, dec2Hex.FunctionIndex);
+ ClassicAssert.AreEqual("O8", o8.ToFormulaString());
+ ClassicAssert.AreEqual(255, hex2Dec.FunctionIndex);
+ //ClassicAssert.AreEqual("", hex2Dec.ToString());
+ ClassicAssert.AreEqual("O2", o2.ToFormulaString());
+ ClassicAssert.AreEqual("D2", d2.ToFormulaString());
+ ClassicAssert.AreEqual(255, dec2Hex.FunctionIndex);
wb.Close();
}
diff --git a/testcases/main/HSSF/Model/TestFormulaParserEval.cs b/testcases/main/HSSF/Model/TestFormulaParserEval.cs
index 35e035279..8aed02720 100644
--- a/testcases/main/HSSF/Model/TestFormulaParserEval.cs
+++ b/testcases/main/HSSF/Model/TestFormulaParserEval.cs
@@ -18,7 +18,7 @@ limitations under the License.
namespace TestCases.HSSF.Model
{
using System;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.Model;
using NPOI.HSSF.UserModel;
using NPOI.SS.Formula.PTG;
@@ -62,9 +62,9 @@ public void TestWithNamedRange()
private static void ConfirmParseFormula(HSSFWorkbook workbook)
{
Ptg[] ptgs = HSSFFormulaParser.Parse("SUM(testName)", workbook);
- Assert.IsTrue(ptgs.Length == 2, "two tokens expected, got " + ptgs.Length);
- Assert.AreEqual(typeof(NamePtg), ptgs[0].GetType());
- Assert.AreEqual(typeof(AttrPtg), ptgs[1].GetType());
+ ClassicAssert.IsTrue(ptgs.Length == 2, "two tokens expected, got " + ptgs.Length);
+ ClassicAssert.AreEqual(typeof(NamePtg), ptgs[0].GetType());
+ ClassicAssert.AreEqual(typeof(AttrPtg), ptgs[1].GetType());
}
[Test]
@@ -98,8 +98,8 @@ public void TestEvaluateFormulaWithRowBeyond32768_Bug44539()
}
throw;
}
- Assert.AreEqual(NPOI.SS.UserModel.CellType.Numeric, result.CellType);
- Assert.AreEqual(42.0, result.NumberValue, 0.0);
+ ClassicAssert.AreEqual(NPOI.SS.UserModel.CellType.Numeric, result.CellType);
+ ClassicAssert.AreEqual(42.0, result.NumberValue, 0.0);
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/Model/TestFormulaParserIf.cs b/testcases/main/HSSF/Model/TestFormulaParserIf.cs
index 1e30d20cc..fc5b080fd 100644
--- a/testcases/main/HSSF/Model/TestFormulaParserIf.cs
+++ b/testcases/main/HSSF/Model/TestFormulaParserIf.cs
@@ -20,7 +20,7 @@ namespace TestCases.HSSF.Model
using System;
using NPOI.HSSF.Model;
using NPOI.SS.Formula;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.UserModel;
using NPOI.SS.Formula.PTG;
@@ -48,7 +48,7 @@ private static void ConfirmAttrData(Ptg[] ptgs, int i, int expectedData)
throw new AssertionException("Token[" + i + "] was not AttrPtg as expected");
}
AttrPtg attrPtg = (AttrPtg)ptg;
- Assert.AreEqual(expectedData, attrPtg.Data);
+ ClassicAssert.AreEqual(expectedData, attrPtg.Data);
}
[Test]
public void TestSimpleIf()
@@ -168,33 +168,33 @@ public void TestNestedIf()
public void TestEmbeddedIf()
{
Ptg[] ptgs = ParseFormula("IF(3>=1,\"*\",IF(4<>1,\"first\",\"second\"))");
- Assert.AreEqual(17, ptgs.Length);
+ ClassicAssert.AreEqual(17, ptgs.Length);
- Assert.AreEqual(typeof(AttrPtg), ptgs[5].GetType(), "6th Ptg is1 not a goto (Attr) ptg");
- Assert.AreEqual(typeof(NotEqualPtg), ptgs[8].GetType(), "9th Ptg is1 not a not equal ptg");
- Assert.AreEqual(typeof(FuncVarPtg), ptgs[14].GetType(), "15th Ptg is1 not the inner IF variable function ptg");
+ ClassicAssert.AreEqual(typeof(AttrPtg), ptgs[5].GetType(), "6th Ptg is1 not a goto (Attr) ptg");
+ ClassicAssert.AreEqual(typeof(NotEqualPtg), ptgs[8].GetType(), "9th Ptg is1 not a not equal ptg");
+ ClassicAssert.AreEqual(typeof(FuncVarPtg), ptgs[14].GetType(), "15th Ptg is1 not the inner IF variable function ptg");
}
[Test]
public void TestSimpleLogical()
{
Ptg[] ptgs = ParseFormula("IF(A1 commentRecords = new Dictionary();
LinkTable lt = new LinkTable(recList, 0, wrl, commentRecords);
- Assert.IsNotNull(lt);
+ ClassicAssert.IsNotNull(lt);
- Assert.AreEqual(2, commentRecords.Count);
- Assert.IsTrue(recs[1] == commentRecords["name1"]); //== is intentionally not .Equals()!
- Assert.IsTrue(recs[3] == commentRecords["name2"]); //== is intentionally not .Equals()!
+ ClassicAssert.AreEqual(2, commentRecords.Count);
+ ClassicAssert.IsTrue(recs[1] == commentRecords["name1"]); //== is intentionally not .Equals()!
+ ClassicAssert.IsTrue(recs[3] == commentRecords["name2"]); //== is intentionally not .Equals()!
- Assert.AreEqual(2, lt.NumNames);
+ ClassicAssert.AreEqual(2, lt.NumNames);
}
[Test]
public void TestAddNameX()
@@ -215,26 +215,26 @@ public void TestAddNameX()
// [EXTERNSHEET]
// [EOFRecord]
- Assert.AreEqual(5, wrl.Records.Count);
- Assert.IsTrue(wrl[(2)] is SupBookRecord);
+ ClassicAssert.AreEqual(5, wrl.Records.Count);
+ ClassicAssert.IsTrue(wrl[(2)] is SupBookRecord);
SupBookRecord sup1 = (SupBookRecord)wrl[(2)];
- Assert.AreEqual(numberOfSheets, sup1.NumberOfSheets);
- Assert.IsTrue(wrl[(3)] is ExternSheetRecord);
+ ClassicAssert.AreEqual(numberOfSheets, sup1.NumberOfSheets);
+ ClassicAssert.IsTrue(wrl[(3)] is ExternSheetRecord);
ExternSheetRecord extSheet = (ExternSheetRecord)wrl[(3)];
- Assert.AreEqual(0, extSheet.NumOfRefs);
+ ClassicAssert.AreEqual(0, extSheet.NumOfRefs);
- Assert.IsNull(tbl.GetNameXPtg("ISODD", -1));
- Assert.AreEqual(5, wrl.Records.Count); //still have five records
+ ClassicAssert.IsNull(tbl.GetNameXPtg("ISODD", -1));
+ ClassicAssert.AreEqual(5, wrl.Records.Count); //still have five records
NameXPtg namex1 = tbl.AddNameXPtg("ISODD"); // Adds two new rercords
- Assert.AreEqual(0, namex1.SheetRefIndex);
- Assert.AreEqual(0, namex1.NameIndex);
- Assert.AreEqual(namex1.ToString(), tbl.GetNameXPtg("ISODD", -1).ToString());
+ ClassicAssert.AreEqual(0, namex1.SheetRefIndex);
+ ClassicAssert.AreEqual(0, namex1.NameIndex);
+ ClassicAssert.AreEqual(namex1.ToString(), tbl.GetNameXPtg("ISODD", -1).ToString());
// Can only find on the right sheet ref, if restricting
- Assert.AreEqual(namex1.ToString(), tbl.GetNameXPtg("ISODD", 0).ToString());
- Assert.IsNull(tbl.GetNameXPtg("ISODD", 1));
- Assert.IsNull(tbl.GetNameXPtg("ISODD", 2));
+ ClassicAssert.AreEqual(namex1.ToString(), tbl.GetNameXPtg("ISODD", 0).ToString());
+ ClassicAssert.IsNull(tbl.GetNameXPtg("ISODD", 1));
+ ClassicAssert.IsNull(tbl.GetNameXPtg("ISODD", 2));
// assure they are in place:
// [BOFRecord]
// [CountryRecord]
@@ -244,26 +244,26 @@ public void TestAddNameX()
// [EXTERNSHEET]
// [EOFRecord]
- Assert.AreEqual(7, wrl.Records.Count);
- Assert.IsTrue(wrl[(3)] is SupBookRecord);
+ ClassicAssert.AreEqual(7, wrl.Records.Count);
+ ClassicAssert.IsTrue(wrl[(3)] is SupBookRecord);
SupBookRecord sup2 = (SupBookRecord)wrl[(3)];
- Assert.IsTrue(sup2.IsAddInFunctions);
- Assert.IsTrue(wrl[(4)] is ExternalNameRecord);
+ ClassicAssert.IsTrue(sup2.IsAddInFunctions);
+ ClassicAssert.IsTrue(wrl[(4)] is ExternalNameRecord);
ExternalNameRecord ext1 = (ExternalNameRecord)wrl[(4)];
- Assert.AreEqual("ISODD", ext1.Text);
- Assert.IsTrue(wrl[(5)] is ExternSheetRecord);
- Assert.AreEqual(1, extSheet.NumOfRefs);
+ ClassicAssert.AreEqual("ISODD", ext1.Text);
+ ClassicAssert.IsTrue(wrl[(5)] is ExternSheetRecord);
+ ClassicAssert.AreEqual(1, extSheet.NumOfRefs);
//check that
- Assert.AreEqual(0, tbl.ResolveNameXIx(namex1.SheetRefIndex, namex1.NameIndex));
- Assert.AreEqual("ISODD", tbl.ResolveNameXText(namex1.SheetRefIndex, namex1.NameIndex, null));
+ ClassicAssert.AreEqual(0, tbl.ResolveNameXIx(namex1.SheetRefIndex, namex1.NameIndex));
+ ClassicAssert.AreEqual("ISODD", tbl.ResolveNameXText(namex1.SheetRefIndex, namex1.NameIndex, null));
- Assert.IsNull(tbl.GetNameXPtg("ISEVEN", -1));
+ ClassicAssert.IsNull(tbl.GetNameXPtg("ISEVEN", -1));
NameXPtg namex2 = tbl.AddNameXPtg("ISEVEN"); // Adds two new rercords
- Assert.AreEqual(0, namex2.SheetRefIndex);
- Assert.AreEqual(1, namex2.NameIndex); // name index increased by one
- Assert.AreEqual(namex2.ToString(), tbl.GetNameXPtg("ISEVEN", -1).ToString());
- Assert.AreEqual(8, wrl.Records.Count);
+ ClassicAssert.AreEqual(0, namex2.SheetRefIndex);
+ ClassicAssert.AreEqual(1, namex2.NameIndex); // name index increased by one
+ ClassicAssert.AreEqual(namex2.ToString(), tbl.GetNameXPtg("ISEVEN", -1).ToString());
+ ClassicAssert.AreEqual(8, wrl.Records.Count);
// assure they are in place:
// [BOFRecord]
// [CountryRecord]
@@ -273,16 +273,16 @@ public void TestAddNameX()
// [EXTERNALNAME .name = ISEVEN]
// [EXTERNSHEET]
// [EOFRecord]
- Assert.IsTrue(wrl[(3)] is SupBookRecord);
- Assert.IsTrue(wrl[(4)] is ExternalNameRecord);
- Assert.IsTrue(wrl[(5)] is ExternalNameRecord);
- Assert.AreEqual("ISODD", ((ExternalNameRecord)wrl[(4)]).Text);
- Assert.AreEqual("ISEVEN", ((ExternalNameRecord)wrl[(5)]).Text);
- Assert.IsTrue(wrl[(6)] is ExternSheetRecord);
- Assert.IsTrue(wrl[(7)] is EOFRecord);
-
- Assert.AreEqual(0, tbl.ResolveNameXIx(namex2.SheetRefIndex, namex2.NameIndex));
- Assert.AreEqual("ISEVEN", tbl.ResolveNameXText(namex2.SheetRefIndex, namex2.NameIndex, null));
+ ClassicAssert.IsTrue(wrl[(3)] is SupBookRecord);
+ ClassicAssert.IsTrue(wrl[(4)] is ExternalNameRecord);
+ ClassicAssert.IsTrue(wrl[(5)] is ExternalNameRecord);
+ ClassicAssert.AreEqual("ISODD", ((ExternalNameRecord)wrl[(4)]).Text);
+ ClassicAssert.AreEqual("ISEVEN", ((ExternalNameRecord)wrl[(5)]).Text);
+ ClassicAssert.IsTrue(wrl[(6)] is ExternSheetRecord);
+ ClassicAssert.IsTrue(wrl[(7)] is EOFRecord);
+
+ ClassicAssert.AreEqual(0, tbl.ResolveNameXIx(namex2.SheetRefIndex, namex2.NameIndex));
+ ClassicAssert.AreEqual("ISEVEN", tbl.ResolveNameXText(namex2.SheetRefIndex, namex2.NameIndex, null));
}
}
diff --git a/testcases/main/HSSF/Model/TestOperandClassTransformer.cs b/testcases/main/HSSF/Model/TestOperandClassTransformer.cs
index 598748fa7..ea295cfa2 100644
--- a/testcases/main/HSSF/Model/TestOperandClassTransformer.cs
+++ b/testcases/main/HSSF/Model/TestOperandClassTransformer.cs
@@ -18,7 +18,7 @@ limitations under the License.
namespace TestCases.HSSF.Model
{
using System;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.UserModel;
using NPOI.SS.Formula.PTG;
using NPOI.HSSF.Model;
@@ -35,7 +35,7 @@ public class TestOperandClassTransformer
private static Ptg[] ParseFormula(String formula)
{
Ptg[] result = HSSFFormulaParser.Parse(formula, (HSSFWorkbook)null);
- Assert.IsNotNull(result, "Ptg array should not be null");
+ ClassicAssert.IsNotNull(result, "Ptg array should not be null");
return result;
}
@@ -107,8 +107,8 @@ public void TestComplexIRR_bug45041()
FuncVarPtg rowFunc = (FuncVarPtg)ptgs[10];
FuncVarPtg sumifFunc = (FuncVarPtg)ptgs[12];
- Assert.AreEqual("ROW", rowFunc.Name);
- Assert.AreEqual("SUMIF", sumifFunc.Name);
+ ClassicAssert.AreEqual("ROW", rowFunc.Name);
+ ClassicAssert.AreEqual("SUMIF", sumifFunc.Name);
if (rowFunc.PtgClass == Ptg.CLASS_VALUE || sumifFunc.PtgClass == Ptg.CLASS_VALUE)
{
@@ -130,7 +130,7 @@ private void ConfirmFuncClass(Ptg[] ptgs, int i, String expectedFunctionName, by
{
ConfirmTokenClass(ptgs, i, operandClass);
AbstractFunctionPtg afp = (AbstractFunctionPtg)ptgs[i];
- Assert.AreEqual(expectedFunctionName, afp.Name);
+ ClassicAssert.AreEqual(expectedFunctionName, afp.Name);
}
private void ConfirmTokenClass(Ptg[] ptgs, int i, byte operandClass)
diff --git a/testcases/main/HSSF/Model/TestRVA.cs b/testcases/main/HSSF/Model/TestRVA.cs
index c44813bc5..5934405cd 100644
--- a/testcases/main/HSSF/Model/TestRVA.cs
+++ b/testcases/main/HSSF/Model/TestRVA.cs
@@ -19,7 +19,7 @@ namespace TestCases.HSSF.Model
{
using System;
using System.Text;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using TestCases.HSSF;
using NPOI.SS.Formula;
diff --git a/testcases/main/HSSF/Model/TestRowBlocksReader.cs b/testcases/main/HSSF/Model/TestRowBlocksReader.cs
index a06e5e62a..b1ceda7a2 100644
--- a/testcases/main/HSSF/Model/TestRowBlocksReader.cs
+++ b/testcases/main/HSSF/Model/TestRowBlocksReader.cs
@@ -21,7 +21,7 @@ namespace TestCases.HSSF.Model
using NPOI.HSSF.Record;
using NPOI.HSSF.Record.PivotTable;
using NPOI.Util;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.Model;
/**
@@ -51,12 +51,12 @@ public void TestAbnormalPivotTableRecords_bug46280()
Assert.Fail("Identified bug 46280b");
}
RecordStream rbStream = rbr.PlainRecordStream;
- Assert.AreEqual(inRecs[0], rbStream.GetNext());
- Assert.AreEqual(inRecs[1], rbStream.GetNext());
- Assert.IsFalse(rbStream.HasNext());
- Assert.IsTrue(rs.HasNext());
- Assert.AreEqual(inRecs[2], rs.GetNext());
- Assert.AreEqual(inRecs[3], rs.GetNext());
+ ClassicAssert.AreEqual(inRecs[0], rbStream.GetNext());
+ ClassicAssert.AreEqual(inRecs[1], rbStream.GetNext());
+ ClassicAssert.IsFalse(rbStream.HasNext());
+ ClassicAssert.IsTrue(rs.HasNext());
+ ClassicAssert.AreEqual(inRecs[2], rs.GetNext());
+ ClassicAssert.AreEqual(inRecs[3], rs.GetNext());
}
}
}
diff --git a/testcases/main/HSSF/Model/TestSheet.cs b/testcases/main/HSSF/Model/TestSheet.cs
index 9305b322a..d3945b267 100644
--- a/testcases/main/HSSF/Model/TestSheet.cs
+++ b/testcases/main/HSSF/Model/TestSheet.cs
@@ -20,7 +20,7 @@ namespace TestCases.HSSF.Model
using System;
using System.Collections;
using System.IO;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.Record.Aggregates;
using NPOI.HSSF.Record;
using NPOI.HSSF.EventModel;
@@ -67,11 +67,11 @@ public void TestCreateSheet()
Record[] outRecs = GetSheetRecords(sheet, 0);
int pos = 0;
- Assert.IsTrue(outRecs[pos++] is BOFRecord);
- Assert.IsTrue(outRecs[pos++] is IndexRecord);
- Assert.IsTrue(outRecs[pos++] is DimensionsRecord);
- Assert.IsTrue(outRecs[pos++] is WindowTwoRecord);
- Assert.IsTrue(outRecs[pos++] is EOFRecord);
+ ClassicAssert.IsTrue(outRecs[pos++] is BOFRecord);
+ ClassicAssert.IsTrue(outRecs[pos++] is IndexRecord);
+ ClassicAssert.IsTrue(outRecs[pos++] is DimensionsRecord);
+ ClassicAssert.IsTrue(outRecs[pos++] is WindowTwoRecord);
+ ClassicAssert.IsTrue(outRecs[pos++] is EOFRecord);
}
private class MergedCellListener : RecordVisitor
@@ -109,11 +109,11 @@ public void TestAddMergedRegion()
for (int n = 0; n < regionsToAdd; n++)
{
int index = sheet.AddMergedRegion(0, 0, 1, 1);
- Assert.AreEqual(index, n, "Merged region index expected to be " + n + " got " + index);
+ ClassicAssert.AreEqual(index, n, "Merged region index expected to be " + n + " got " + index);
}
//test all the regions were indeed Added
- Assert.AreEqual(sheet.NumMergedRegions, regionsToAdd);
+ ClassicAssert.AreEqual(sheet.NumMergedRegions, regionsToAdd);
//test that the regions were spread out over the appropriate number of records
MergedCellListener mcListener = new MergedCellListener();
@@ -122,7 +122,7 @@ public void TestAddMergedRegion()
int recordsExpected = regionsToAdd / 1027;
if ((regionsToAdd % 1027) != 0)
recordsExpected++;
- Assert.AreEqual(recordsAdded, recordsExpected, "The " + regionsToAdd + " merged regions should have been spRead out over " + recordsExpected + " records, not " + recordsAdded);
+ ClassicAssert.AreEqual(recordsAdded, recordsExpected, "The " + regionsToAdd + " merged regions should have been spRead out over " + recordsExpected + " records, not " + recordsAdded);
// Check we can't Add one with invalid date
try
{
@@ -132,7 +132,7 @@ public void TestAddMergedRegion()
catch (ArgumentException e)
{
// occurs during successful Test
- Assert.AreEqual("The 'to' row (9) must not be less than the 'from' row (10)", e.Message);
+ ClassicAssert.AreEqual("The 'to' row (9) must not be less than the 'from' row (10)", e.Message);
}
try
{
@@ -142,7 +142,7 @@ public void TestAddMergedRegion()
catch (ArgumentException e)
{
// occurs during successful Test
- Assert.AreEqual("The 'to' col (9) must not be less than the 'from' col (10)", e.Message);
+ ClassicAssert.AreEqual("The 'to' col (9) must not be less than the 'from' col (10)", e.Message);
}
}
[Test]
@@ -161,12 +161,12 @@ public void TestRemoveMergedRegion()
{
sheet.RemoveMergedRegion(0);
//assert they have been deleted
- Assert.AreEqual(sheet.NumMergedRegions, regionsToAdd - n - 1, "Num of regions should be " + (regionsToAdd - n - 1) + " not " + sheet.NumMergedRegions);
+ ClassicAssert.AreEqual(sheet.NumMergedRegions, regionsToAdd - n - 1, "Num of regions should be " + (regionsToAdd - n - 1) + " not " + sheet.NumMergedRegions);
}
// merge records are removed from within the MergedCellsTable,
// so the sheet record count should not change
- Assert.AreEqual(nSheetRecords, sheet.Records.Count, "Sheet Records");
+ ClassicAssert.AreEqual(nSheetRecords, sheet.Records.Count, "Sheet Records");
}
/**
@@ -199,7 +199,7 @@ public void TestMovingMergedRegion()
//stub object to throw off list INDEX operations
sheet.RemoveMergedRegion(0);
- Assert.AreEqual(0, sheet.NumMergedRegions, "Should be no more merged regions");
+ ClassicAssert.AreEqual(0, sheet.NumMergedRegions, "Should be no more merged regions");
}
public void TestGetMergedRegionAt()
@@ -245,7 +245,7 @@ public void TestRowAggregation()
records.Add(EOFRecord.instance);
InternalSheet sheet = CreateSheet(records);
- Assert.IsNotNull(sheet.GetRow(2), "Row [2] was skipped");
+ ClassicAssert.IsNotNull(sheet.GetRow(2), "Row [2] was skipped");
}
/**
@@ -262,21 +262,21 @@ public void TestRowPageBreaks()
PageSettingsBlock sheet = worksheet.PageSettings;
sheet.SetRowBreak(0, colFrom, colTo);
- Assert.IsTrue(sheet.IsRowBroken(0), "no row break at 0");
- Assert.AreEqual(1, sheet.NumRowBreaks, "1 row break available");
+ ClassicAssert.IsTrue(sheet.IsRowBroken(0), "no row break at 0");
+ ClassicAssert.AreEqual(1, sheet.NumRowBreaks, "1 row break available");
sheet.SetRowBreak(0, colFrom, colTo);
sheet.SetRowBreak(0, colFrom, colTo);
- Assert.IsTrue(sheet.IsRowBroken(0), "no row break at 0");
- Assert.AreEqual(1, sheet.NumRowBreaks, "1 row break available");
+ ClassicAssert.IsTrue(sheet.IsRowBroken(0), "no row break at 0");
+ ClassicAssert.AreEqual(1, sheet.NumRowBreaks, "1 row break available");
sheet.SetRowBreak(10, colFrom, colTo);
sheet.SetRowBreak(11, colFrom, colTo);
- Assert.IsTrue(sheet.IsRowBroken(10), "no row break at 10");
- Assert.IsTrue(sheet.IsRowBroken(11), "no row break at 11");
- Assert.AreEqual(3, sheet.NumRowBreaks, "3 row break available");
+ ClassicAssert.IsTrue(sheet.IsRowBroken(10), "no row break at 10");
+ ClassicAssert.IsTrue(sheet.IsRowBroken(11), "no row break at 11");
+ ClassicAssert.AreEqual(3, sheet.NumRowBreaks, "3 row break available");
bool is10 = false;
@@ -297,18 +297,18 @@ public void TestRowPageBreaks()
is11 = true;
}
- Assert.IsTrue(is0 && is10 && is11, "one of the breaks didnt make it");
+ ClassicAssert.IsTrue(is0 && is10 && is11, "one of the breaks didnt make it");
sheet.RemoveRowBreak(11);
- Assert.IsFalse(sheet.IsRowBroken(11), "row should be removed");
+ ClassicAssert.IsFalse(sheet.IsRowBroken(11), "row should be removed");
sheet.RemoveRowBreak(0);
- Assert.IsFalse(sheet.IsRowBroken(0), "row should be removed");
+ ClassicAssert.IsFalse(sheet.IsRowBroken(0), "row should be removed");
sheet.RemoveRowBreak(10);
- Assert.IsFalse(sheet.IsRowBroken(10), "row should be removed");
+ ClassicAssert.IsFalse(sheet.IsRowBroken(10), "row should be removed");
- Assert.AreEqual(0, sheet.NumRowBreaks, "no more breaks");
+ ClassicAssert.AreEqual(0, sheet.NumRowBreaks, "no more breaks");
}
/**
@@ -325,22 +325,22 @@ public void TestColPageBreaks()
PageSettingsBlock sheet = worksheet.PageSettings;
sheet.SetColumnBreak(0, rowFrom, rowTo);
- Assert.IsTrue(sheet.IsColumnBroken(0), "no col break at 0");
- Assert.AreEqual(1, sheet.NumColumnBreaks, "1 col break available");
+ ClassicAssert.IsTrue(sheet.IsColumnBroken(0), "no col break at 0");
+ ClassicAssert.AreEqual(1, sheet.NumColumnBreaks, "1 col break available");
sheet.SetColumnBreak(0, rowFrom, rowTo);
- Assert.IsTrue(sheet.IsColumnBroken(0), "no col break at 0");
- Assert.AreEqual(1, sheet.NumColumnBreaks, "1 col break available");
+ ClassicAssert.IsTrue(sheet.IsColumnBroken(0), "no col break at 0");
+ ClassicAssert.AreEqual(1, sheet.NumColumnBreaks, "1 col break available");
sheet.SetColumnBreak(1, rowFrom, rowTo);
sheet.SetColumnBreak(10, rowFrom, rowTo);
sheet.SetColumnBreak(15, rowFrom, rowTo);
- Assert.IsTrue(sheet.IsColumnBroken(1), "no col break at 1");
- Assert.IsTrue(sheet.IsColumnBroken(10), "no col break at 10");
- Assert.IsTrue(sheet.IsColumnBroken(15), "no col break at 15");
- Assert.AreEqual(4, sheet.NumColumnBreaks, "4 col break available");
+ ClassicAssert.IsTrue(sheet.IsColumnBroken(1), "no col break at 1");
+ ClassicAssert.IsTrue(sheet.IsColumnBroken(10), "no col break at 10");
+ ClassicAssert.IsTrue(sheet.IsColumnBroken(15), "no col break at 15");
+ ClassicAssert.AreEqual(4, sheet.NumColumnBreaks, "4 col break available");
bool is10 = false;
bool is0 = false;
@@ -363,21 +363,21 @@ public void TestColPageBreaks()
is15 = true;
}
- Assert.IsTrue(is0 && is1 && is10 && is15, "one of the breaks didnt make it");
+ ClassicAssert.IsTrue(is0 && is1 && is10 && is15, "one of the breaks didnt make it");
sheet.RemoveColumnBreak(15);
- Assert.IsFalse(sheet.IsColumnBroken(15), "column break should not be there");
+ ClassicAssert.IsFalse(sheet.IsColumnBroken(15), "column break should not be there");
sheet.RemoveColumnBreak(0);
- Assert.IsFalse(sheet.IsColumnBroken(0), "column break should not be there");
+ ClassicAssert.IsFalse(sheet.IsColumnBroken(0), "column break should not be there");
sheet.RemoveColumnBreak(1);
- Assert.IsFalse(sheet.IsColumnBroken(1), "column break should not be there");
+ ClassicAssert.IsFalse(sheet.IsColumnBroken(1), "column break should not be there");
sheet.RemoveColumnBreak(10);
- Assert.IsFalse(sheet.IsColumnBroken(10), "column break should not be there");
+ ClassicAssert.IsFalse(sheet.IsColumnBroken(10), "column break should not be there");
- Assert.AreEqual(0, sheet.NumColumnBreaks, "no more breaks");
+ ClassicAssert.AreEqual(0, sheet.NumColumnBreaks, "no more breaks");
}
/**
@@ -394,9 +394,9 @@ public void TestXFIndexForColumn()
// without ColumnInfoRecord
xfindex = sheet.GetXFIndexForColAt((short)0);
- Assert.AreEqual(DEFAULT_IDX, xfindex);
+ ClassicAssert.AreEqual(DEFAULT_IDX, xfindex);
xfindex = sheet.GetXFIndexForColAt((short)1);
- Assert.AreEqual(DEFAULT_IDX, xfindex);
+ ClassicAssert.AreEqual(DEFAULT_IDX, xfindex);
ColumnInfoRecord nci = new ColumnInfoRecord();
sheet.ColumnInfos.InsertColumn(nci);
@@ -406,50 +406,50 @@ public void TestXFIndexForColumn()
nci.LastColumn = ((short)2);
nci.XFIndex = (TEST_IDX);
xfindex = sheet.GetXFIndexForColAt((short)0);
- Assert.AreEqual(DEFAULT_IDX, xfindex);
+ ClassicAssert.AreEqual(DEFAULT_IDX, xfindex);
xfindex = sheet.GetXFIndexForColAt((short)1);
- Assert.AreEqual(DEFAULT_IDX, xfindex);
+ ClassicAssert.AreEqual(DEFAULT_IDX, xfindex);
xfindex = sheet.GetXFIndexForColAt((short)2);
- Assert.AreEqual(TEST_IDX, xfindex);
+ ClassicAssert.AreEqual(TEST_IDX, xfindex);
xfindex = sheet.GetXFIndexForColAt((short)3);
- Assert.AreEqual(DEFAULT_IDX, xfindex);
+ ClassicAssert.AreEqual(DEFAULT_IDX, xfindex);
// ten column ColumnInfoRecord
nci.FirstColumn = ((short)2);
nci.LastColumn = ((short)11);
nci.XFIndex = (TEST_IDX);
xfindex = sheet.GetXFIndexForColAt((short)1);
- Assert.AreEqual(DEFAULT_IDX, xfindex);
+ ClassicAssert.AreEqual(DEFAULT_IDX, xfindex);
xfindex = sheet.GetXFIndexForColAt((short)2);
- Assert.AreEqual(TEST_IDX, xfindex);
+ ClassicAssert.AreEqual(TEST_IDX, xfindex);
xfindex = sheet.GetXFIndexForColAt((short)6);
- Assert.AreEqual(TEST_IDX, xfindex);
+ ClassicAssert.AreEqual(TEST_IDX, xfindex);
xfindex = sheet.GetXFIndexForColAt((short)11);
- Assert.AreEqual(TEST_IDX, xfindex);
+ ClassicAssert.AreEqual(TEST_IDX, xfindex);
xfindex = sheet.GetXFIndexForColAt((short)12);
- Assert.AreEqual(DEFAULT_IDX, xfindex);
+ ClassicAssert.AreEqual(DEFAULT_IDX, xfindex);
// single column ColumnInfoRecord starting at index 0
nci.FirstColumn = ((short)0);
nci.LastColumn = ((short)0);
nci.XFIndex = (TEST_IDX);
xfindex = sheet.GetXFIndexForColAt((short)0);
- Assert.AreEqual(TEST_IDX, xfindex);
+ ClassicAssert.AreEqual(TEST_IDX, xfindex);
xfindex = sheet.GetXFIndexForColAt((short)1);
- Assert.AreEqual(DEFAULT_IDX, xfindex);
+ ClassicAssert.AreEqual(DEFAULT_IDX, xfindex);
// ten column ColumnInfoRecord starting at index 0
nci.FirstColumn = ((short)0);
nci.LastColumn = ((short)9);
nci.XFIndex = (TEST_IDX);
xfindex = sheet.GetXFIndexForColAt((short)0);
- Assert.AreEqual(TEST_IDX, xfindex);
+ ClassicAssert.AreEqual(TEST_IDX, xfindex);
xfindex = sheet.GetXFIndexForColAt((short)7);
- Assert.AreEqual(TEST_IDX, xfindex);
+ ClassicAssert.AreEqual(TEST_IDX, xfindex);
xfindex = sheet.GetXFIndexForColAt((short)9);
- Assert.AreEqual(TEST_IDX, xfindex);
+ ClassicAssert.AreEqual(TEST_IDX, xfindex);
xfindex = sheet.GetXFIndexForColAt((short)10);
- Assert.AreEqual(DEFAULT_IDX, xfindex);
+ ClassicAssert.AreEqual(DEFAULT_IDX, xfindex);
}
private class SizeCheckingRecordVisitor : RecordVisitor
{
@@ -501,7 +501,7 @@ public void TestUncalcSize_bug45066()
// all contained records. Now this Test is much less interesting
SizeCheckingRecordVisitor scrv = new SizeCheckingRecordVisitor();
sheet.VisitContainedRecords(scrv, 0);
- Assert.AreEqual(90, scrv.TotalSize);
+ ClassicAssert.AreEqual(90, scrv.TotalSize);
}
/**
@@ -534,7 +534,7 @@ public void TestRowValueAggregatesOrder_bug45145()
throw new AssertionException("Identified bug 45145");
}
- Assert.AreEqual(242, dbCellRecordPos);
+ ClassicAssert.AreEqual(242, dbCellRecordPos);
}
/**
@@ -601,7 +601,7 @@ public void TestGutsRecord_bug45640()
{
throw new AssertionException("Identified bug 45640");
}
- Assert.AreEqual(1, count);
+ ClassicAssert.AreEqual(1, count);
}
public void TestMisplacedMergedCellsRecords_bug45699()
@@ -615,7 +615,7 @@ public void TestMisplacedMergedCellsRecords_bug45699()
{
throw new AssertionException("Identified bug 45699");
}
- Assert.AreEqual("Informations", cell.RichStringCellValue.String);
+ ClassicAssert.AreEqual("Informations", cell.RichStringCellValue.String);
}
/**
* In 3.1, setting margins between creating first row and first cell caused an exception.
@@ -680,12 +680,12 @@ public void TestMissingDims()
RecordInspector.RecordCollector rv = new RecordInspector.RecordCollector();
sheet.VisitContainedRecords(rv, rowIx);
Record[] outRecs = rv.Records;
- Assert.AreEqual(8, outRecs.Length);
+ ClassicAssert.AreEqual(8, outRecs.Length);
DimensionsRecord dims = (DimensionsRecord)outRecs[5];
- Assert.AreEqual(rowIx, dims.FirstRow);
- Assert.AreEqual(rowIx, dims.LastRow);
- Assert.AreEqual(colIx, dims.FirstCol);
- Assert.AreEqual(colIx, dims.LastCol);
+ ClassicAssert.AreEqual(rowIx, dims.FirstRow);
+ ClassicAssert.AreEqual(rowIx, dims.LastRow);
+ ClassicAssert.AreEqual(colIx, dims.FirstCol);
+ ClassicAssert.AreEqual(colIx, dims.LastCol);
}
/**
@@ -702,8 +702,8 @@ public void TestShiftFormulasAddCondFormat_bug46547()
InternalSheet sheet = InternalSheet.CreateSheet();
IList sheetRecs = sheet.Records;
- //Assert.AreEqual(23, sheetRecs.Count);
- Assert.AreEqual(24, sheetRecs.Count); //for SheetExtRecord
+ //ClassicAssert.AreEqual(23, sheetRecs.Count);
+ ClassicAssert.AreEqual(24, sheetRecs.Count); //for SheetExtRecord
FormulaShifter shifter = FormulaShifter.CreateForRowShift(0, "", 0, 0, 1, SpreadsheetVersion.EXCEL97);
sheet.UpdateFormulasAfterCellShift(shifter, 0);
@@ -711,8 +711,8 @@ public void TestShiftFormulasAddCondFormat_bug46547()
{
throw new AssertionException("Identified bug 46547a");
}
- //Assert.AreEqual(23, sheetRecs.Count);
- Assert.AreEqual(24, sheetRecs.Count); //for SheetExtRecord
+ //ClassicAssert.AreEqual(23, sheetRecs.Count);
+ ClassicAssert.AreEqual(24, sheetRecs.Count); //for SheetExtRecord
}
/**
* Bug 46547 happened when attempting to Add conditional formatting to a sheet
@@ -736,7 +736,7 @@ public void TestAddCondFormatAfterDataValidation_bug46547()
{
throw new AssertionException("Identified bug 46547b");
}
- Assert.IsNotNull(cft);
+ ClassicAssert.IsNotNull(cft);
}
[Test]
public void TestCloneMulBlank_bug46776()
@@ -770,7 +770,7 @@ public void TestCloneMulBlank_bug46776()
TestCases.HSSF.UserModel.RecordInspector.RecordCollector rc = new TestCases.HSSF.UserModel.RecordInspector.RecordCollector();
sheet2.VisitContainedRecords(rc, 0);
Record[] clonedRecs = rc.Records;
- Assert.AreEqual(recs.Length + 2, clonedRecs.Length); // +2 for INDEX and DBCELL
+ ClassicAssert.AreEqual(recs.Length + 2, clonedRecs.Length); // +2 for INDEX and DBCELL
}
[Test]
public void TestCreateAggregate()
@@ -855,29 +855,29 @@ private void ConfirmAggregatedRecords(List recordStream)
DrawingManager2 drawingManager = new DrawingManager2(new EscherDggRecord());
sheet.AggregateDrawingRecords(drawingManager, false);
- Assert.AreEqual(4, sheetRecords.Count);
- Assert.AreEqual(BOFRecord.sid, ((Record)sheetRecords[0]).Sid);
- Assert.AreEqual(EscherAggregate.sid, ((Record)sheetRecords[1]).Sid);
- Assert.AreEqual(WindowTwoRecord.sid, ((Record)sheetRecords[2]).Sid);
- Assert.AreEqual(EOFRecord.sid, ((Record)sheetRecords[3]).Sid);
+ ClassicAssert.AreEqual(4, sheetRecords.Count);
+ ClassicAssert.AreEqual(BOFRecord.sid, ((Record)sheetRecords[0]).Sid);
+ ClassicAssert.AreEqual(EscherAggregate.sid, ((Record)sheetRecords[1]).Sid);
+ ClassicAssert.AreEqual(WindowTwoRecord.sid, ((Record)sheetRecords[2]).Sid);
+ ClassicAssert.AreEqual(EOFRecord.sid, ((Record)sheetRecords[3]).Sid);
}
[Test]
public void TestSheetDimensions()
{
InternalSheet sheet = InternalSheet.CreateSheet();
DimensionsRecord dimensions = (DimensionsRecord)sheet.FindFirstRecordBySid(DimensionsRecord.sid);
- Assert.AreEqual(0, dimensions.FirstCol);
- Assert.AreEqual(0, dimensions.FirstRow);
- Assert.AreEqual(1, dimensions.LastCol); // plus pne
- Assert.AreEqual(1, dimensions.LastRow); // plus pne
+ ClassicAssert.AreEqual(0, dimensions.FirstCol);
+ ClassicAssert.AreEqual(0, dimensions.FirstRow);
+ ClassicAssert.AreEqual(1, dimensions.LastCol); // plus pne
+ ClassicAssert.AreEqual(1, dimensions.LastRow); // plus pne
RowRecord rr = new RowRecord(0);
sheet.AddRow(rr);
- Assert.AreEqual(0, dimensions.FirstCol);
- Assert.AreEqual(0, dimensions.FirstRow);
- Assert.AreEqual(1, dimensions.LastCol);
- Assert.AreEqual(1, dimensions.LastRow);
+ ClassicAssert.AreEqual(0, dimensions.FirstCol);
+ ClassicAssert.AreEqual(0, dimensions.FirstRow);
+ ClassicAssert.AreEqual(1, dimensions.LastCol);
+ ClassicAssert.AreEqual(1, dimensions.LastRow);
CellValueRecordInterface cvr;
@@ -886,20 +886,20 @@ public void TestSheetDimensions()
cvr.Row = (0);
sheet.AddValueRecord(0, cvr);
- Assert.AreEqual(0, dimensions.FirstCol);
- Assert.AreEqual(0, dimensions.FirstRow);
- Assert.AreEqual(1, dimensions.LastCol);
- Assert.AreEqual(1, dimensions.LastRow);
+ ClassicAssert.AreEqual(0, dimensions.FirstCol);
+ ClassicAssert.AreEqual(0, dimensions.FirstRow);
+ ClassicAssert.AreEqual(1, dimensions.LastCol);
+ ClassicAssert.AreEqual(1, dimensions.LastRow);
cvr = new BlankRecord();
cvr.Column = ((short)1);
cvr.Row = (0);
sheet.AddValueRecord(0, cvr);
- Assert.AreEqual(0, dimensions.FirstCol);
- Assert.AreEqual(0, dimensions.FirstRow);
- Assert.AreEqual(2, dimensions.LastCol); //YK: failed until Bugzilla 53414 was fixed
- Assert.AreEqual(1, dimensions.LastRow);
+ ClassicAssert.AreEqual(0, dimensions.FirstCol);
+ ClassicAssert.AreEqual(0, dimensions.FirstRow);
+ ClassicAssert.AreEqual(2, dimensions.LastCol); //YK: failed until Bugzilla 53414 was fixed
+ ClassicAssert.AreEqual(1, dimensions.LastRow);
}
}
}
diff --git a/testcases/main/HSSF/Model/TestSheetAdditional.cs b/testcases/main/HSSF/Model/TestSheetAdditional.cs
index 6b53794e7..4143e55ee 100644
--- a/testcases/main/HSSF/Model/TestSheetAdditional.cs
+++ b/testcases/main/HSSF/Model/TestSheetAdditional.cs
@@ -20,7 +20,7 @@ namespace TestCases.HSSF.Model
using System;
using System.Collections;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.Record;
using NPOI.HSSF.Model;
@@ -46,21 +46,21 @@ public void TestGetCellWidth()
sheet._columnInfos.InsertColumn(nci);
- Assert.AreEqual(100, sheet.GetColumnWidth(5));
- Assert.AreEqual(100, sheet.GetColumnWidth(6));
- Assert.AreEqual(100, sheet.GetColumnWidth(7));
- Assert.AreEqual(100, sheet.GetColumnWidth(8));
- Assert.AreEqual(100, sheet.GetColumnWidth(9));
- Assert.AreEqual(100, sheet.GetColumnWidth(10));
+ ClassicAssert.AreEqual(100, sheet.GetColumnWidth(5));
+ ClassicAssert.AreEqual(100, sheet.GetColumnWidth(6));
+ ClassicAssert.AreEqual(100, sheet.GetColumnWidth(7));
+ ClassicAssert.AreEqual(100, sheet.GetColumnWidth(8));
+ ClassicAssert.AreEqual(100, sheet.GetColumnWidth(9));
+ ClassicAssert.AreEqual(100, sheet.GetColumnWidth(10));
sheet.SetColumnWidth(6, 200);
- Assert.AreEqual(100, sheet.GetColumnWidth(5));
- Assert.AreEqual(200, sheet.GetColumnWidth(6));
- Assert.AreEqual(100, sheet.GetColumnWidth(7));
- Assert.AreEqual(100, sheet.GetColumnWidth(8));
- Assert.AreEqual(100, sheet.GetColumnWidth(9));
- Assert.AreEqual(100, sheet.GetColumnWidth(10));
+ ClassicAssert.AreEqual(100, sheet.GetColumnWidth(5));
+ ClassicAssert.AreEqual(200, sheet.GetColumnWidth(6));
+ ClassicAssert.AreEqual(100, sheet.GetColumnWidth(7));
+ ClassicAssert.AreEqual(100, sheet.GetColumnWidth(8));
+ ClassicAssert.AreEqual(100, sheet.GetColumnWidth(9));
+ ClassicAssert.AreEqual(100, sheet.GetColumnWidth(10));
}
[Test]
public void TestMaxColumnWidth()
@@ -74,7 +74,7 @@ public void TestMaxColumnWidth()
}
catch (ArgumentException e)
{
- Assert.AreEqual(e.Message, "The maximum column width for an individual cell is 255 characters.");
+ ClassicAssert.AreEqual(e.Message, "The maximum column width for an individual cell is 255 characters.");
}
}
}
diff --git a/testcases/main/HSSF/Model/TestWorkbook.cs b/testcases/main/HSSF/Model/TestWorkbook.cs
index f0f4c3c0e..1219e006a 100644
--- a/testcases/main/HSSF/Model/TestWorkbook.cs
+++ b/testcases/main/HSSF/Model/TestWorkbook.cs
@@ -18,7 +18,7 @@ limitations under the License.
namespace TestCases.HSSF.Model
{
using System;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.Record;
using NPOI.HSSF.UserModel;
using NPOI.SS.Formula;
@@ -42,56 +42,56 @@ public void TestFontStuff()
HSSFWorkbook hwb = new HSSFWorkbook();
InternalWorkbook wb = TestHSSFWorkbook.GetInternalWorkbook(hwb);
- Assert.AreEqual(4, wb.NumberOfFontRecords);
- Assert.AreEqual(68, wb.Records.Count);
+ ClassicAssert.AreEqual(4, wb.NumberOfFontRecords);
+ ClassicAssert.AreEqual(68, wb.Records.Count);
FontRecord f1 = wb.GetFontRecordAt(0);
FontRecord f4 = wb.GetFontRecordAt(3);
- Assert.AreEqual(0, wb.GetFontIndex(f1));
- Assert.AreEqual(3, wb.GetFontIndex(f4));
+ ClassicAssert.AreEqual(0, wb.GetFontIndex(f1));
+ ClassicAssert.AreEqual(3, wb.GetFontIndex(f4));
- Assert.AreEqual(f1, wb.GetFontRecordAt(0));
- Assert.AreEqual(f4, wb.GetFontRecordAt(3));
+ ClassicAssert.AreEqual(f1, wb.GetFontRecordAt(0));
+ ClassicAssert.AreEqual(f4, wb.GetFontRecordAt(3));
// There is no 4! new ones go in at 5
FontRecord n = wb.CreateNewFont();
- Assert.AreEqual(69, wb.Records.Count);
- Assert.AreEqual(5, wb.NumberOfFontRecords);
- Assert.AreEqual(5, wb.GetFontIndex(n));
- Assert.AreEqual(n, wb.GetFontRecordAt(5));
+ ClassicAssert.AreEqual(69, wb.Records.Count);
+ ClassicAssert.AreEqual(5, wb.NumberOfFontRecords);
+ ClassicAssert.AreEqual(5, wb.GetFontIndex(n));
+ ClassicAssert.AreEqual(n, wb.GetFontRecordAt(5));
// And another
FontRecord n6 = wb.CreateNewFont();
- Assert.AreEqual(70, wb.Records.Count);
- Assert.AreEqual(6, wb.NumberOfFontRecords);
- Assert.AreEqual(6, wb.GetFontIndex(n6));
- Assert.AreEqual(n6, wb.GetFontRecordAt(6));
+ ClassicAssert.AreEqual(70, wb.Records.Count);
+ ClassicAssert.AreEqual(6, wb.NumberOfFontRecords);
+ ClassicAssert.AreEqual(6, wb.GetFontIndex(n6));
+ ClassicAssert.AreEqual(n6, wb.GetFontRecordAt(6));
// Now remove the one formerly at 5
- Assert.AreEqual(70, wb.Records.Count);
+ ClassicAssert.AreEqual(70, wb.Records.Count);
wb.RemoveFontRecord(n);
// Check that 6 has gone to 5
- Assert.AreEqual(69, wb.Records.Count);
- Assert.AreEqual(5, wb.NumberOfFontRecords);
- Assert.AreEqual(5, wb.GetFontIndex(n6));
- Assert.AreEqual(n6, wb.GetFontRecordAt(5));
+ ClassicAssert.AreEqual(69, wb.Records.Count);
+ ClassicAssert.AreEqual(5, wb.NumberOfFontRecords);
+ ClassicAssert.AreEqual(5, wb.GetFontIndex(n6));
+ ClassicAssert.AreEqual(n6, wb.GetFontRecordAt(5));
// Check that the earlier ones are unChanged
- Assert.AreEqual(0, wb.GetFontIndex(f1));
- Assert.AreEqual(3, wb.GetFontIndex(f4));
- Assert.AreEqual(f1, wb.GetFontRecordAt(0));
- Assert.AreEqual(f4, wb.GetFontRecordAt(3));
+ ClassicAssert.AreEqual(0, wb.GetFontIndex(f1));
+ ClassicAssert.AreEqual(3, wb.GetFontIndex(f4));
+ ClassicAssert.AreEqual(f1, wb.GetFontRecordAt(0));
+ ClassicAssert.AreEqual(f4, wb.GetFontRecordAt(3));
// Finally, add another one
FontRecord n7 = wb.CreateNewFont();
- Assert.AreEqual(70, wb.Records.Count);
- Assert.AreEqual(6, wb.NumberOfFontRecords);
- Assert.AreEqual(6, wb.GetFontIndex(n7));
- Assert.AreEqual(n7, wb.GetFontRecordAt(6));
+ ClassicAssert.AreEqual(70, wb.Records.Count);
+ ClassicAssert.AreEqual(6, wb.NumberOfFontRecords);
+ ClassicAssert.AreEqual(6, wb.GetFontIndex(n7));
+ ClassicAssert.AreEqual(n7, wb.GetFontRecordAt(6));
hwb.Close();
}
@@ -111,7 +111,7 @@ public void TestAddNameX()
{
HSSFWorkbook hwb = new HSSFWorkbook();
InternalWorkbook wb = TestHSSFWorkbook.GetInternalWorkbook(hwb);
- Assert.IsNotNull(wb.GetNameXPtg("ISODD", UDFFinder.GetDefault()));
+ ClassicAssert.IsNotNull(wb.GetNameXPtg("ISODD", UDFFinder.GetDefault()));
FreeRefFunction1 NotImplemented = new FreeRefFunction1();
@@ -123,10 +123,10 @@ public void TestAddNameX()
UDFFinder udff2 = new DefaultUDFFinder(new String[] { "myFunc2", },
new FreeRefFunction[] { NotImplemented });
UDFFinder udff = new AggregatingUDFFinder(udff1, udff2);
- Assert.IsNotNull(wb.GetNameXPtg("myFunc", udff));
- Assert.IsNotNull(wb.GetNameXPtg("myFunc2", udff));
+ ClassicAssert.IsNotNull(wb.GetNameXPtg("myFunc", udff));
+ ClassicAssert.IsNotNull(wb.GetNameXPtg("myFunc2", udff));
- Assert.IsNull(wb.GetNameXPtg("myFunc3", udff)); // myFunc3 is unknown
+ ClassicAssert.IsNull(wb.GetNameXPtg("myFunc3", udff)); // myFunc3 is unknown
hwb.Close();
}
@@ -134,27 +134,27 @@ public void TestAddNameX()
public void TestRecalcId()
{
HSSFWorkbook wb = new HSSFWorkbook();
- Assert.IsFalse(wb.ForceFormulaRecalculation);
+ ClassicAssert.IsFalse(wb.ForceFormulaRecalculation);
InternalWorkbook iwb = TestHSSFWorkbook.GetInternalWorkbook(wb);
int countryPos = iwb.FindFirstRecordLocBySid(CountryRecord.sid);
- Assert.IsTrue(countryPos != -1);
+ ClassicAssert.IsTrue(countryPos != -1);
// RecalcIdRecord is not present in new workbooks
- Assert.AreEqual(null, iwb.FindFirstRecordBySid(RecalcIdRecord.sid));
+ ClassicAssert.AreEqual(null, iwb.FindFirstRecordBySid(RecalcIdRecord.sid));
RecalcIdRecord record = iwb.RecalcId;
- Assert.IsNotNull(record);
- Assert.AreSame(record, iwb.RecalcId);
+ ClassicAssert.IsNotNull(record);
+ ClassicAssert.AreSame(record, iwb.RecalcId);
- Assert.AreSame(record, iwb.FindFirstRecordBySid(RecalcIdRecord.sid));
- Assert.AreEqual(countryPos + 1, iwb.FindFirstRecordLocBySid(RecalcIdRecord.sid));
+ ClassicAssert.AreSame(record, iwb.FindFirstRecordBySid(RecalcIdRecord.sid));
+ ClassicAssert.AreEqual(countryPos + 1, iwb.FindFirstRecordLocBySid(RecalcIdRecord.sid));
record.EngineId = (/*setter*/100);
- Assert.AreEqual(100, record.EngineId);
- Assert.IsTrue(wb.ForceFormulaRecalculation);
+ ClassicAssert.AreEqual(100, record.EngineId);
+ ClassicAssert.IsTrue(wb.ForceFormulaRecalculation);
wb.ForceFormulaRecalculation = (/*setter*/true); // resets the EngineId flag to zero
- Assert.AreEqual(0, record.EngineId);
- Assert.IsFalse(wb.ForceFormulaRecalculation);
+ ClassicAssert.AreEqual(0, record.EngineId);
+ ClassicAssert.IsFalse(wb.ForceFormulaRecalculation);
wb.Close();
}
diff --git a/testcases/main/HSSF/Record/Aggregates/Chart/TestChartSheetAggregate.cs b/testcases/main/HSSF/Record/Aggregates/Chart/TestChartSheetAggregate.cs
index 92a4db39c..0705753a6 100644
--- a/testcases/main/HSSF/Record/Aggregates/Chart/TestChartSheetAggregate.cs
+++ b/testcases/main/HSSF/Record/Aggregates/Chart/TestChartSheetAggregate.cs
@@ -17,7 +17,7 @@ limitations under the License.
using System;
using System.Collections.Generic;
using System.Text;
-using NUnit.Framework;
+using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.UserModel;
using TestCases.HSSF.UserModel;
@@ -49,7 +49,7 @@ public void TestStartBlock_EndBlock_Write()
Record[] outRecs = rv.Records;
for (int i = 0; i < outRecs.Length; i++)
{
- Assert.AreEqual(sheetRecs[pos + i].GetType(), outRecs[i].GetType());
+ ClassicAssert.AreEqual(sheetRecs[pos + i].GetType(), outRecs[i].GetType());
}
}
}
diff --git a/testcases/main/HSSF/Record/Aggregates/TestCFRecordsAggregate.cs b/testcases/main/HSSF/Record/Aggregates/TestCFRecordsAggregate.cs
index 9c29994de..2073ea8af 100644
--- a/testcases/main/HSSF/Record/Aggregates/TestCFRecordsAggregate.cs
+++ b/testcases/main/HSSF/Record/Aggregates/TestCFRecordsAggregate.cs
@@ -21,7 +21,7 @@ namespace TestCases.HSSF.Record.Aggregates
using System.IO;
using System.Collections;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.Record;
using NPOI.HSSF.Record.Aggregates;
@@ -73,41 +73,41 @@ public void TestCFRecordsAggregate1()
recs = RecordFactory.CreateRecords(in1);
// Verify
- Assert.IsNotNull(recs);
- Assert.AreEqual(4, recs.Count);
+ ClassicAssert.IsNotNull(recs);
+ ClassicAssert.AreEqual(4, recs.Count);
header = (CFHeaderRecord)recs[0];
rule1 = (CFRuleRecord)recs[1];
- Assert.IsNotNull(rule1);
+ ClassicAssert.IsNotNull(rule1);
rule2 = (CFRuleRecord)recs[2];
- Assert.IsNotNull(rule2);
+ ClassicAssert.IsNotNull(rule2);
rule3 = (CFRuleRecord)recs[3];
- Assert.IsNotNull(rule3);
+ ClassicAssert.IsNotNull(rule3);
cellRanges = header.CellRanges;
- Assert.AreEqual(2, cellRanges.Length);
- Assert.AreEqual(3, header.NumberOfConditionalFormats);
- Assert.IsFalse(header.NeedRecalculation);
+ ClassicAssert.AreEqual(2, cellRanges.Length);
+ ClassicAssert.AreEqual(3, header.NumberOfConditionalFormats);
+ ClassicAssert.IsFalse(header.NeedRecalculation);
record = CFRecordsAggregate.CreateCFAggregate(new RecordStream(recs, 0));
record = record.CloneCFAggregate();
- Assert.IsNotNull(record.Header);
- Assert.AreEqual(3, record.NumberOfRules);
+ ClassicAssert.IsNotNull(record.Header);
+ ClassicAssert.AreEqual(3, record.NumberOfRules);
header = record.Header;
rule1 = record.GetRule(0);
- Assert.IsNotNull(rule1);
+ ClassicAssert.IsNotNull(rule1);
rule2 = record.GetRule(1);
- Assert.IsNotNull(rule2);
+ ClassicAssert.IsNotNull(rule2);
rule3 = record.GetRule(2);
- Assert.IsNotNull(rule3);
+ ClassicAssert.IsNotNull(rule3);
cellRanges = header.CellRanges;
- Assert.AreEqual(2, cellRanges.Length);
- Assert.AreEqual(3, header.NumberOfConditionalFormats);
- Assert.IsFalse(header.NeedRecalculation);
+ ClassicAssert.AreEqual(2, cellRanges.Length);
+ ClassicAssert.AreEqual(3, header.NumberOfConditionalFormats);
+ ClassicAssert.IsFalse(header.NeedRecalculation);
}
/**
* Make sure that the CF Header record is properly updated with the number of rules
@@ -134,7 +134,7 @@ public void TestNRules()
{
throw new AssertionException("Identified bug 45682 b");
}
- Assert.AreEqual(rules.Length, nRules);
+ ClassicAssert.AreEqual(rules.Length, nRules);
}
[Test]
@@ -159,7 +159,7 @@ public void TestCantMixTypes()
rules = new CFRuleBase[] { CFRuleRecord.Create(sheet, "7") };
CFRecordsAggregate agg = new CFRecordsAggregate(cellRanges, rules);
- Assert.IsTrue(agg.Header.NeedRecalculation);
+ ClassicAssert.IsTrue(agg.Header.NeedRecalculation);
try
{
diff --git a/testcases/main/HSSF/Record/Aggregates/TestColumnInfoRecordsAggregate.cs b/testcases/main/HSSF/Record/Aggregates/TestColumnInfoRecordsAggregate.cs
index 56507c27c..58bf55241 100644
--- a/testcases/main/HSSF/Record/Aggregates/TestColumnInfoRecordsAggregate.cs
+++ b/testcases/main/HSSF/Record/Aggregates/TestColumnInfoRecordsAggregate.cs
@@ -20,7 +20,7 @@ namespace TestCases.HSSF.Record.Aggregates
using System;
using System.Collections;
using NPOI.HSSF.Record;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.Record.Aggregates;
/**
@@ -38,7 +38,7 @@ public void TestRecordSize()
agg.InsertColumn(CreateColInfo(4, 7));
agg.InsertColumn(CreateColInfo(8, 8));
agg.GroupColumnRange(2, 5, true);
- Assert.AreEqual(4, agg.NumColumns);
+ ClassicAssert.AreEqual(4, agg.NumColumns);
ConfirmSerializedSize(agg);
@@ -52,7 +52,7 @@ private static void ConfirmSerializedSize(RecordBase cirAgg)
int estimatedSize = cirAgg.RecordSize;
byte[] buf = new byte[estimatedSize];
int serializedSize = cirAgg.Serialize(0, buf);
- Assert.AreEqual(estimatedSize, serializedSize);
+ ClassicAssert.AreEqual(estimatedSize, serializedSize);
}
private static ColumnInfoRecord CreateColInfo(int firstCol, int lastCol)
@@ -100,7 +100,7 @@ public void TestGroupColumns_bug45639()
throw new AssertionException("Identified bug 45639");
}
ColumnInfoRecord[] cirs = CIRCollector.GetRecords(agg);
- Assert.AreEqual(5, cirs.Length);
+ ClassicAssert.AreEqual(5, cirs.Length);
ConfirmCIR(cirs, 0, 1, 3, 1, false, false);
ConfirmCIR(cirs, 1, 4, 6, 2, false, false);
ConfirmCIR(cirs, 2, 7, 9, 3, false, false);
@@ -125,7 +125,7 @@ public void TestHiddenAfterExpanding()
agg.CollapseColumn(3);
cirs = CIRCollector.GetRecords(agg);
- Assert.AreEqual(5, cirs.Length);
+ ClassicAssert.AreEqual(5, cirs.Length);
ConfirmCIR(cirs, 0, 1, 3, 1, true, false);
ConfirmCIR(cirs, 1, 4, 12, 2, true, false);
ConfirmCIR(cirs, 2, 13, 13, 1, true, true);
@@ -136,7 +136,7 @@ public void TestHiddenAfterExpanding()
agg.ExpandColumn(6);
cirs = CIRCollector.GetRecords(agg);
- Assert.AreEqual(4, cirs.Length);
+ ClassicAssert.AreEqual(4, cirs.Length);
if (!cirs[1].IsHidden)
{
throw new AssertionException("Inner Group should still be hidden");
@@ -150,11 +150,11 @@ private static void ConfirmCIR(ColumnInfoRecord[] cirs,
int ix, int startColIx, int endColIx, int level, bool isHidden, bool isCollapsed)
{
ColumnInfoRecord cir = cirs[ix];
- Assert.AreEqual(startColIx, cir.FirstColumn, "startColIx");
- Assert.AreEqual(endColIx, cir.LastColumn, "endColIx");
- Assert.AreEqual(level, cir.OutlineLevel, "level");
- Assert.AreEqual(isHidden, cir.IsHidden, "hidden");
- Assert.AreEqual(isCollapsed, cir.IsCollapsed, "collapsed");
+ ClassicAssert.AreEqual(startColIx, cir.FirstColumn, "startColIx");
+ ClassicAssert.AreEqual(endColIx, cir.LastColumn, "endColIx");
+ ClassicAssert.AreEqual(level, cir.OutlineLevel, "level");
+ ClassicAssert.AreEqual(isHidden, cir.IsHidden, "hidden");
+ ClassicAssert.AreEqual(isCollapsed, cir.IsCollapsed, "collapsed");
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/Record/Aggregates/TestFormulaRecordAggregate.cs b/testcases/main/HSSF/Record/Aggregates/TestFormulaRecordAggregate.cs
index 6bfd8b013..174aa4cd6 100644
--- a/testcases/main/HSSF/Record/Aggregates/TestFormulaRecordAggregate.cs
+++ b/testcases/main/HSSF/Record/Aggregates/TestFormulaRecordAggregate.cs
@@ -26,7 +26,7 @@ namespace TestCases.HSSF.Record.Aggregates
using System;
using NPOI.HSSF.Record;
using NPOI.HSSF.Record.Aggregates;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.Util;
using NPOI.SS.Formula.PTG;
using NPOI.HSSF.Model;
@@ -48,7 +48,7 @@ public void TestBasic()
StringRecord s = new StringRecord();
s.String = ("abc");
FormulaRecordAggregate fagg = new FormulaRecordAggregate(f, s, SharedValueManager.CreateEmpty());
- Assert.AreEqual("abc", fagg.StringValue);
+ ClassicAssert.AreEqual("abc", fagg.StringValue);
}
/**
* Sometimes a {@link StringRecord} appears after a {@link FormulaRecord} even though the
@@ -83,8 +83,8 @@ public void TestExtraStringRecord_bug46213()
TestCases.HSSF.UserModel.RecordInspector.RecordCollector rc = new TestCases.HSSF.UserModel.RecordInspector.RecordCollector();
fra.VisitContainedRecords(rc);
Record[] vraRecs = rc.Records;
- Assert.AreEqual(1, vraRecs.Length);
- Assert.AreEqual(fr, vraRecs[0]);
+ ClassicAssert.AreEqual(1, vraRecs.Length);
+ ClassicAssert.AreEqual(fr, vraRecs[0]);
}
[Test]
public void TestArrayFormulas()
@@ -104,14 +104,14 @@ public void TestArrayFormulas()
Ptg[] ptgs = HSSFFormulaParser.Parse(formula, null, FormulaType.Array, 0);
agg.SetArrayFormula(new CellRangeAddress(rownum, rownum, colnum, colnum), ptgs);
- Assert.IsTrue(agg.IsPartOfArrayFormula);
- Assert.AreEqual("E5", agg.GetArrayFormulaRange().FormatAsString());
+ ClassicAssert.IsTrue(agg.IsPartOfArrayFormula);
+ ClassicAssert.AreEqual("E5", agg.GetArrayFormulaRange().FormatAsString());
Ptg[] ptg = agg.FormulaTokens;
String fmlaSer = FormulaRenderer.ToFormulaString(null, ptg);
- Assert.AreEqual(formula, fmlaSer);
+ ClassicAssert.AreEqual(formula, fmlaSer);
agg.RemoveArrayFormula(rownum, colnum);
- Assert.IsFalse(agg.IsPartOfArrayFormula);
+ ClassicAssert.IsFalse(agg.IsPartOfArrayFormula);
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/Record/Aggregates/TestPageSettingsBlock.cs b/testcases/main/HSSF/Record/Aggregates/TestPageSettingsBlock.cs
index ac8314476..dc4a943a4 100644
--- a/testcases/main/HSSF/Record/Aggregates/TestPageSettingsBlock.cs
+++ b/testcases/main/HSSF/Record/Aggregates/TestPageSettingsBlock.cs
@@ -19,7 +19,7 @@ limitations under the License.
using NPOI.HSSF.UserModel;
using NPOI.SS.UserModel;
using System;
-using NUnit.Framework;
+using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.Util;
using NPOI.HSSF.Model;
using TestCases.HSSF.UserModel;
@@ -104,7 +104,7 @@ public void TestHeaderFooter_bug46840()
TestCases.HSSF.UserModel.RecordInspector.RecordCollector rv = new TestCases.HSSF.UserModel.RecordInspector.RecordCollector();
sheet.VisitContainedRecords(rv, rowIx);
NPOI.HSSF.Record.Record[] outRecs = rv.Records;
- Assert.AreEqual(13, outRecs.Length);
+ ClassicAssert.AreEqual(13, outRecs.Length);
}
/**
@@ -140,16 +140,16 @@ public void TestLateHeaderFooter_bug46953()
{
throw new AssertionException("Identified bug 46953 - EOF incorrectly Appended to PSB");
}
- Assert.AreEqual(recs.Length + 1, outRecs.Length); // +1 for index record
-
- Assert.AreEqual(typeof(BOFRecord), outRecs[0].GetType());
- Assert.AreEqual(typeof(IndexRecord), outRecs[1].GetType());
- Assert.AreEqual(typeof(HeaderRecord), outRecs[2].GetType());
- Assert.AreEqual(typeof(FooterRecord), outRecs[3].GetType());
- Assert.AreEqual(typeof(HeaderFooterRecord), outRecs[4].GetType());
- Assert.AreEqual(typeof(DimensionsRecord), outRecs[5].GetType());
- Assert.AreEqual(typeof(WindowTwoRecord), outRecs[6].GetType());
- Assert.AreEqual(typeof(EOFRecord), outRecs[7].GetType());
+ ClassicAssert.AreEqual(recs.Length + 1, outRecs.Length); // +1 for index record
+
+ ClassicAssert.AreEqual(typeof(BOFRecord), outRecs[0].GetType());
+ ClassicAssert.AreEqual(typeof(IndexRecord), outRecs[1].GetType());
+ ClassicAssert.AreEqual(typeof(HeaderRecord), outRecs[2].GetType());
+ ClassicAssert.AreEqual(typeof(FooterRecord), outRecs[3].GetType());
+ ClassicAssert.AreEqual(typeof(HeaderFooterRecord), outRecs[4].GetType());
+ ClassicAssert.AreEqual(typeof(DimensionsRecord), outRecs[5].GetType());
+ ClassicAssert.AreEqual(typeof(WindowTwoRecord), outRecs[6].GetType());
+ ClassicAssert.AreEqual(typeof(EOFRecord), outRecs[7].GetType());
}
/**
* Bug 47199 was due to the margin records being located well after the Initial PSB records.
@@ -195,15 +195,15 @@ public void TestLateMargins_bug47199()
TestCases.HSSF.UserModel.RecordInspector.RecordCollector rv = new TestCases.HSSF.UserModel.RecordInspector.RecordCollector();
sheet.VisitContainedRecords(rv, 0);
NPOI.HSSF.Record.Record[] outRecs = rv.Records;
- Assert.AreEqual(recs.Length + 1, outRecs.Length); // +1 for index record
-
- Assert.AreEqual(typeof(BOFRecord), outRecs[0].GetType());
- Assert.AreEqual(typeof(IndexRecord), outRecs[1].GetType());
- Assert.AreEqual(typeof(HeaderRecord), outRecs[2].GetType());
- Assert.AreEqual(typeof(FooterRecord), outRecs[3].GetType());
- Assert.AreEqual(typeof(DimensionsRecord), outRecs[5].GetType());
- Assert.AreEqual(typeof(WindowTwoRecord), outRecs[6].GetType());
- Assert.AreEqual(typeof(EOFRecord), outRecs[7].GetType());
+ ClassicAssert.AreEqual(recs.Length + 1, outRecs.Length); // +1 for index record
+
+ ClassicAssert.AreEqual(typeof(BOFRecord), outRecs[0].GetType());
+ ClassicAssert.AreEqual(typeof(IndexRecord), outRecs[1].GetType());
+ ClassicAssert.AreEqual(typeof(HeaderRecord), outRecs[2].GetType());
+ ClassicAssert.AreEqual(typeof(FooterRecord), outRecs[3].GetType());
+ ClassicAssert.AreEqual(typeof(DimensionsRecord), outRecs[5].GetType());
+ ClassicAssert.AreEqual(typeof(WindowTwoRecord), outRecs[6].GetType());
+ ClassicAssert.AreEqual(typeof(EOFRecord), outRecs[7].GetType());
}
private NPOI.HSSF.Record.Record CreateBottomMargin(float value)
@@ -276,17 +276,17 @@ public void TestMissingHeaderFooter()
{
throw new AssertionException("PageSettingsBlock didn't add missing header/footer records");
}
- Assert.AreEqual(4, outRecs.Length);
- Assert.AreEqual(typeof(HeaderRecord), outRecs[0].GetType());
- Assert.AreEqual(typeof(FooterRecord), outRecs[1].GetType());
- Assert.AreEqual(typeof(HCenterRecord), outRecs[2].GetType());
- Assert.AreEqual(typeof(VCenterRecord), outRecs[3].GetType());
+ ClassicAssert.AreEqual(4, outRecs.Length);
+ ClassicAssert.AreEqual(typeof(HeaderRecord), outRecs[0].GetType());
+ ClassicAssert.AreEqual(typeof(FooterRecord), outRecs[1].GetType());
+ ClassicAssert.AreEqual(typeof(HCenterRecord), outRecs[2].GetType());
+ ClassicAssert.AreEqual(typeof(VCenterRecord), outRecs[3].GetType());
// make sure the Added header / footer records are empty
HeaderRecord hr = (HeaderRecord)outRecs[0];
- Assert.AreEqual("", hr.Text);
+ ClassicAssert.AreEqual("", hr.Text);
FooterRecord fr = (FooterRecord)outRecs[1];
- Assert.AreEqual("", fr.Text);
+ ClassicAssert.AreEqual("", fr.Text);
}
/**
@@ -334,7 +334,7 @@ public void TestDuplicatePLS_bug47415()
NPOI.HSSF.Record.Record[] outRecs = rc.Records;
// records were assembled in standard order, so this simple check is OK
- Assert.IsTrue(Arrays.Equals(recs, outRecs));
+ ClassicAssert.IsTrue(Arrays.Equals(recs, outRecs));
}
[Test]
public void TestDuplicateHeaderFooter_bug48026()
@@ -382,7 +382,7 @@ public void TestDuplicateHeaderFooter_bug48026()
sheet.VisitContainedRecords(rv, 0);
NPOI.HSSF.Record.Record[] outRecs = rv.Records;
- Assert.AreEqual(recs.Length, outRecs.Length);
+ ClassicAssert.AreEqual(recs.Length, outRecs.Length);
//expected order of records:
NPOI.HSSF.Record.Record[] expectedRecs = {
recs[0], //BOFRecord
@@ -405,18 +405,18 @@ public void TestDuplicateHeaderFooter_bug48026()
};
for (int i = 0; i < expectedRecs.Length; i++)
{
- Assert.AreEqual(expectedRecs[i].GetType(), outRecs[i].GetType(), "Record mismatch at index " + i);
+ ClassicAssert.AreEqual(expectedRecs[i].GetType(), outRecs[i].GetType(), "Record mismatch at index " + i);
}
HeaderFooterRecord hd1 = (HeaderFooterRecord)expectedRecs[4];
//GUID is zero
- Assert.IsTrue(Arrays.Equals(new byte[16], hd1.Guid));
- Assert.IsTrue(hd1.IsCurrentSheet);
+ ClassicAssert.IsTrue(Arrays.Equals(new byte[16], hd1.Guid));
+ ClassicAssert.IsTrue(hd1.IsCurrentSheet);
UserSViewBegin svb = (UserSViewBegin)expectedRecs[7];
HeaderFooterRecord hd2 = (HeaderFooterRecord)expectedRecs[9];
- Assert.IsFalse(hd2.IsCurrentSheet);
+ ClassicAssert.IsFalse(hd2.IsCurrentSheet);
//GUIDs of HeaderFooterRecord and UserSViewBegin must be the same
- Assert.IsTrue(Arrays.Equals(svb.Guid, hd2.Guid));
+ ClassicAssert.IsTrue(Arrays.Equals(svb.Guid, hd2.Guid));
}
}
diff --git a/testcases/main/HSSF/Record/Aggregates/TestRowRecordsAggregate.cs b/testcases/main/HSSF/Record/Aggregates/TestRowRecordsAggregate.cs
index 1a78004c0..30e05e11f 100644
--- a/testcases/main/HSSF/Record/Aggregates/TestRowRecordsAggregate.cs
+++ b/testcases/main/HSSF/Record/Aggregates/TestRowRecordsAggregate.cs
@@ -18,7 +18,7 @@ limitations under the License.
namespace TestCases.HSSF.Record.Aggregates
{
using System;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.Record;
using NPOI.HSSF.Record.Aggregates;
using NPOI.HSSF.UserModel;
@@ -45,9 +45,9 @@ public void TestRowGet()
RowRecord rr1 = rra.GetRow(4);
- Assert.IsNotNull(rr1);
- Assert.AreEqual(4, rr1.RowNumber, "Row number is1 1");
- Assert.IsTrue(rr1 == rr, "Row record retrieved is1 identical");
+ ClassicAssert.IsNotNull(rr1);
+ ClassicAssert.AreEqual(4, rr1.RowNumber, "Row number is1 1");
+ ClassicAssert.IsTrue(rr1 == rr, "Row record retrieved is1 identical");
}
/**
* Prior to Aug 2008, POI would re-serialize spreadsheets with {@link ArrayRecord}s or
@@ -62,14 +62,14 @@ public void TestArraysAndTables()
Record[] sheetRecs = RecordInspector.GetRecords(wb.GetSheetAt(0), 0);
int countArrayFormulas = verifySharedValues(sheetRecs, typeof(ArrayRecord));
- Assert.AreEqual(5, countArrayFormulas);
+ ClassicAssert.AreEqual(5, countArrayFormulas);
int countTableFormulas = verifySharedValues(sheetRecs, typeof(TableRecord));
- Assert.AreEqual(3, countTableFormulas);
+ ClassicAssert.AreEqual(3, countTableFormulas);
// Note - SharedFormulaRecords are currently not re-serialized by POI (each is extracted
// into many non-shared formulas), but if they ever were, the same rules would apply.
int countSharedFormulas = verifySharedValues(sheetRecs, typeof(SharedFormulaRecord));
- Assert.AreEqual(0, countSharedFormulas);
+ ClassicAssert.AreEqual(0, countSharedFormulas);
//if (false) { // set true to observe re-serialized file
@@ -113,8 +113,8 @@ private static int verifySharedValues(Record[] recs, Type shfClass)
private static void verifySharedFormula(FormulaRecord firstFormula, Record rec)
{
CellRangeAddress8Bit range = ((SharedValueRecordBase)rec).Range;
- Assert.AreEqual(range.FirstRow, firstFormula.Row);
- Assert.AreEqual(range.FirstColumn, firstFormula.Column);
+ ClassicAssert.AreEqual(range.FirstRow, firstFormula.Row);
+ ClassicAssert.AreEqual(range.FirstColumn, firstFormula.Column);
}
/**
@@ -157,7 +157,7 @@ public void TestUnknownContinue_bug46280()
RecordInspector.RecordCollector rv = new RecordInspector.RecordCollector();
rra.VisitContainedRecords(rv);
Record[] outRecs = rv.Records;
- Assert.AreEqual(5, outRecs.Length);
+ ClassicAssert.AreEqual(5, outRecs.Length);
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/Record/Aggregates/TestSharedValueManager.cs b/testcases/main/HSSF/Record/Aggregates/TestSharedValueManager.cs
index b8b41b93b..51c7144a0 100644
--- a/testcases/main/HSSF/Record/Aggregates/TestSharedValueManager.cs
+++ b/testcases/main/HSSF/Record/Aggregates/TestSharedValueManager.cs
@@ -17,7 +17,7 @@ limitations under the License.
using System;
using System.Reflection;
-using NUnit.Framework;
+using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.Record;
using NPOI.HSSF.Record.Aggregates;
using NPOI.HSSF.UserModel;
@@ -74,13 +74,13 @@ public void TestPartiallyOverlappingRanges()
HSSFSheet sheet = (HSSFSheet)wb.GetSheetAt(0);
RecordInspector.GetRecords(sheet, 0);
- Assert.AreEqual("1+1", sheet.GetRow(2).GetCell(0).CellFormula);
+ ClassicAssert.AreEqual("1+1", sheet.GetRow(2).GetCell(0).CellFormula);
if ("1+1".Equals(sheet.GetRow(3).GetCell(0).CellFormula))
{
throw new AssertionException("Identified bug - wrong shared formula record chosen"
+ " (attempt " + attempt + ")");
}
- Assert.AreEqual("2+2", sheet.GetRow(3).GetCell(0).CellFormula);
+ ClassicAssert.AreEqual("2+2", sheet.GetRow(3).GetCell(0).CellFormula);
records = RecordInspector.GetRecords(sheet, 0);
} while (attempt++ < MAX_ATTEMPTS);
@@ -92,7 +92,7 @@ public void TestPartiallyOverlappingRanges()
count++;
}
}
- Assert.AreEqual(2, count);
+ ClassicAssert.AreEqual(2, count);
}
/**
@@ -130,7 +130,7 @@ public void TestCompletelyOverlappedRanges()
count++;
}
}
- Assert.AreEqual(2, count);
+ ClassicAssert.AreEqual(2, count);
}
/**
@@ -184,7 +184,7 @@ public void TestRecalculateFormulas47747()
}
throw e;
}
- Assert.AreEqual("$AF24*A$7", formulaText);
+ ClassicAssert.AreEqual("$AF24*A$7", formulaText);
}
/**
@@ -224,19 +224,19 @@ public void TestBug52527()
HSSFWorkbook wb1 = HSSFTestDataSamples.OpenSampleWorkbook("52527.xls");
HSSFWorkbook wb2 = HSSFTestDataSamples.WriteOutAndReadBack(wb1);
- Assert.AreEqual("IF(H3,LINEST(N9:N14,K9:M14,FALSE),LINEST(N8:N14,K8:M14,FALSE))",
+ ClassicAssert.AreEqual("IF(H3,LINEST(N9:N14,K9:M14,FALSE),LINEST(N8:N14,K8:M14,FALSE))",
wb1.GetSheetAt(0).GetRow(4).GetCell(11).CellFormula);
- Assert.AreEqual("IF(H3,LINEST(N9:N14,K9:M14,FALSE),LINEST(N8:N14,K8:M14,FALSE))",
+ ClassicAssert.AreEqual("IF(H3,LINEST(N9:N14,K9:M14,FALSE),LINEST(N8:N14,K8:M14,FALSE))",
wb2.GetSheetAt(0).GetRow(4).GetCell(11).CellFormula);
- Assert.AreEqual("1/SQRT(J9)",
+ ClassicAssert.AreEqual("1/SQRT(J9)",
wb1.GetSheetAt(0).GetRow(8).GetCell(10).CellFormula);
- Assert.AreEqual("1/SQRT(J9)",
+ ClassicAssert.AreEqual("1/SQRT(J9)",
wb2.GetSheetAt(0).GetRow(8).GetCell(10).CellFormula);
- Assert.AreEqual("1/SQRT(J26)",
+ ClassicAssert.AreEqual("1/SQRT(J26)",
wb1.GetSheetAt(0).GetRow(25).GetCell(10).CellFormula);
- Assert.AreEqual("1/SQRT(J26)",
+ ClassicAssert.AreEqual("1/SQRT(J26)",
wb2.GetSheetAt(0).GetRow(25).GetCell(10).CellFormula);
}
}
diff --git a/testcases/main/HSSF/Record/Aggregates/TestValueRecordsAggregate.cs b/testcases/main/HSSF/Record/Aggregates/TestValueRecordsAggregate.cs
index 14e2e294c..af04effe8 100644
--- a/testcases/main/HSSF/Record/Aggregates/TestValueRecordsAggregate.cs
+++ b/testcases/main/HSSF/Record/Aggregates/TestValueRecordsAggregate.cs
@@ -21,7 +21,7 @@ namespace TestCases.HSSF.Record.Aggregates
using System.IO;
using System.Collections;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.Record;
using NPOI.HSSF.Record.Aggregates;
@@ -64,11 +64,11 @@ public void TestSharedFormula()
ConstructValueRecord(records);
IList cvrs = GetValueRecords();
//Ensure that the SharedFormulaRecord has been converted
- Assert.AreEqual(1, cvrs.Count);
+ ClassicAssert.AreEqual(1, cvrs.Count);
CellValueRecordInterface record = cvrs[0];
- Assert.IsNotNull(record, "Row contains a value");
- Assert.IsTrue((record is FormulaRecordAggregate), "First record is1 a FormulaRecordsAggregate");
+ ClassicAssert.IsNotNull(record, "Row contains a value");
+ ClassicAssert.IsTrue((record is FormulaRecordAggregate), "First record is1 a FormulaRecordsAggregate");
}
private IList TestData()
@@ -90,11 +90,11 @@ private IList TestData()
[Test]
public void TestInsertCell()
{
- Assert.AreEqual(0, GetValueRecords().Count);
+ ClassicAssert.AreEqual(0, GetValueRecords().Count);
BlankRecord blankRecord = NewBlankRecord();
valueRecord.InsertCell(blankRecord);
- Assert.AreEqual(1, GetValueRecords().Count);
+ ClassicAssert.AreEqual(1, GetValueRecords().Count);
}
[Test]
public void TestRemoveCell()
@@ -103,7 +103,7 @@ public void TestRemoveCell()
valueRecord.InsertCell(blankRecord1);
BlankRecord blankRecord2 = NewBlankRecord();
valueRecord.RemoveCell(blankRecord2);
- Assert.AreEqual(0, GetValueRecords().Count);
+ ClassicAssert.AreEqual(0, GetValueRecords().Count);
// removing an already empty cell just falls through
valueRecord.RemoveCell(blankRecord2);
@@ -112,38 +112,38 @@ public void TestRemoveCell()
[Test]
public void TestPhysicalNumberOfCells()
{
- Assert.AreEqual(0, valueRecord.PhysicalNumberOfCells);
+ ClassicAssert.AreEqual(0, valueRecord.PhysicalNumberOfCells);
BlankRecord blankRecord1 = NewBlankRecord();
valueRecord.InsertCell(blankRecord1);
- Assert.AreEqual(1, valueRecord.PhysicalNumberOfCells);
+ ClassicAssert.AreEqual(1, valueRecord.PhysicalNumberOfCells);
valueRecord.RemoveCell(blankRecord1);
- Assert.AreEqual(0, valueRecord.PhysicalNumberOfCells);
+ ClassicAssert.AreEqual(0, valueRecord.PhysicalNumberOfCells);
}
[Test]
public void TestFirstCellNum()
{
- Assert.AreEqual(-1, valueRecord.FirstCellNum);
+ ClassicAssert.AreEqual(-1, valueRecord.FirstCellNum);
valueRecord.InsertCell(NewBlankRecord(2, 2));
- Assert.AreEqual(2, valueRecord.FirstCellNum);
+ ClassicAssert.AreEqual(2, valueRecord.FirstCellNum);
valueRecord.InsertCell(NewBlankRecord(3, 3));
- Assert.AreEqual(2, valueRecord.FirstCellNum);
+ ClassicAssert.AreEqual(2, valueRecord.FirstCellNum);
// Note: Removal doesn't currently reSet the first column. It probably should but it doesn't.
valueRecord.RemoveCell(NewBlankRecord(2, 2));
- Assert.AreEqual(2, valueRecord.FirstCellNum);
+ ClassicAssert.AreEqual(2, valueRecord.FirstCellNum);
}
[Test]
public void TestLastCellNum()
{
- Assert.AreEqual(-1, valueRecord.LastCellNum);
+ ClassicAssert.AreEqual(-1, valueRecord.LastCellNum);
valueRecord.InsertCell(NewBlankRecord(2, 2));
- Assert.AreEqual(2, valueRecord.LastCellNum);
+ ClassicAssert.AreEqual(2, valueRecord.LastCellNum);
valueRecord.InsertCell(NewBlankRecord(3, 3));
- Assert.AreEqual(3, valueRecord.LastCellNum);
+ ClassicAssert.AreEqual(3, valueRecord.LastCellNum);
// Note: Removal doesn't currently reSet the last column. It probably should but it doesn't.
valueRecord.RemoveCell(NewBlankRecord(3, 3));
- Assert.AreEqual(3, valueRecord.LastCellNum);
+ ClassicAssert.AreEqual(3, valueRecord.LastCellNum);
}
[Test]
@@ -166,9 +166,9 @@ public void TestSerialize()
ConstructValueRecord(records);
int bytesWritten = valueRecord.SerializeCellRow(1, 0, actualArray);
bytesWritten += valueRecord.SerializeCellRow(2, bytesWritten, actualArray);
- Assert.AreEqual(36, bytesWritten);
+ ClassicAssert.AreEqual(36, bytesWritten);
for (int i = 0; i < 36; i++)
- Assert.AreEqual(expectedArray[i], actualArray[i]);
+ ClassicAssert.AreEqual(expectedArray[i], actualArray[i]);
}
private BlankRecord NewBlankRecord()
@@ -415,9 +415,9 @@ private void confirmMulBlank(int expectedTotalBlankCells,
valueRecord.VisitCellsForRow(rowIx, rv);
}
}
- Assert.AreEqual(expectedTotalBlankCells, bs.countBlankCells);
- Assert.AreEqual(expectedNumberOfMulBlankRecords, bs.countMulBlankRecords);
- Assert.AreEqual(expectedNumberOfSingleBlankRecords, bs.countSingleBlankRecords);
+ ClassicAssert.AreEqual(expectedTotalBlankCells, bs.countBlankCells);
+ ClassicAssert.AreEqual(expectedNumberOfMulBlankRecords, bs.countMulBlankRecords);
+ ClassicAssert.AreEqual(expectedNumberOfSingleBlankRecords, bs.countSingleBlankRecords);
}
}
}
diff --git a/testcases/main/HSSF/Record/CF/TestCellRange.cs b/testcases/main/HSSF/Record/CF/TestCellRange.cs
index 30d3884f1..eba0be264 100644
--- a/testcases/main/HSSF/Record/CF/TestCellRange.cs
+++ b/testcases/main/HSSF/Record/CF/TestCellRange.cs
@@ -18,7 +18,7 @@ limitations under the License.
namespace TestCases.HSSF.Record.CF
{
using System;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.Record.CF;
using NPOI.HSSF.Util;
using NPOI.SS.Util;
@@ -78,7 +78,7 @@ public void TestContainsMethod()
for (int j = 0; j != ranges.Length; j++)
{
bool expectedResult = containsExpectedResults[i, j];
- Assert.AreEqual(expectedResult, CellRangeUtil.Contains(ranges[i], ranges[j]), "(" + i + "," + j + "): ");
+ ClassicAssert.AreEqual(expectedResult, CellRangeUtil.Contains(ranges[i], ranges[j]), "(" + i + "," + j + "): ");
}
}
}
@@ -98,65 +98,65 @@ public void TestContainsMethod()
[Test]
public void TestHasSharedBorderMethod()
{
- Assert.IsFalse(CellRangeUtil.HasExactSharedBorder(col1, col1));
- Assert.IsFalse(CellRangeUtil.HasExactSharedBorder(col2, col2));
- Assert.IsTrue(CellRangeUtil.HasExactSharedBorder(col1, col2));
- Assert.IsTrue(CellRangeUtil.HasExactSharedBorder(col2, col1));
-
- Assert.IsFalse(CellRangeUtil.HasExactSharedBorder(row1, row1));
- Assert.IsFalse(CellRangeUtil.HasExactSharedBorder(row2, row2));
- Assert.IsTrue(CellRangeUtil.HasExactSharedBorder(row1, row2));
- Assert.IsTrue(CellRangeUtil.HasExactSharedBorder(row2, row1));
-
- Assert.IsFalse(CellRangeUtil.HasExactSharedBorder(row1, col1));
- Assert.IsFalse(CellRangeUtil.HasExactSharedBorder(row1, col2));
- Assert.IsFalse(CellRangeUtil.HasExactSharedBorder(col1, row1));
- Assert.IsFalse(CellRangeUtil.HasExactSharedBorder(col2, row1));
- Assert.IsFalse(CellRangeUtil.HasExactSharedBorder(row2, col1));
- Assert.IsFalse(CellRangeUtil.HasExactSharedBorder(row2, col2));
- Assert.IsFalse(CellRangeUtil.HasExactSharedBorder(col1, row2));
- Assert.IsFalse(CellRangeUtil.HasExactSharedBorder(col2, row2));
- Assert.IsTrue(CellRangeUtil.HasExactSharedBorder(col2, col1));
-
- Assert.IsFalse(CellRangeUtil.HasExactSharedBorder(box1, box1));
- Assert.IsTrue(CellRangeUtil.HasExactSharedBorder(box1, box2));
- Assert.IsTrue(CellRangeUtil.HasExactSharedBorder(box1, box3));
- Assert.IsFalse(CellRangeUtil.HasExactSharedBorder(box1, box4));
-
- Assert.IsTrue(CellRangeUtil.HasExactSharedBorder(box2, box1));
- Assert.IsFalse(CellRangeUtil.HasExactSharedBorder(box2, box2));
- Assert.IsFalse(CellRangeUtil.HasExactSharedBorder(box2, box3));
- Assert.IsTrue(CellRangeUtil.HasExactSharedBorder(box2, box4));
-
- Assert.IsTrue(CellRangeUtil.HasExactSharedBorder(box3, box1));
- Assert.IsFalse(CellRangeUtil.HasExactSharedBorder(box3, box2));
- Assert.IsFalse(CellRangeUtil.HasExactSharedBorder(box3, box3));
- Assert.IsTrue(CellRangeUtil.HasExactSharedBorder(box3, box4));
-
- Assert.IsFalse(CellRangeUtil.HasExactSharedBorder(box4, box1));
- Assert.IsTrue(CellRangeUtil.HasExactSharedBorder(box4, box2));
- Assert.IsTrue(CellRangeUtil.HasExactSharedBorder(box4, box3));
- Assert.IsFalse(CellRangeUtil.HasExactSharedBorder(box4, box4));
+ ClassicAssert.IsFalse(CellRangeUtil.HasExactSharedBorder(col1, col1));
+ ClassicAssert.IsFalse(CellRangeUtil.HasExactSharedBorder(col2, col2));
+ ClassicAssert.IsTrue(CellRangeUtil.HasExactSharedBorder(col1, col2));
+ ClassicAssert.IsTrue(CellRangeUtil.HasExactSharedBorder(col2, col1));
+
+ ClassicAssert.IsFalse(CellRangeUtil.HasExactSharedBorder(row1, row1));
+ ClassicAssert.IsFalse(CellRangeUtil.HasExactSharedBorder(row2, row2));
+ ClassicAssert.IsTrue(CellRangeUtil.HasExactSharedBorder(row1, row2));
+ ClassicAssert.IsTrue(CellRangeUtil.HasExactSharedBorder(row2, row1));
+
+ ClassicAssert.IsFalse(CellRangeUtil.HasExactSharedBorder(row1, col1));
+ ClassicAssert.IsFalse(CellRangeUtil.HasExactSharedBorder(row1, col2));
+ ClassicAssert.IsFalse(CellRangeUtil.HasExactSharedBorder(col1, row1));
+ ClassicAssert.IsFalse(CellRangeUtil.HasExactSharedBorder(col2, row1));
+ ClassicAssert.IsFalse(CellRangeUtil.HasExactSharedBorder(row2, col1));
+ ClassicAssert.IsFalse(CellRangeUtil.HasExactSharedBorder(row2, col2));
+ ClassicAssert.IsFalse(CellRangeUtil.HasExactSharedBorder(col1, row2));
+ ClassicAssert.IsFalse(CellRangeUtil.HasExactSharedBorder(col2, row2));
+ ClassicAssert.IsTrue(CellRangeUtil.HasExactSharedBorder(col2, col1));
+
+ ClassicAssert.IsFalse(CellRangeUtil.HasExactSharedBorder(box1, box1));
+ ClassicAssert.IsTrue(CellRangeUtil.HasExactSharedBorder(box1, box2));
+ ClassicAssert.IsTrue(CellRangeUtil.HasExactSharedBorder(box1, box3));
+ ClassicAssert.IsFalse(CellRangeUtil.HasExactSharedBorder(box1, box4));
+
+ ClassicAssert.IsTrue(CellRangeUtil.HasExactSharedBorder(box2, box1));
+ ClassicAssert.IsFalse(CellRangeUtil.HasExactSharedBorder(box2, box2));
+ ClassicAssert.IsFalse(CellRangeUtil.HasExactSharedBorder(box2, box3));
+ ClassicAssert.IsTrue(CellRangeUtil.HasExactSharedBorder(box2, box4));
+
+ ClassicAssert.IsTrue(CellRangeUtil.HasExactSharedBorder(box3, box1));
+ ClassicAssert.IsFalse(CellRangeUtil.HasExactSharedBorder(box3, box2));
+ ClassicAssert.IsFalse(CellRangeUtil.HasExactSharedBorder(box3, box3));
+ ClassicAssert.IsTrue(CellRangeUtil.HasExactSharedBorder(box3, box4));
+
+ ClassicAssert.IsFalse(CellRangeUtil.HasExactSharedBorder(box4, box1));
+ ClassicAssert.IsTrue(CellRangeUtil.HasExactSharedBorder(box4, box2));
+ ClassicAssert.IsTrue(CellRangeUtil.HasExactSharedBorder(box4, box3));
+ ClassicAssert.IsFalse(CellRangeUtil.HasExactSharedBorder(box4, box4));
}
[Test]
public void TestIntersectMethod()
{
- Assert.AreEqual(CellRangeUtil.OVERLAP, CellRangeUtil.Intersect(box0, box5));
- Assert.AreEqual(CellRangeUtil.OVERLAP, CellRangeUtil.Intersect(box5, box0));
- Assert.AreEqual(CellRangeUtil.NO_INTERSECTION, CellRangeUtil.Intersect(box1, box4));
- Assert.AreEqual(CellRangeUtil.NO_INTERSECTION, CellRangeUtil.Intersect(box4, box1));
- Assert.AreEqual(CellRangeUtil.NO_INTERSECTION, CellRangeUtil.Intersect(box2, box3));
- Assert.AreEqual(CellRangeUtil.NO_INTERSECTION, CellRangeUtil.Intersect(box3, box2));
- Assert.AreEqual(CellRangeUtil.INSIDE, CellRangeUtil.Intersect(box0, box1));
- Assert.AreEqual(CellRangeUtil.INSIDE, CellRangeUtil.Intersect(box0, box0));
- Assert.AreEqual(CellRangeUtil.ENCLOSES, CellRangeUtil.Intersect(box1, box0));
- Assert.AreEqual(CellRangeUtil.INSIDE, CellRangeUtil.Intersect(tenthColumn, oneCell));
- Assert.AreEqual(CellRangeUtil.ENCLOSES, CellRangeUtil.Intersect(oneCell, tenthColumn));
- Assert.AreEqual(CellRangeUtil.OVERLAP, CellRangeUtil.Intersect(tenthColumn, tenthRow));
- Assert.AreEqual(CellRangeUtil.OVERLAP, CellRangeUtil.Intersect(tenthRow, tenthColumn));
- Assert.AreEqual(CellRangeUtil.INSIDE, CellRangeUtil.Intersect(tenthColumn, tenthColumn));
- Assert.AreEqual(CellRangeUtil.INSIDE, CellRangeUtil.Intersect(tenthRow, tenthRow));
+ ClassicAssert.AreEqual(CellRangeUtil.OVERLAP, CellRangeUtil.Intersect(box0, box5));
+ ClassicAssert.AreEqual(CellRangeUtil.OVERLAP, CellRangeUtil.Intersect(box5, box0));
+ ClassicAssert.AreEqual(CellRangeUtil.NO_INTERSECTION, CellRangeUtil.Intersect(box1, box4));
+ ClassicAssert.AreEqual(CellRangeUtil.NO_INTERSECTION, CellRangeUtil.Intersect(box4, box1));
+ ClassicAssert.AreEqual(CellRangeUtil.NO_INTERSECTION, CellRangeUtil.Intersect(box2, box3));
+ ClassicAssert.AreEqual(CellRangeUtil.NO_INTERSECTION, CellRangeUtil.Intersect(box3, box2));
+ ClassicAssert.AreEqual(CellRangeUtil.INSIDE, CellRangeUtil.Intersect(box0, box1));
+ ClassicAssert.AreEqual(CellRangeUtil.INSIDE, CellRangeUtil.Intersect(box0, box0));
+ ClassicAssert.AreEqual(CellRangeUtil.ENCLOSES, CellRangeUtil.Intersect(box1, box0));
+ ClassicAssert.AreEqual(CellRangeUtil.INSIDE, CellRangeUtil.Intersect(tenthColumn, oneCell));
+ ClassicAssert.AreEqual(CellRangeUtil.ENCLOSES, CellRangeUtil.Intersect(oneCell, tenthColumn));
+ ClassicAssert.AreEqual(CellRangeUtil.OVERLAP, CellRangeUtil.Intersect(tenthColumn, tenthRow));
+ ClassicAssert.AreEqual(CellRangeUtil.OVERLAP, CellRangeUtil.Intersect(tenthRow, tenthColumn));
+ ClassicAssert.AreEqual(CellRangeUtil.INSIDE, CellRangeUtil.Intersect(tenthColumn, tenthColumn));
+ ClassicAssert.AreEqual(CellRangeUtil.INSIDE, CellRangeUtil.Intersect(tenthRow, tenthRow));
}
/**
@@ -189,16 +189,16 @@ public void TestCreate()
private static void ConfirmRange(CellRangeAddress cr, bool isFullRow, bool isFullColumn)
{
- Assert.AreEqual(isFullRow, cr.IsFullRowRange, "isFullRowRange");
- Assert.AreEqual(isFullColumn, cr.IsFullColumnRange, "isFullColumnRange");
+ ClassicAssert.AreEqual(isFullRow, cr.IsFullRowRange, "isFullRowRange");
+ ClassicAssert.AreEqual(isFullColumn, cr.IsFullColumnRange, "isFullColumnRange");
}
[Test]
public void TestNumberOfCells()
{
- Assert.AreEqual(1, oneCell.NumberOfCells);
- Assert.AreEqual(100, box9x9.NumberOfCells);
- Assert.AreEqual(121, box10to20c.NumberOfCells);
+ ClassicAssert.AreEqual(1, oneCell.NumberOfCells);
+ ClassicAssert.AreEqual(100, box9x9.NumberOfCells);
+ ClassicAssert.AreEqual(121, box10to20c.NumberOfCells);
}
[Test]
@@ -265,11 +265,11 @@ private void CellRangeTest(String[] input, params string[] expectedOutput)
private void VerifyExpectedResult(CellRangeAddress[] result, params string[] expectedOutput)
{
- Assert.AreEqual(expectedOutput.Length, result.Length,
+ ClassicAssert.AreEqual(expectedOutput.Length, result.Length,
"\nExpected: " + Arrays.ToString(expectedOutput) + "\nHad: " + Arrays.ToString(result));
for (int i = 0; i < expectedOutput.Length; i++)
{
- Assert.AreEqual(expectedOutput[i], result[i].FormatAsString(),
+ ClassicAssert.AreEqual(expectedOutput[i], result[i].FormatAsString(),
"\nExpected: " + Arrays.ToString(expectedOutput) + "\nHad: " + Arrays.ToString(result));
}
}
@@ -278,16 +278,16 @@ private void VerifyExpectedResult(CellRangeAddress[] result, params string[] exp
public void TestValueOf()
{
CellRangeAddress cr1 = CellRangeAddress.ValueOf("A1:B1");
- Assert.AreEqual(0, cr1.FirstColumn);
- Assert.AreEqual(0, cr1.FirstRow);
- Assert.AreEqual(1, cr1.LastColumn);
- Assert.AreEqual(0, cr1.LastRow);
+ ClassicAssert.AreEqual(0, cr1.FirstColumn);
+ ClassicAssert.AreEqual(0, cr1.FirstRow);
+ ClassicAssert.AreEqual(1, cr1.LastColumn);
+ ClassicAssert.AreEqual(0, cr1.LastRow);
CellRangeAddress cr2 = CellRangeAddress.ValueOf("B1");
- Assert.AreEqual(1, cr2.FirstColumn);
- Assert.AreEqual(0, cr2.FirstRow);
- Assert.AreEqual(1, cr2.LastColumn);
- Assert.AreEqual(0, cr2.LastRow);
+ ClassicAssert.AreEqual(1, cr2.FirstColumn);
+ ClassicAssert.AreEqual(0, cr2.FirstRow);
+ ClassicAssert.AreEqual(1, cr2.LastColumn);
+ ClassicAssert.AreEqual(0, cr2.LastRow);
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/Record/Chart/TestAlRunsRecord.cs b/testcases/main/HSSF/Record/Chart/TestAlRunsRecord.cs
index 51e842ef5..89bd4e415 100644
--- a/testcases/main/HSSF/Record/Chart/TestAlRunsRecord.cs
+++ b/testcases/main/HSSF/Record/Chart/TestAlRunsRecord.cs
@@ -20,7 +20,7 @@ namespace TestCases.HSSF.Record.Chart
using System;
using System.Collections;
using System.IO;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using TestCases.HSSF;
using NPOI.HSSF.Record;
@@ -54,11 +54,11 @@ public void TestRecord()
din.Close();
// Should've found one
- Assert.AreEqual(1, grabber.chartTitleFormatRecords.Count);
+ ClassicAssert.AreEqual(1, grabber.chartTitleFormatRecords.Count);
// And it should be of something interesting
AlRunsRecord r =
(AlRunsRecord)grabber.chartTitleFormatRecords[0];
- Assert.AreEqual(3, r.GetFormatCount());
+ ClassicAssert.AreEqual(3, r.GetFormatCount());
}
private class ChartTitleFormatRecordGrabber : IHSSFListener
diff --git a/testcases/main/HSSF/Record/Chart/TestAreaFormatRecord.cs b/testcases/main/HSSF/Record/Chart/TestAreaFormatRecord.cs
index beb149a5b..3f37d5bdc 100644
--- a/testcases/main/HSSF/Record/Chart/TestAreaFormatRecord.cs
+++ b/testcases/main/HSSF/Record/Chart/TestAreaFormatRecord.cs
@@ -23,7 +23,7 @@ namespace TestCases.HSSF.Record.Chart
using System;
using NPOI.HSSF.Record;
using NPOI.HSSF.Record.Chart;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
* Tests the serialization and deserialization of the AreaFormatRecord
@@ -55,17 +55,17 @@ public void TestLoad()
{
AreaFormatRecord record = new AreaFormatRecord(TestcaseRecordInputStream.Create((short)0x100a, data));
- Assert.AreEqual(0xFFFFFF, record.ForegroundColor);
- Assert.AreEqual(0x000000, record.BackgroundColor);
- Assert.AreEqual(1, record.Pattern);
- Assert.AreEqual(1, record.FormatFlags);
- Assert.AreEqual(true, record.IsAutomatic);
- Assert.AreEqual(false, record.IsInvert);
- Assert.AreEqual(0x4e, record.ForecolorIndex);
- Assert.AreEqual(0x4d, record.BackcolorIndex);
+ ClassicAssert.AreEqual(0xFFFFFF, record.ForegroundColor);
+ ClassicAssert.AreEqual(0x000000, record.BackgroundColor);
+ ClassicAssert.AreEqual(1, record.Pattern);
+ ClassicAssert.AreEqual(1, record.FormatFlags);
+ ClassicAssert.AreEqual(true, record.IsAutomatic);
+ ClassicAssert.AreEqual(false, record.IsInvert);
+ ClassicAssert.AreEqual(0x4e, record.ForecolorIndex);
+ ClassicAssert.AreEqual(0x4d, record.BackcolorIndex);
- Assert.AreEqual(20, record.RecordSize);
+ ClassicAssert.AreEqual(20, record.RecordSize);
}
[Test]
public void TestStore()
@@ -81,9 +81,9 @@ public void TestStore()
byte[] recordBytes = record.Serialize();
- Assert.AreEqual(recordBytes.Length - 4, data.Length);
+ ClassicAssert.AreEqual(recordBytes.Length - 4, data.Length);
for (int i = 0; i < data.Length; i++)
- Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
+ ClassicAssert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/Record/Chart/TestAreaRecord.cs b/testcases/main/HSSF/Record/Chart/TestAreaRecord.cs
index 73e8943c7..8618ccda9 100644
--- a/testcases/main/HSSF/Record/Chart/TestAreaRecord.cs
+++ b/testcases/main/HSSF/Record/Chart/TestAreaRecord.cs
@@ -24,7 +24,7 @@ namespace TestCases.HSSF.Record.Chart
using System;
using NPOI.HSSF.Record;
using NPOI.HSSF.Record.Chart;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
* Tests the serialization and deserialization of the AreaRecord
@@ -50,13 +50,13 @@ public void TestLoad()
{
AreaRecord record = new AreaRecord(TestcaseRecordInputStream.Create((short)0x101A, data));
- Assert.AreEqual(2, record.FormatFlags);
- Assert.AreEqual(false, record.IsStacked);
- Assert.AreEqual(true, record.IsDisplayAsPercentage);
- Assert.AreEqual(false, record.IsShadow);
+ ClassicAssert.AreEqual(2, record.FormatFlags);
+ ClassicAssert.AreEqual(false, record.IsStacked);
+ ClassicAssert.AreEqual(true, record.IsDisplayAsPercentage);
+ ClassicAssert.AreEqual(false, record.IsShadow);
- Assert.AreEqual(6, record.RecordSize);
+ ClassicAssert.AreEqual(6, record.RecordSize);
}
[Test]
public void TestStore()
@@ -68,9 +68,9 @@ public void TestStore()
byte[] recordBytes = record.Serialize();
- Assert.AreEqual(recordBytes.Length - 4, data.Length);
+ ClassicAssert.AreEqual(recordBytes.Length - 4, data.Length);
for (int i = 0; i < data.Length; i++)
- Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
+ ClassicAssert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/Record/Chart/TestAttachedLabelRecord.cs b/testcases/main/HSSF/Record/Chart/TestAttachedLabelRecord.cs
index 2dc5f2ce3..12fd3b67d 100644
--- a/testcases/main/HSSF/Record/Chart/TestAttachedLabelRecord.cs
+++ b/testcases/main/HSSF/Record/Chart/TestAttachedLabelRecord.cs
@@ -24,7 +24,7 @@ namespace TestCases.HSSF.Record.Chart
using System;
using NPOI.HSSF.Record;
using NPOI.HSSF.Record.Chart;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
* Tests the serialization and deserialization of the SeriesLabelsRecord
@@ -49,16 +49,16 @@ public TestAttachedLabelRecord()
public void TestLoad()
{
AttachedLabelRecord record = new AttachedLabelRecord(TestcaseRecordInputStream.Create(0x100c, data));
- Assert.AreEqual(3, record.FormatFlags);
- Assert.AreEqual(true, record.IsShowActual);
- Assert.AreEqual(true, record.IsShowPercent);
- Assert.AreEqual(false, record.IsLabelAsPercentage);
- Assert.AreEqual(false, record.IsSmoothedLine);
- Assert.AreEqual(false, record.IsShowLabel);
- Assert.AreEqual(false, record.IsShowBubbleSizes);
+ ClassicAssert.AreEqual(3, record.FormatFlags);
+ ClassicAssert.AreEqual(true, record.IsShowActual);
+ ClassicAssert.AreEqual(true, record.IsShowPercent);
+ ClassicAssert.AreEqual(false, record.IsLabelAsPercentage);
+ ClassicAssert.AreEqual(false, record.IsSmoothedLine);
+ ClassicAssert.AreEqual(false, record.IsShowLabel);
+ ClassicAssert.AreEqual(false, record.IsShowBubbleSizes);
- Assert.AreEqual(2 + 4, record.RecordSize);
+ ClassicAssert.AreEqual(2 + 4, record.RecordSize);
}
[Test]
@@ -74,9 +74,9 @@ public void TestStore()
byte[] recordBytes = record.Serialize();
- Assert.AreEqual(recordBytes.Length - 4, data.Length);
+ ClassicAssert.AreEqual(recordBytes.Length - 4, data.Length);
for (int i = 0; i < data.Length; i++)
- Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
+ ClassicAssert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/Record/Chart/TestAxcExtRecord.cs b/testcases/main/HSSF/Record/Chart/TestAxcExtRecord.cs
index ed14030e0..d5e6411b4 100644
--- a/testcases/main/HSSF/Record/Chart/TestAxcExtRecord.cs
+++ b/testcases/main/HSSF/Record/Chart/TestAxcExtRecord.cs
@@ -23,7 +23,7 @@ namespace TestCases.HSSF.Record.Chart
using System;
using NPOI.HSSF.Record;
using NPOI.HSSF.Record.Chart;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
* Tests the serialization and deserialization of the AxisOptionsRecord
@@ -51,26 +51,26 @@ public TestAxcExtRecord()
public void TestLoad()
{
AxcExtRecord record = new AxcExtRecord(TestcaseRecordInputStream.Create((short)0x1062, data));
- Assert.AreEqual(0, record.MinimumDate);
- Assert.AreEqual(0, record.MaximumDate);
- Assert.AreEqual(1, record.MajorInterval);
- Assert.AreEqual(0, (short)record.MajorUnit);
- Assert.AreEqual(1, record.MinorInterval);
- Assert.AreEqual(0, (short)record.MinorUnit);
- Assert.AreEqual(0, (short)record.BaseUnit);
- Assert.AreEqual(0, record.CrossDate);
- Assert.AreEqual(239, record.Options);
- Assert.AreEqual(true, record.IsAutoMin);
- Assert.AreEqual(true, record.IsAutoMax);
- Assert.AreEqual(true, record.IsAutoMajor);
- Assert.AreEqual(true, record.IsAutoMinor);
- Assert.AreEqual(false, record.IsDateAxis);
- Assert.AreEqual(true, record.IsAutoBase);
- Assert.AreEqual(true, record.IsAutoCross);
- Assert.AreEqual(true, record.IsAutoDate);
+ ClassicAssert.AreEqual(0, record.MinimumDate);
+ ClassicAssert.AreEqual(0, record.MaximumDate);
+ ClassicAssert.AreEqual(1, record.MajorInterval);
+ ClassicAssert.AreEqual(0, (short)record.MajorUnit);
+ ClassicAssert.AreEqual(1, record.MinorInterval);
+ ClassicAssert.AreEqual(0, (short)record.MinorUnit);
+ ClassicAssert.AreEqual(0, (short)record.BaseUnit);
+ ClassicAssert.AreEqual(0, record.CrossDate);
+ ClassicAssert.AreEqual(239, record.Options);
+ ClassicAssert.AreEqual(true, record.IsAutoMin);
+ ClassicAssert.AreEqual(true, record.IsAutoMax);
+ ClassicAssert.AreEqual(true, record.IsAutoMajor);
+ ClassicAssert.AreEqual(true, record.IsAutoMinor);
+ ClassicAssert.AreEqual(false, record.IsDateAxis);
+ ClassicAssert.AreEqual(true, record.IsAutoBase);
+ ClassicAssert.AreEqual(true, record.IsAutoCross);
+ ClassicAssert.AreEqual(true, record.IsAutoDate);
- Assert.AreEqual(22, record.RecordSize);
+ ClassicAssert.AreEqual(22, record.RecordSize);
}
[Test]
public void TestStore()
@@ -96,9 +96,9 @@ public void TestStore()
byte[] recordBytes = record.Serialize();
- Assert.AreEqual(recordBytes.Length - 4, data.Length);
+ ClassicAssert.AreEqual(recordBytes.Length - 4, data.Length);
for (int i = 0; i < data.Length; i++)
- Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
+ ClassicAssert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/Record/Chart/TestAxesUsedRecord.cs b/testcases/main/HSSF/Record/Chart/TestAxesUsedRecord.cs
index ba7546a90..1e59b8bb2 100644
--- a/testcases/main/HSSF/Record/Chart/TestAxesUsedRecord.cs
+++ b/testcases/main/HSSF/Record/Chart/TestAxesUsedRecord.cs
@@ -23,7 +23,7 @@ namespace TestCases.HSSF.Record.Chart
using System;
using NPOI.HSSF.Record;
using NPOI.HSSF.Record.Chart;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
* Tests the serialization and deserialization of the AxisUsedRecord
@@ -48,8 +48,8 @@ public TestAxesUsedRecord()
public void TestLoad()
{
AxesUsedRecord record = new AxesUsedRecord(TestcaseRecordInputStream.Create((short)0x1046, data));
- Assert.AreEqual(1, record.NumAxis);
- Assert.AreEqual(6, record.RecordSize);
+ ClassicAssert.AreEqual(1, record.NumAxis);
+ ClassicAssert.AreEqual(6, record.RecordSize);
}
[Test]
public void TestStore()
@@ -59,9 +59,9 @@ public void TestStore()
byte[] recordBytes = record.Serialize();
- Assert.AreEqual(recordBytes.Length - 4, data.Length);
+ ClassicAssert.AreEqual(recordBytes.Length - 4, data.Length);
for (int i = 0; i < data.Length; i++)
- Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
+ ClassicAssert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
}
}
}
diff --git a/testcases/main/HSSF/Record/Chart/TestAxisLineFormatRecord.cs b/testcases/main/HSSF/Record/Chart/TestAxisLineFormatRecord.cs
index 1ec44165f..f0803c6d5 100644
--- a/testcases/main/HSSF/Record/Chart/TestAxisLineFormatRecord.cs
+++ b/testcases/main/HSSF/Record/Chart/TestAxisLineFormatRecord.cs
@@ -23,7 +23,7 @@ namespace TestCases.HSSF.Record.Chart
using System;
using NPOI.HSSF.Record;
using NPOI.HSSF.Record.Chart;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
* Tests the serialization and deserialization of the AxisLineFormatRecord
@@ -48,10 +48,10 @@ public TestAxisLineFormatRecord()
public void TestLoad()
{
AxisLineFormatRecord record = new AxisLineFormatRecord(TestcaseRecordInputStream.Create((short)0x1021, data));
- Assert.AreEqual(AxisLineFormatRecord.AXIS_TYPE_MAJOR_GRID_LINE, record.AxisType);
+ ClassicAssert.AreEqual(AxisLineFormatRecord.AXIS_TYPE_MAJOR_GRID_LINE, record.AxisType);
- Assert.AreEqual(6, record.RecordSize);
+ ClassicAssert.AreEqual(6, record.RecordSize);
}
[Test]
public void TestStore()
@@ -61,9 +61,9 @@ public void TestStore()
byte[] recordBytes = record.Serialize();
- Assert.AreEqual(recordBytes.Length - 4, data.Length);
+ ClassicAssert.AreEqual(recordBytes.Length - 4, data.Length);
for (int i = 0; i < data.Length; i++)
- Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
+ ClassicAssert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/Record/Chart/TestAxisParentRecord.cs b/testcases/main/HSSF/Record/Chart/TestAxisParentRecord.cs
index 1c4421c19..3318a6952 100644
--- a/testcases/main/HSSF/Record/Chart/TestAxisParentRecord.cs
+++ b/testcases/main/HSSF/Record/Chart/TestAxisParentRecord.cs
@@ -22,7 +22,7 @@ namespace TestCases.HSSF.Record.Chart
{
using System;
using NPOI.HSSF.Record;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.Record.Chart;
/**
* Tests the serialization and deserialization of the AxisParentRecord
@@ -50,14 +50,14 @@ public TestAxisParentRecord()
public void TestLoad()
{
AxisParentRecord record = new AxisParentRecord(TestcaseRecordInputStream.Create((short)0x1041, data));
- Assert.AreEqual(AxisParentRecord.AXIS_TYPE_MAIN, record.AxisType);
- Assert.AreEqual(0x021d, record.X);
- Assert.AreEqual(0xdd, record.Y);
- Assert.AreEqual(0x0b31, record.Width);
- Assert.AreEqual(0x0b56, record.Height);
+ ClassicAssert.AreEqual(AxisParentRecord.AXIS_TYPE_MAIN, record.AxisType);
+ ClassicAssert.AreEqual(0x021d, record.X);
+ ClassicAssert.AreEqual(0xdd, record.Y);
+ ClassicAssert.AreEqual(0x0b31, record.Width);
+ ClassicAssert.AreEqual(0x0b56, record.Height);
- Assert.AreEqual(22, record.RecordSize);
+ ClassicAssert.AreEqual(22, record.RecordSize);
}
[Test]
public void TestStore()
@@ -71,9 +71,9 @@ public void TestStore()
byte[] recordBytes = record.Serialize();
- Assert.AreEqual(recordBytes.Length - 4, data.Length);
+ ClassicAssert.AreEqual(recordBytes.Length - 4, data.Length);
for (int i = 0; i < data.Length; i++)
- Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
+ ClassicAssert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/Record/Chart/TestAxisRecord.cs b/testcases/main/HSSF/Record/Chart/TestAxisRecord.cs
index eba6f02cc..d871379d1 100644
--- a/testcases/main/HSSF/Record/Chart/TestAxisRecord.cs
+++ b/testcases/main/HSSF/Record/Chart/TestAxisRecord.cs
@@ -22,7 +22,7 @@ namespace TestCases.HSSF.Record.Chart
{
using System;
using NPOI.HSSF.Record.Chart;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.Record;
/**
@@ -54,14 +54,14 @@ public void TestLoad()
{
AxisRecord record = new AxisRecord(TestcaseRecordInputStream.Create((short)0x101d, data));
- Assert.AreEqual(AxisRecord.AXIS_TYPE_CATEGORY_OR_X_AXIS, record.AxisType);
- Assert.AreEqual(0, record.Reserved1);
- Assert.AreEqual(0, record.Reserved2);
- Assert.AreEqual(0, record.Reserved3);
- Assert.AreEqual(0, record.Reserved4);
+ ClassicAssert.AreEqual(AxisRecord.AXIS_TYPE_CATEGORY_OR_X_AXIS, record.AxisType);
+ ClassicAssert.AreEqual(0, record.Reserved1);
+ ClassicAssert.AreEqual(0, record.Reserved2);
+ ClassicAssert.AreEqual(0, record.Reserved3);
+ ClassicAssert.AreEqual(0, record.Reserved4);
- Assert.AreEqual(4 + 18, record.RecordSize);
+ ClassicAssert.AreEqual(4 + 18, record.RecordSize);
}
[Test]
public void TestStore()
@@ -75,9 +75,9 @@ public void TestStore()
byte[] recordBytes = record.Serialize();
- Assert.AreEqual(recordBytes.Length - 4, data.Length);
+ ClassicAssert.AreEqual(recordBytes.Length - 4, data.Length);
for (int i = 0; i < data.Length; i++)
- Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
+ ClassicAssert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
}
}
}
diff --git a/testcases/main/HSSF/Record/Chart/TestAxisUsedRecord.cs b/testcases/main/HSSF/Record/Chart/TestAxisUsedRecord.cs
index ac72d4cdc..91c90c8d6 100644
--- a/testcases/main/HSSF/Record/Chart/TestAxisUsedRecord.cs
+++ b/testcases/main/HSSF/Record/Chart/TestAxisUsedRecord.cs
@@ -23,7 +23,7 @@ namespace TestCases.HSSF.Record.Chart
using System;
using NPOI.HSSF.Record;
using NPOI.HSSF.Record.Chart;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
* Tests the serialization and deserialization of the AxisUsedRecord
@@ -48,8 +48,8 @@ public TestAxisUsedRecord()
public void TestLoad()
{
AxisUsedRecord record = new AxisUsedRecord(TestcaseRecordInputStream.Create((short)0x1046, data));
- Assert.AreEqual(1, record.NumAxis);
- Assert.AreEqual(6, record.RecordSize);
+ ClassicAssert.AreEqual(1, record.NumAxis);
+ ClassicAssert.AreEqual(6, record.RecordSize);
}
[Test]
public void TestStore()
@@ -59,9 +59,9 @@ public void TestStore()
byte[] recordBytes = record.Serialize();
- Assert.AreEqual(recordBytes.Length - 4, data.Length);
+ ClassicAssert.AreEqual(recordBytes.Length - 4, data.Length);
for (int i = 0; i < data.Length; i++)
- Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
+ ClassicAssert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
}
}
}
diff --git a/testcases/main/HSSF/Record/Chart/TestBarRecord.cs b/testcases/main/HSSF/Record/Chart/TestBarRecord.cs
index e3e2ae6a5..21602f970 100644
--- a/testcases/main/HSSF/Record/Chart/TestBarRecord.cs
+++ b/testcases/main/HSSF/Record/Chart/TestBarRecord.cs
@@ -24,7 +24,7 @@ namespace TestCases.HSSF.Record.Chart
using System;
using NPOI.HSSF.Record;
using NPOI.HSSF.Record.Chart;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
* Tests the serialization and deserialization of the BarRecord
@@ -52,16 +52,16 @@ public void TestLoad()
{
BarRecord record = new BarRecord(TestcaseRecordInputStream.Create((short)0x1017, data));
- Assert.AreEqual(0, record.BarSpace);
- Assert.AreEqual(0x96, record.CategorySpace);
- Assert.AreEqual(0, record.FormatFlags);
- Assert.AreEqual(false, record.IsHorizontal);
- Assert.AreEqual(false, record.IsStacked);
- Assert.AreEqual(false, record.IsDisplayAsPercentage);
- Assert.AreEqual(false, record.IsShadow);
+ ClassicAssert.AreEqual(0, record.BarSpace);
+ ClassicAssert.AreEqual(0x96, record.CategorySpace);
+ ClassicAssert.AreEqual(0, record.FormatFlags);
+ ClassicAssert.AreEqual(false, record.IsHorizontal);
+ ClassicAssert.AreEqual(false, record.IsStacked);
+ ClassicAssert.AreEqual(false, record.IsDisplayAsPercentage);
+ ClassicAssert.AreEqual(false, record.IsShadow);
- Assert.AreEqual(10, record.RecordSize);
+ ClassicAssert.AreEqual(10, record.RecordSize);
}
[Test]
public void TestStore()
@@ -76,9 +76,9 @@ public void TestStore()
byte[] recordBytes = record.Serialize();
- Assert.AreEqual(recordBytes.Length - 4, data.Length);
+ ClassicAssert.AreEqual(recordBytes.Length - 4, data.Length);
for (int i = 0; i < data.Length; i++)
- Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
+ ClassicAssert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/Record/Chart/TestCatSerRangeRecord.cs b/testcases/main/HSSF/Record/Chart/TestCatSerRangeRecord.cs
index bd3a96634..1a0c8aea7 100644
--- a/testcases/main/HSSF/Record/Chart/TestCatSerRangeRecord.cs
+++ b/testcases/main/HSSF/Record/Chart/TestCatSerRangeRecord.cs
@@ -23,7 +23,7 @@ namespace TestCases.HSSF.Record.Chart
using System;
using NPOI.HSSF.Record;
using NPOI.HSSF.Record.Chart;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
* Tests the serialization and deserialization of the CategorySeriesAxisRecord
@@ -52,16 +52,16 @@ public void TestLoad()
{
CatSerRangeRecord record = new CatSerRangeRecord(TestcaseRecordInputStream.Create((short)0x1020, data));
- Assert.AreEqual(1, record.CrossPoint);
- Assert.AreEqual(1, record.LabelInterval);
- Assert.AreEqual(1, record.MarkInterval);
- Assert.AreEqual(1, record.Options);
- Assert.AreEqual(true, record.IsBetween);
- Assert.AreEqual(false, record.IsMaxCross);
- Assert.AreEqual(false, record.IsReverse);
+ ClassicAssert.AreEqual(1, record.CrossPoint);
+ ClassicAssert.AreEqual(1, record.LabelInterval);
+ ClassicAssert.AreEqual(1, record.MarkInterval);
+ ClassicAssert.AreEqual(1, record.Options);
+ ClassicAssert.AreEqual(true, record.IsBetween);
+ ClassicAssert.AreEqual(false, record.IsMaxCross);
+ ClassicAssert.AreEqual(false, record.IsReverse);
- Assert.AreEqual(4 + 8, record.RecordSize);
+ ClassicAssert.AreEqual(4 + 8, record.RecordSize);
}
[Test]
public void TestStore()
@@ -76,9 +76,9 @@ public void TestStore()
byte[] recordBytes = record.Serialize();
- Assert.AreEqual(recordBytes.Length - 4, data.Length);
+ ClassicAssert.AreEqual(recordBytes.Length - 4, data.Length);
for (int i = 0; i < data.Length; i++)
- Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
+ ClassicAssert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/Record/Chart/TestChartFormatRecord.cs b/testcases/main/HSSF/Record/Chart/TestChartFormatRecord.cs
index 7d91c8837..38df2e1df 100644
--- a/testcases/main/HSSF/Record/Chart/TestChartFormatRecord.cs
+++ b/testcases/main/HSSF/Record/Chart/TestChartFormatRecord.cs
@@ -17,7 +17,7 @@ limitations under the License.
namespace TestCases.HSSF.Record.Chart
{
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.Record;
using NPOI.Util;
using TestCases.HSSF.Record;
@@ -53,11 +53,11 @@ public void TestLoad()
{
throw new AssertionException("Identified bug 44693d");
}
- Assert.AreEqual(0, in1.Remaining);
- Assert.AreEqual(24, record.RecordSize);
+ ClassicAssert.AreEqual(0, in1.Remaining);
+ ClassicAssert.AreEqual(24, record.RecordSize);
byte[] data2 = record.Serialize();
- Assert.IsTrue(Arrays.Equals(data, data2));
+ ClassicAssert.IsTrue(Arrays.Equals(data, data2));
}
}
diff --git a/testcases/main/HSSF/Record/Chart/TestChartRecord.cs b/testcases/main/HSSF/Record/Chart/TestChartRecord.cs
index d76391e19..232cf221f 100644
--- a/testcases/main/HSSF/Record/Chart/TestChartRecord.cs
+++ b/testcases/main/HSSF/Record/Chart/TestChartRecord.cs
@@ -23,7 +23,7 @@ namespace TestCases.HSSF.Record.Chart
using System;
using NPOI.HSSF.Record;
using NPOI.HSSF.Record.Chart;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
* Tests the serialization and deserialization of the ChartRecord
@@ -52,13 +52,13 @@ public void TestLoad()
{
ChartRecord record = new ChartRecord(TestcaseRecordInputStream.Create((short)0x1002, data));
- Assert.AreEqual(0, record.X);
- Assert.AreEqual(0, record.Y);
- Assert.AreEqual(30474216, record.Width);
- Assert.AreEqual(15060168, record.Height);
+ ClassicAssert.AreEqual(0, record.X);
+ ClassicAssert.AreEqual(0, record.Y);
+ ClassicAssert.AreEqual(30474216, record.Width);
+ ClassicAssert.AreEqual(15060168, record.Height);
- Assert.AreEqual(20, record.RecordSize);
+ ClassicAssert.AreEqual(20, record.RecordSize);
}
[Test]
public void TestStore()
@@ -71,9 +71,9 @@ public void TestStore()
byte[] recordBytes = record.Serialize();
- Assert.AreEqual(recordBytes.Length - 4, data.Length);
+ ClassicAssert.AreEqual(recordBytes.Length - 4, data.Length);
for (int i = 0; i < data.Length; i++)
- Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
+ ClassicAssert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
}
}
}
diff --git a/testcases/main/HSSF/Record/Chart/TestChartTitleFormatRecord.cs b/testcases/main/HSSF/Record/Chart/TestChartTitleFormatRecord.cs
index 4da7a4d1b..dd9c1b3be 100644
--- a/testcases/main/HSSF/Record/Chart/TestChartTitleFormatRecord.cs
+++ b/testcases/main/HSSF/Record/Chart/TestChartTitleFormatRecord.cs
@@ -20,7 +20,7 @@ namespace TestCases.HSSF.Record.Chart
using System;
using System.Collections;
using System.IO;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using TestCases.HSSF;
using NPOI.HSSF.Record;
@@ -54,11 +54,11 @@ public void TestRecord()
din.Close();
// Should've found one
- Assert.AreEqual(1, grabber.chartTitleFormatRecords.Count);
+ ClassicAssert.AreEqual(1, grabber.chartTitleFormatRecords.Count);
// And it should be of something interesting
AlRunsRecord r =
(AlRunsRecord)grabber.chartTitleFormatRecords[0];
- Assert.AreEqual(3, r.GetFormatCount());
+ ClassicAssert.AreEqual(3, r.GetFormatCount());
}
private class ChartTitleFormatRecordGrabber : IHSSFListener
diff --git a/testcases/main/HSSF/Record/Chart/TestDatRecord.cs b/testcases/main/HSSF/Record/Chart/TestDatRecord.cs
index 3ffa90bed..c4c6d0f86 100644
--- a/testcases/main/HSSF/Record/Chart/TestDatRecord.cs
+++ b/testcases/main/HSSF/Record/Chart/TestDatRecord.cs
@@ -24,7 +24,7 @@ namespace TestCases.HSSF.Record.Chart
using System;
using NPOI.HSSF.Record;
using NPOI.HSSF.Record.Chart;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
* Tests the serialization and deserialization of the DatRecord
@@ -51,14 +51,14 @@ public void TestLoad()
{
DatRecord record = new DatRecord(TestcaseRecordInputStream.Create((short)0x1063, data));
- Assert.AreEqual(0xD, record.Options);
- Assert.AreEqual(true, record.IsHorizontalBorder());
- Assert.AreEqual(false, record.IsVerticalBorder());
- Assert.AreEqual(true, record.IsBorder());
- Assert.AreEqual(true, record.IsShowSeriesKey());
+ ClassicAssert.AreEqual(0xD, record.Options);
+ ClassicAssert.AreEqual(true, record.IsHorizontalBorder());
+ ClassicAssert.AreEqual(false, record.IsVerticalBorder());
+ ClassicAssert.AreEqual(true, record.IsBorder());
+ ClassicAssert.AreEqual(true, record.IsShowSeriesKey());
- Assert.AreEqual(6, record.RecordSize);
+ ClassicAssert.AreEqual(6, record.RecordSize);
}
[Test]
public void TestStore()
@@ -71,9 +71,9 @@ public void TestStore()
byte[] recordBytes = record.Serialize();
- Assert.AreEqual(recordBytes.Length - 4, data.Length);
+ ClassicAssert.AreEqual(recordBytes.Length - 4, data.Length);
for (int i = 0; i < data.Length; i++)
- Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
+ ClassicAssert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/Record/Chart/TestDataFormatRecord.cs b/testcases/main/HSSF/Record/Chart/TestDataFormatRecord.cs
index ecdf68ad4..e0b6800c5 100644
--- a/testcases/main/HSSF/Record/Chart/TestDataFormatRecord.cs
+++ b/testcases/main/HSSF/Record/Chart/TestDataFormatRecord.cs
@@ -23,7 +23,7 @@ namespace TestCases.HSSF.Record.Chart
using System;
using NPOI.HSSF.Record;
using NPOI.HSSF.Record.Chart;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
* Tests the serialization and deserialization of the DataFormatRecord
@@ -52,14 +52,14 @@ public void TestLoad()
{
DataFormatRecord record = new DataFormatRecord(TestcaseRecordInputStream.Create((short)0x1006, data));
- Assert.AreEqual(record.PointNumber, unchecked((short)0xFFFF));
- Assert.AreEqual(0, record.SeriesIndex);
- Assert.AreEqual(0, record.SeriesNumber);
- Assert.AreEqual(0, record.FormatFlags);
- Assert.AreEqual(false, record.UseExcel4Colors);
+ ClassicAssert.AreEqual(record.PointNumber, unchecked((short)0xFFFF));
+ ClassicAssert.AreEqual(0, record.SeriesIndex);
+ ClassicAssert.AreEqual(0, record.SeriesNumber);
+ ClassicAssert.AreEqual(0, record.FormatFlags);
+ ClassicAssert.AreEqual(false, record.UseExcel4Colors);
- Assert.AreEqual(12, record.RecordSize);
+ ClassicAssert.AreEqual(12, record.RecordSize);
}
[Test]
public void TestStore()
@@ -73,9 +73,9 @@ public void TestStore()
byte[] recordBytes = record.Serialize();
- Assert.AreEqual(recordBytes.Length - 4, data.Length);
+ ClassicAssert.AreEqual(recordBytes.Length - 4, data.Length);
for (int i = 0; i < data.Length; i++)
- Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
+ ClassicAssert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/Record/Chart/TestDefaultTextRecord.cs b/testcases/main/HSSF/Record/Chart/TestDefaultTextRecord.cs
index 837e74a31..878a7f328 100644
--- a/testcases/main/HSSF/Record/Chart/TestDefaultTextRecord.cs
+++ b/testcases/main/HSSF/Record/Chart/TestDefaultTextRecord.cs
@@ -23,7 +23,7 @@ namespace TestCases.HSSF.Record.Chart
using System;
using NPOI.HSSF.Record;
using NPOI.HSSF.Record.Chart;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
* Tests the serialization and deserialization of the DefaultDataLabelTextPropertiesRecord
@@ -49,8 +49,8 @@ public void TestLoad()
{
DefaultTextRecord record = new DefaultTextRecord(TestcaseRecordInputStream.Create((short)0x1024, data));
- Assert.AreEqual(2, (int)record.FormatType);
- Assert.AreEqual(6, record.RecordSize);
+ ClassicAssert.AreEqual(2, (int)record.FormatType);
+ ClassicAssert.AreEqual(6, record.RecordSize);
}
[Test]
public void TestStore()
@@ -60,9 +60,9 @@ public void TestStore()
byte[] recordBytes = record.Serialize();
- Assert.AreEqual(recordBytes.Length - 4, data.Length);
+ ClassicAssert.AreEqual(recordBytes.Length - 4, data.Length);
for (int i = 0; i < data.Length; i++)
- Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
+ ClassicAssert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
}
}
}
diff --git a/testcases/main/HSSF/Record/Chart/TestFbiRecord.cs b/testcases/main/HSSF/Record/Chart/TestFbiRecord.cs
index aae9f6bd3..7daa8e37f 100644
--- a/testcases/main/HSSF/Record/Chart/TestFbiRecord.cs
+++ b/testcases/main/HSSF/Record/Chart/TestFbiRecord.cs
@@ -21,7 +21,7 @@ namespace TestCases.HSSF.Record.Chart
using System;
using NPOI.HSSF.Record;
using NPOI.HSSF.Record.Chart;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
* Tests the serialization and deserialization of the FontBasisRecord
@@ -52,14 +52,14 @@ public void TestLoad()
{
FbiRecord record = new FbiRecord(TestcaseRecordInputStream.Create((short)0x1060, data));
- Assert.AreEqual(0x1a28, record.XBasis);
- Assert.AreEqual(0x0f9c, record.YBasis);
- Assert.AreEqual(0xc8, record.HeightBasis);
- Assert.AreEqual(0x00, record.Scale);
- Assert.AreEqual(0x05, record.IndexToFontTable);
+ ClassicAssert.AreEqual(0x1a28, record.XBasis);
+ ClassicAssert.AreEqual(0x0f9c, record.YBasis);
+ ClassicAssert.AreEqual(0xc8, record.HeightBasis);
+ ClassicAssert.AreEqual(0x00, record.Scale);
+ ClassicAssert.AreEqual(0x05, record.IndexToFontTable);
- Assert.AreEqual(14, record.RecordSize);
+ ClassicAssert.AreEqual(14, record.RecordSize);
}
[Test]
public void TestStore()
@@ -72,9 +72,9 @@ public void TestStore()
record.IndexToFontTable = ((short)0x05);
byte[] recordBytes = record.Serialize();
- Assert.AreEqual(recordBytes.Length - 4, data.Length);
+ ClassicAssert.AreEqual(recordBytes.Length - 4, data.Length);
for (int i = 0; i < data.Length; i++)
- Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
+ ClassicAssert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/Record/Chart/TestFontBasisRecord.cs b/testcases/main/HSSF/Record/Chart/TestFontBasisRecord.cs
index 4274219f6..f864f1648 100644
--- a/testcases/main/HSSF/Record/Chart/TestFontBasisRecord.cs
+++ b/testcases/main/HSSF/Record/Chart/TestFontBasisRecord.cs
@@ -21,7 +21,7 @@ namespace TestCases.HSSF.Record.Chart
using System;
using NPOI.HSSF.Record;
using NPOI.HSSF.Record.Chart;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
* Tests the serialization and deserialization of the FontBasisRecord
@@ -51,14 +51,14 @@ public void TestLoad()
{
FontBasisRecord record = new FontBasisRecord(TestcaseRecordInputStream.Create((short)0x1060, data));
- Assert.AreEqual(0x1a28, record.XBasis);
- Assert.AreEqual(0x0f9c, record.YBasis);
- Assert.AreEqual(0xc8, record.HeightBasis);
- Assert.AreEqual(0x00, record.Scale);
- Assert.AreEqual(0x05, record.IndexToFontTable);
+ ClassicAssert.AreEqual(0x1a28, record.XBasis);
+ ClassicAssert.AreEqual(0x0f9c, record.YBasis);
+ ClassicAssert.AreEqual(0xc8, record.HeightBasis);
+ ClassicAssert.AreEqual(0x00, record.Scale);
+ ClassicAssert.AreEqual(0x05, record.IndexToFontTable);
- Assert.AreEqual(14, record.RecordSize);
+ ClassicAssert.AreEqual(14, record.RecordSize);
}
[Test]
public void TestStore()
@@ -71,9 +71,9 @@ public void TestStore()
record.IndexToFontTable = ((short)0x05);
byte[] recordBytes = record.Serialize();
- Assert.AreEqual(recordBytes.Length - 4, data.Length);
+ ClassicAssert.AreEqual(recordBytes.Length - 4, data.Length);
for (int i = 0; i < data.Length; i++)
- Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
+ ClassicAssert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/Record/Chart/TestFontIndexRecord.cs b/testcases/main/HSSF/Record/Chart/TestFontIndexRecord.cs
index b62f57f1e..6816327f2 100644
--- a/testcases/main/HSSF/Record/Chart/TestFontIndexRecord.cs
+++ b/testcases/main/HSSF/Record/Chart/TestFontIndexRecord.cs
@@ -23,7 +23,7 @@ namespace TestCases.HSSF.Record.Chart
using System;
using NPOI.HSSF.Record;
using NPOI.HSSF.Record.Chart;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
* Tests the serialization and deserialization of the FontIndexRecord
@@ -49,10 +49,10 @@ public void TestLoad()
{
FontIndexRecord record = new FontIndexRecord(TestcaseRecordInputStream.Create((short)0x1026, data));
- Assert.AreEqual(5, record.FontIndex);
+ ClassicAssert.AreEqual(5, record.FontIndex);
- Assert.AreEqual(6, record.RecordSize);
+ ClassicAssert.AreEqual(6, record.RecordSize);
}
[Test]
public void TestStore()
@@ -62,9 +62,9 @@ public void TestStore()
byte[] recordBytes = record.Serialize();
- Assert.AreEqual(recordBytes.Length - 4, data.Length);
+ ClassicAssert.AreEqual(recordBytes.Length - 4, data.Length);
for (int i = 0; i < data.Length; i++)
- Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
+ ClassicAssert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/Record/Chart/TestFrameRecord.cs b/testcases/main/HSSF/Record/Chart/TestFrameRecord.cs
index 6ea1d30f1..8a0b3c86f 100644
--- a/testcases/main/HSSF/Record/Chart/TestFrameRecord.cs
+++ b/testcases/main/HSSF/Record/Chart/TestFrameRecord.cs
@@ -23,7 +23,7 @@ namespace TestCases.HSSF.Record.Chart
using System;
using NPOI.HSSF.Record;
using NPOI.HSSF.Record.Chart;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
* Tests the serialization and deserialization of the FrameRecord
@@ -50,13 +50,13 @@ public void TestLoad()
{
FrameRecord record = new FrameRecord(TestcaseRecordInputStream.Create((short)0x1032, data));
- Assert.AreEqual(FrameRecord.BORDER_TYPE_REGULAR, record.BorderType);
- Assert.AreEqual(2, record.Options);
- Assert.AreEqual(false, record.IsAutoSize);
- Assert.AreEqual(true, record.IsAutoPosition);
+ ClassicAssert.AreEqual(FrameRecord.BORDER_TYPE_REGULAR, record.BorderType);
+ ClassicAssert.AreEqual(2, record.Options);
+ ClassicAssert.AreEqual(false, record.IsAutoSize);
+ ClassicAssert.AreEqual(true, record.IsAutoPosition);
- Assert.AreEqual(8, record.RecordSize);
+ ClassicAssert.AreEqual(8, record.RecordSize);
}
[Test]
public void TestStore()
@@ -69,9 +69,9 @@ public void TestStore()
byte[] recordBytes = record.Serialize();
- Assert.AreEqual(recordBytes.Length - 4, data.Length);
+ ClassicAssert.AreEqual(recordBytes.Length - 4, data.Length);
for (int i = 0; i < data.Length; i++)
- Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
+ ClassicAssert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
}
}
}
diff --git a/testcases/main/HSSF/Record/Chart/TestGelFrameRecord.cs b/testcases/main/HSSF/Record/Chart/TestGelFrameRecord.cs
index 3ee3f649f..adcf86880 100644
--- a/testcases/main/HSSF/Record/Chart/TestGelFrameRecord.cs
+++ b/testcases/main/HSSF/Record/Chart/TestGelFrameRecord.cs
@@ -20,7 +20,7 @@ limitations under the License.
using System.Text;
using NPOI.HSSF.Record;
using NPOI.HSSF.Record.Chart;
-using NUnit.Framework;
+using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.Util;
namespace TestCases.HSSF.Record.Chart
@@ -56,7 +56,7 @@ 00 20 A5 C1 00 00 00 00 A6 01 FF FF FF FF A7 01
public void TestLoad()
{
GelFrameRecord record = new GelFrameRecord(TestcaseRecordInputStream.Create((short)0x1066, data));
- //Assert.AreEqual(0xD, record.Options);
+ //ClassicAssert.AreEqual(0xD, record.Options);
}
}
}
diff --git a/testcases/main/HSSF/Record/Chart/TestIFmtRecordRecord.cs b/testcases/main/HSSF/Record/Chart/TestIFmtRecordRecord.cs
index 1cbd7e9b3..579f3e97f 100644
--- a/testcases/main/HSSF/Record/Chart/TestIFmtRecordRecord.cs
+++ b/testcases/main/HSSF/Record/Chart/TestIFmtRecordRecord.cs
@@ -23,7 +23,7 @@ namespace TestCases.HSSF.Record.Chart
using System;
using NPOI.HSSF.Record;
using NPOI.HSSF.Record.Chart;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
* Tests the serialization and deserialization of the NumberFormatIndexRecord
@@ -50,10 +50,10 @@ public void TestLoad()
{
IFmtRecordRecord record = new IFmtRecordRecord(TestcaseRecordInputStream.Create((short)0x104e, data));
- Assert.AreEqual(5, record.FormatIndex);
+ ClassicAssert.AreEqual(5, record.FormatIndex);
- Assert.AreEqual(6, record.RecordSize);
+ ClassicAssert.AreEqual(6, record.RecordSize);
}
@@ -65,9 +65,9 @@ public void TestStore()
byte[] recordBytes = record.Serialize();
- Assert.AreEqual(recordBytes.Length - 4, data.Length);
+ ClassicAssert.AreEqual(recordBytes.Length - 4, data.Length);
for (int i = 0; i < data.Length; i++)
- Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
+ ClassicAssert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/Record/Chart/TestLegendRecord.cs b/testcases/main/HSSF/Record/Chart/TestLegendRecord.cs
index bcc4cf1f1..56407416d 100644
--- a/testcases/main/HSSF/Record/Chart/TestLegendRecord.cs
+++ b/testcases/main/HSSF/Record/Chart/TestLegendRecord.cs
@@ -24,7 +24,7 @@ namespace TestCases.HSSF.Record.Chart
using NPOI.HSSF.Record;
using NPOI.HSSF.Record.Chart;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
* Tests the serialization and deserialization of the LegendRecord
@@ -51,28 +51,28 @@ public void TestLoad()
LegendRecord record = new LegendRecord(TestcaseRecordInputStream.Create((short)0x1015, data));
- Assert.AreEqual((int)0xe76, record.XAxisUpperLeft);
+ ClassicAssert.AreEqual((int)0xe76, record.XAxisUpperLeft);
- Assert.AreEqual((int)0x786, record.YAxisUpperLeft);
+ ClassicAssert.AreEqual((int)0x786, record.YAxisUpperLeft);
- Assert.AreEqual((int)0x119, record.XSize);
+ ClassicAssert.AreEqual((int)0x119, record.XSize);
- Assert.AreEqual((int)0x8b, record.YSize);
+ ClassicAssert.AreEqual((int)0x8b, record.YSize);
- Assert.AreEqual((byte)0x3, record.Type);
+ ClassicAssert.AreEqual((byte)0x3, record.Type);
- Assert.AreEqual((byte)0x1, record.Spacing);
+ ClassicAssert.AreEqual((byte)0x1, record.Spacing);
- Assert.AreEqual((short)0x1f, record.Options);
- Assert.AreEqual(true, record.IsAutoPosition);
- Assert.AreEqual(true, record.IsAutoSeries);
- Assert.AreEqual(true, record.IsAutoXPositioning);
- Assert.AreEqual(true, record.IsAutoYPositioning);
- Assert.AreEqual(true, record.IsVertical);
- Assert.AreEqual(false, record.IsDataTable);
+ ClassicAssert.AreEqual((short)0x1f, record.Options);
+ ClassicAssert.AreEqual(true, record.IsAutoPosition);
+ ClassicAssert.AreEqual(true, record.IsAutoSeries);
+ ClassicAssert.AreEqual(true, record.IsAutoXPositioning);
+ ClassicAssert.AreEqual(true, record.IsAutoYPositioning);
+ ClassicAssert.AreEqual(true, record.IsVertical);
+ ClassicAssert.AreEqual(false, record.IsDataTable);
- Assert.AreEqual(24, record.RecordSize);
+ ClassicAssert.AreEqual(24, record.RecordSize);
}
[Test]
public void TestStore()
@@ -103,9 +103,9 @@ public void TestStore()
byte[] recordBytes = record.Serialize();
- Assert.AreEqual(recordBytes.Length - 4, data.Length);
+ ClassicAssert.AreEqual(recordBytes.Length - 4, data.Length);
for (int i = 0; i < data.Length; i++)
- Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
+ ClassicAssert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/Record/Chart/TestLineFormatRecord.cs b/testcases/main/HSSF/Record/Chart/TestLineFormatRecord.cs
index 6ad2e7010..e87287a82 100644
--- a/testcases/main/HSSF/Record/Chart/TestLineFormatRecord.cs
+++ b/testcases/main/HSSF/Record/Chart/TestLineFormatRecord.cs
@@ -23,7 +23,7 @@ namespace TestCases.HSSF.Record.Chart
using System;
using NPOI.HSSF.Record;
using NPOI.HSSF.Record.Chart;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
* Tests the serialization and deserialization of the LineFormatRecord
@@ -52,16 +52,16 @@ public TestLineFormatRecord()
public void TestLoad()
{
LineFormatRecord record = new LineFormatRecord(TestcaseRecordInputStream.Create((short)0x1007, data));
- Assert.AreEqual(0, record.LineColor);
- Assert.AreEqual(0, record.LinePattern);
- Assert.AreEqual(0, record.Weight);
- Assert.AreEqual(1, record.Format);
- Assert.AreEqual(true, record.IsAuto);
- Assert.AreEqual(false, record.IsDrawTicks);
- Assert.AreEqual(0x4d, record.ColourPaletteIndex);
+ ClassicAssert.AreEqual(0, record.LineColor);
+ ClassicAssert.AreEqual(0, record.LinePattern);
+ ClassicAssert.AreEqual(0, record.Weight);
+ ClassicAssert.AreEqual(1, record.Format);
+ ClassicAssert.AreEqual(true, record.IsAuto);
+ ClassicAssert.AreEqual(false, record.IsDrawTicks);
+ ClassicAssert.AreEqual(0x4d, record.ColourPaletteIndex);
- Assert.AreEqual(16, record.RecordSize);
+ ClassicAssert.AreEqual(16, record.RecordSize);
}
[Test]
public void TestStore()
@@ -76,9 +76,9 @@ public void TestStore()
byte[] recordBytes = record.Serialize();
- Assert.AreEqual(recordBytes.Length - 4, data.Length);
+ ClassicAssert.AreEqual(recordBytes.Length - 4, data.Length);
for (int i = 0; i < data.Length; i++)
- Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
+ ClassicAssert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
}
}
}
diff --git a/testcases/main/HSSF/Record/Chart/TestLinkedDataRecord.cs b/testcases/main/HSSF/Record/Chart/TestLinkedDataRecord.cs
index 7e99f313f..8565d5a47 100644
--- a/testcases/main/HSSF/Record/Chart/TestLinkedDataRecord.cs
+++ b/testcases/main/HSSF/Record/Chart/TestLinkedDataRecord.cs
@@ -25,7 +25,7 @@ namespace TestCases.HSSF.Record.Chart
using NPOI.HSSF.Record;
using NPOI.SS.Formula;
using NPOI.HSSF.Record.Chart;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.SS.Formula.PTG;
/**
@@ -171,18 +171,18 @@ public void TestLoad()
{
LinkedDataRecord record = new LinkedDataRecord(TestcaseRecordInputStream.Create((short)0x1051, data));
- Assert.AreEqual(LinkedDataRecord.LINK_TYPE_VALUES, record.LinkType);
- Assert.AreEqual(LinkedDataRecord.REFERENCE_TYPE_WORKSHEET, record.ReferenceType);
- Assert.AreEqual(0, record.Options);
- Assert.AreEqual(false, record.IsCustomNumberFormat);
- Assert.AreEqual(0, record.IndexNumberFmtRecord);
+ ClassicAssert.AreEqual(LinkedDataRecord.LINK_TYPE_VALUES, record.LinkType);
+ ClassicAssert.AreEqual(LinkedDataRecord.REFERENCE_TYPE_WORKSHEET, record.ReferenceType);
+ ClassicAssert.AreEqual(0, record.Options);
+ ClassicAssert.AreEqual(false, record.IsCustomNumberFormat);
+ ClassicAssert.AreEqual(0, record.IndexNumberFmtRecord);
Area3DPtg ptgExpected = new Area3DPtg(0, 7936, 0, 0,false, false, false, false, 0);
Object ptgActual = record.FormulaOfLink[0];
- Assert.AreEqual(ptgExpected.ToString(), ptgActual.ToString());
+ ClassicAssert.AreEqual(ptgExpected.ToString(), ptgActual.ToString());
- Assert.AreEqual(data.Length + 4, record.RecordSize);
+ ClassicAssert.AreEqual(data.Length + 4, record.RecordSize);
}
[Test]
@@ -199,9 +199,9 @@ public void TestStore()
record.FormulaOfLink = (new Ptg[] { ptg, });
byte[] recordBytes = record.Serialize();
- Assert.AreEqual(recordBytes.Length - 4, data.Length);
+ ClassicAssert.AreEqual(recordBytes.Length - 4, data.Length);
for (int i = 0; i < data.Length; i++)
- Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
+ ClassicAssert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/Record/Chart/TestNumberFormatIndexRecord.cs b/testcases/main/HSSF/Record/Chart/TestNumberFormatIndexRecord.cs
index 6a0111570..d26edb58b 100644
--- a/testcases/main/HSSF/Record/Chart/TestNumberFormatIndexRecord.cs
+++ b/testcases/main/HSSF/Record/Chart/TestNumberFormatIndexRecord.cs
@@ -23,7 +23,7 @@ namespace TestCases.HSSF.Record.Chart
using System;
using NPOI.HSSF.Record;
using NPOI.HSSF.Record.Chart;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
* Tests the serialization and deserialization of the NumberFormatIndexRecord
@@ -50,10 +50,10 @@ public void TestLoad()
{
NumberFormatIndexRecord record = new NumberFormatIndexRecord(TestcaseRecordInputStream.Create((short)0x104e, data));
- Assert.AreEqual(5, record.FormatIndex);
+ ClassicAssert.AreEqual(5, record.FormatIndex);
- Assert.AreEqual(6, record.RecordSize);
+ ClassicAssert.AreEqual(6, record.RecordSize);
}
@@ -65,9 +65,9 @@ public void TestStore()
byte[] recordBytes = record.Serialize();
- Assert.AreEqual(recordBytes.Length - 4, data.Length);
+ ClassicAssert.AreEqual(recordBytes.Length - 4, data.Length);
for (int i = 0; i < data.Length; i++)
- Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
+ ClassicAssert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/Record/Chart/TestObjectLinkRecord.cs b/testcases/main/HSSF/Record/Chart/TestObjectLinkRecord.cs
index 3544d69ee..441bccd43 100644
--- a/testcases/main/HSSF/Record/Chart/TestObjectLinkRecord.cs
+++ b/testcases/main/HSSF/Record/Chart/TestObjectLinkRecord.cs
@@ -23,7 +23,7 @@ namespace TestCases.HSSF.Record.Chart
using System;
using NPOI.HSSF.Record;
using NPOI.HSSF.Record.Chart;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
* Tests the serialization and deserialization of the ObjectLinkRecord
@@ -50,14 +50,14 @@ public void TestLoad()
ObjectLinkRecord record = new ObjectLinkRecord(TestcaseRecordInputStream.Create((short)0x1027, data));
- Assert.AreEqual((short)3, record.AnchorId);
+ ClassicAssert.AreEqual((short)3, record.AnchorId);
- Assert.AreEqual((short)0x00, record.Link1);
+ ClassicAssert.AreEqual((short)0x00, record.Link1);
- Assert.AreEqual((short)0x00, record.Link2);
+ ClassicAssert.AreEqual((short)0x00, record.Link2);
- Assert.AreEqual(10, record.RecordSize);
+ ClassicAssert.AreEqual(10, record.RecordSize);
}
[Test]
public void TestStore()
@@ -74,9 +74,9 @@ public void TestStore()
byte[] recordBytes = record.Serialize();
- Assert.AreEqual(recordBytes.Length - 4, data.Length);
+ ClassicAssert.AreEqual(recordBytes.Length - 4, data.Length);
for (int i = 0; i < data.Length; i++)
- Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
+ ClassicAssert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/Record/Chart/TestPlotAreaRecord.cs b/testcases/main/HSSF/Record/Chart/TestPlotAreaRecord.cs
index b20d6df64..f7769a9ce 100644
--- a/testcases/main/HSSF/Record/Chart/TestPlotAreaRecord.cs
+++ b/testcases/main/HSSF/Record/Chart/TestPlotAreaRecord.cs
@@ -23,7 +23,7 @@ namespace TestCases.HSSF.Record.Chart
using System;
using NPOI.HSSF.Record;
using NPOI.HSSF.Record.Chart;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
* Tests the serialization and deserialization of the PlotAreaRecord
@@ -51,7 +51,7 @@ public void TestLoad()
- Assert.AreEqual(4, record.RecordSize);
+ ClassicAssert.AreEqual(4, record.RecordSize);
}
[Test]
public void TestStore()
@@ -59,9 +59,9 @@ public void TestStore()
PlotAreaRecord record = new PlotAreaRecord();
byte[] recordBytes = record.Serialize();
- Assert.AreEqual(recordBytes.Length - 4, data.Length);
+ ClassicAssert.AreEqual(recordBytes.Length - 4, data.Length);
for (int i = 0; i < data.Length; i++)
- Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
+ ClassicAssert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/Record/Chart/TestPlotGrowthRecord.cs b/testcases/main/HSSF/Record/Chart/TestPlotGrowthRecord.cs
index bfe9e8252..32a2d716f 100644
--- a/testcases/main/HSSF/Record/Chart/TestPlotGrowthRecord.cs
+++ b/testcases/main/HSSF/Record/Chart/TestPlotGrowthRecord.cs
@@ -23,7 +23,7 @@ namespace TestCases.HSSF.Record.Chart
using System;
using NPOI.HSSF.Record;
using NPOI.HSSF.Record.Chart;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
* Tests the serialization and deserialization of the PlotGrowthRecord
@@ -49,11 +49,11 @@ public void TestLoad()
{
PlotGrowthRecord record = new PlotGrowthRecord(TestcaseRecordInputStream.Create(0x1064, data));
- Assert.AreEqual(65536, record.HorizontalScale);
- Assert.AreEqual(65536, record.VerticalScale);
+ ClassicAssert.AreEqual(65536, record.HorizontalScale);
+ ClassicAssert.AreEqual(65536, record.VerticalScale);
- Assert.AreEqual(12, record.RecordSize);
+ ClassicAssert.AreEqual(12, record.RecordSize);
}
[Test]
public void TestStore()
@@ -64,9 +64,9 @@ public void TestStore()
byte[] recordBytes = record.Serialize();
- Assert.AreEqual(recordBytes.Length - 4, data.Length);
+ ClassicAssert.AreEqual(recordBytes.Length - 4, data.Length);
for (int i = 0; i < data.Length; i++)
- Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
+ ClassicAssert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/Record/Chart/TestSerToCrtRecord.cs b/testcases/main/HSSF/Record/Chart/TestSerToCrtRecord.cs
index 4676d04c6..a503ebeee 100644
--- a/testcases/main/HSSF/Record/Chart/TestSerToCrtRecord.cs
+++ b/testcases/main/HSSF/Record/Chart/TestSerToCrtRecord.cs
@@ -23,7 +23,7 @@ namespace TestCases.HSSF.Record.Chart
using System;
using NPOI.HSSF.Record;
using NPOI.HSSF.Record.Chart;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
* Tests the serialization and deserialization of the SeriesChartGroupIndexRecord
@@ -47,10 +47,10 @@ public TestSerToCrtRecord()
public void TestLoad()
{
SerToCrtRecord record = new SerToCrtRecord(TestcaseRecordInputStream.Create(0x1045, data));
- Assert.AreEqual(0, record.ChartGroupIndex);
+ ClassicAssert.AreEqual(0, record.ChartGroupIndex);
- Assert.AreEqual(6, record.RecordSize);
+ ClassicAssert.AreEqual(6, record.RecordSize);
}
[Test]
@@ -61,9 +61,9 @@ public void TestStore()
byte[] recordBytes = record.Serialize();
- Assert.AreEqual(recordBytes.Length - 4, data.Length);
+ ClassicAssert.AreEqual(recordBytes.Length - 4, data.Length);
for (int i = 0; i < data.Length; i++)
- Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
+ ClassicAssert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
}
}
}
diff --git a/testcases/main/HSSF/Record/Chart/TestSeriesChartGroupIndexRecord.cs b/testcases/main/HSSF/Record/Chart/TestSeriesChartGroupIndexRecord.cs
index 931725e96..98e0ac68b 100644
--- a/testcases/main/HSSF/Record/Chart/TestSeriesChartGroupIndexRecord.cs
+++ b/testcases/main/HSSF/Record/Chart/TestSeriesChartGroupIndexRecord.cs
@@ -23,7 +23,7 @@ namespace TestCases.HSSF.Record.Chart
using System;
using NPOI.HSSF.Record;
using NPOI.HSSF.Record.Chart;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
* Tests the serialization and deserialization of the SeriesChartGroupIndexRecord
@@ -47,10 +47,10 @@ public TestSeriesChartGroupIndexRecord()
public void TestLoad()
{
SeriesChartGroupIndexRecord record = new SeriesChartGroupIndexRecord(TestcaseRecordInputStream.Create(0x1045, data));
- Assert.AreEqual(0, record.ChartGroupIndex);
+ ClassicAssert.AreEqual(0, record.ChartGroupIndex);
- Assert.AreEqual(6, record.RecordSize);
+ ClassicAssert.AreEqual(6, record.RecordSize);
}
[Test]
@@ -61,9 +61,9 @@ public void TestStore()
byte[] recordBytes = record.Serialize();
- Assert.AreEqual(recordBytes.Length - 4, data.Length);
+ ClassicAssert.AreEqual(recordBytes.Length - 4, data.Length);
for (int i = 0; i < data.Length; i++)
- Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
+ ClassicAssert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
}
}
}
diff --git a/testcases/main/HSSF/Record/Chart/TestSeriesIndexRecord.cs b/testcases/main/HSSF/Record/Chart/TestSeriesIndexRecord.cs
index 218af4489..eb500d1e6 100644
--- a/testcases/main/HSSF/Record/Chart/TestSeriesIndexRecord.cs
+++ b/testcases/main/HSSF/Record/Chart/TestSeriesIndexRecord.cs
@@ -23,7 +23,7 @@ namespace TestCases.HSSF.Record.Chart
using System;
using NPOI.HSSF.Record;
using NPOI.HSSF.Record.Chart;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
* Tests the serialization and deserialization of the SeriesIndexRecord
@@ -50,10 +50,10 @@ public void TestLoad()
SeriesIndexRecord record = new SeriesIndexRecord(TestcaseRecordInputStream.Create(0x1065, data));
- Assert.AreEqual((short)3, record.Index);
+ ClassicAssert.AreEqual((short)3, record.Index);
- Assert.AreEqual(6, record.RecordSize);
+ ClassicAssert.AreEqual(6, record.RecordSize);
}
[Test]
public void TestStore()
@@ -66,9 +66,9 @@ public void TestStore()
byte[] recordBytes = record.Serialize();
- Assert.AreEqual(recordBytes.Length - 4, data.Length);
+ ClassicAssert.AreEqual(recordBytes.Length - 4, data.Length);
for (int i = 0; i < data.Length; i++)
- Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
+ ClassicAssert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/Record/Chart/TestSeriesLabelsRecord.cs b/testcases/main/HSSF/Record/Chart/TestSeriesLabelsRecord.cs
index 2f4206579..54f3908ca 100644
--- a/testcases/main/HSSF/Record/Chart/TestSeriesLabelsRecord.cs
+++ b/testcases/main/HSSF/Record/Chart/TestSeriesLabelsRecord.cs
@@ -24,7 +24,7 @@ namespace TestCases.HSSF.Record.Chart
using System;
using NPOI.HSSF.Record;
using NPOI.HSSF.Record.Chart;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
* Tests the serialization and deserialization of the SeriesLabelsRecord
@@ -49,16 +49,16 @@ public TestSeriesLabelsRecord()
public void TestLoad()
{
SeriesLabelsRecord record = new SeriesLabelsRecord(TestcaseRecordInputStream.Create(0x100c, data));
- Assert.AreEqual(3, record.FormatFlags);
- Assert.AreEqual(true, record.IsShowActual);
- Assert.AreEqual(true, record.IsShowPercent);
- Assert.AreEqual(false, record.IsLabelAsPercentage);
- Assert.AreEqual(false, record.IsSmoothedLine);
- Assert.AreEqual(false, record.IsShowLabel);
- Assert.AreEqual(false, record.IsShowBubbleSizes);
+ ClassicAssert.AreEqual(3, record.FormatFlags);
+ ClassicAssert.AreEqual(true, record.IsShowActual);
+ ClassicAssert.AreEqual(true, record.IsShowPercent);
+ ClassicAssert.AreEqual(false, record.IsLabelAsPercentage);
+ ClassicAssert.AreEqual(false, record.IsSmoothedLine);
+ ClassicAssert.AreEqual(false, record.IsShowLabel);
+ ClassicAssert.AreEqual(false, record.IsShowBubbleSizes);
- Assert.AreEqual(2 + 4, record.RecordSize);
+ ClassicAssert.AreEqual(2 + 4, record.RecordSize);
}
[Test]
@@ -74,9 +74,9 @@ public void TestStore()
byte[] recordBytes = record.Serialize();
- Assert.AreEqual(recordBytes.Length - 4, data.Length);
+ ClassicAssert.AreEqual(recordBytes.Length - 4, data.Length);
for (int i = 0; i < data.Length; i++)
- Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
+ ClassicAssert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/Record/Chart/TestSeriesListRecord.cs b/testcases/main/HSSF/Record/Chart/TestSeriesListRecord.cs
index 2c7b7c596..db47cbd7e 100644
--- a/testcases/main/HSSF/Record/Chart/TestSeriesListRecord.cs
+++ b/testcases/main/HSSF/Record/Chart/TestSeriesListRecord.cs
@@ -23,7 +23,7 @@ namespace TestCases.HSSF.Record.Chart
using System;
using NPOI.HSSF.Record;
using NPOI.HSSF.Record.Chart;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
* Tests the serialization and deserialization of the SeriesListRecord
@@ -49,11 +49,11 @@ public void TestLoad()
{
SeriesListRecord record = new SeriesListRecord(TestcaseRecordInputStream.Create(0x1016, data));
- Assert.AreEqual((short)0x2001, record.SeriesNumbers[0]);
- Assert.AreEqual(unchecked((short)0xf0ff), record.SeriesNumbers[1]);
- Assert.AreEqual(2, record.SeriesNumbers.Length);
+ ClassicAssert.AreEqual((short)0x2001, record.SeriesNumbers[0]);
+ ClassicAssert.AreEqual(unchecked((short)0xf0ff), record.SeriesNumbers[1]);
+ ClassicAssert.AreEqual(2, record.SeriesNumbers.Length);
- Assert.AreEqual(4 + 6, record.RecordSize);
+ ClassicAssert.AreEqual(4 + 6, record.RecordSize);
}
[Test]
public void TestStore()
@@ -61,9 +61,9 @@ public void TestStore()
SeriesListRecord record = new SeriesListRecord(new short[] { (short)0x2001, unchecked((short)0xf0ff) });
byte[] recordBytes = record.Serialize();
- Assert.AreEqual(recordBytes.Length - 4, data.Length);
+ ClassicAssert.AreEqual(recordBytes.Length - 4, data.Length);
for (int i = 0; i < data.Length; i++)
- Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
+ ClassicAssert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
}
}
}
diff --git a/testcases/main/HSSF/Record/Chart/TestSeriesRecord.cs b/testcases/main/HSSF/Record/Chart/TestSeriesRecord.cs
index 6b6bb5eea..ef09e0d2f 100644
--- a/testcases/main/HSSF/Record/Chart/TestSeriesRecord.cs
+++ b/testcases/main/HSSF/Record/Chart/TestSeriesRecord.cs
@@ -24,7 +24,7 @@ namespace TestCases.HSSF.Record.Chart
using System;
using NPOI.HSSF.Record;
using NPOI.HSSF.Record.Chart;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
* Tests the serialization and deserialization of the SeriesRecord
@@ -54,15 +54,15 @@ public void TestLoad()
{
SeriesRecord record = new SeriesRecord(TestcaseRecordInputStream.Create(0x1003, data));
- Assert.AreEqual(SeriesRecord.CATEGORY_DATA_TYPE_NUMERIC, record.CategoryDataType);
- Assert.AreEqual(SeriesRecord.VALUES_DATA_TYPE_NUMERIC, record.ValuesDataType);
- Assert.AreEqual(27, record.NumCategories);
- Assert.AreEqual(27, record.NumValues);
- Assert.AreEqual(SeriesRecord.BUBBLE_SERIES_TYPE_NUMERIC, record.BubbleSeriesType);
- Assert.AreEqual(0, record.NumBubbleValues);
+ ClassicAssert.AreEqual(SeriesRecord.CATEGORY_DATA_TYPE_NUMERIC, record.CategoryDataType);
+ ClassicAssert.AreEqual(SeriesRecord.VALUES_DATA_TYPE_NUMERIC, record.ValuesDataType);
+ ClassicAssert.AreEqual(27, record.NumCategories);
+ ClassicAssert.AreEqual(27, record.NumValues);
+ ClassicAssert.AreEqual(SeriesRecord.BUBBLE_SERIES_TYPE_NUMERIC, record.BubbleSeriesType);
+ ClassicAssert.AreEqual(0, record.NumBubbleValues);
- Assert.AreEqual(16, record.RecordSize);
+ ClassicAssert.AreEqual(16, record.RecordSize);
}
[Test]
public void TestStore()
@@ -76,9 +76,9 @@ public void TestStore()
record.NumBubbleValues = ((short)0);
byte[] recordBytes = record.Serialize();
- Assert.AreEqual(recordBytes.Length - 4, data.Length);
+ ClassicAssert.AreEqual(recordBytes.Length - 4, data.Length);
for (int i = 0; i < data.Length; i++)
- Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
+ ClassicAssert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/Record/Chart/TestSeriesTextRecord.cs b/testcases/main/HSSF/Record/Chart/TestSeriesTextRecord.cs
index 1dd3d8fb2..4d4d203c8 100644
--- a/testcases/main/HSSF/Record/Chart/TestSeriesTextRecord.cs
+++ b/testcases/main/HSSF/Record/Chart/TestSeriesTextRecord.cs
@@ -23,7 +23,7 @@ namespace TestCases.HSSF.Record.Chart
using System;
using NPOI.HSSF.Record;
using NPOI.HSSF.Record.Chart;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.Util;
/**
@@ -49,13 +49,13 @@ public void TestLoad()
{
SeriesTextRecord record = new SeriesTextRecord(TestcaseRecordInputStream.Create(0x100d, SIMPLE_DATA));
- Assert.AreEqual((short)0, record.Id);
- Assert.AreEqual((byte)0x0C, record.Text.Length);
+ ClassicAssert.AreEqual((short)0, record.Id);
+ ClassicAssert.AreEqual((byte)0x0C, record.Text.Length);
- Assert.AreEqual("Value Number", record.Text);
+ ClassicAssert.AreEqual("Value Number", record.Text);
- Assert.AreEqual(SIMPLE_DATA.Length+4, record.RecordSize);
+ ClassicAssert.AreEqual(SIMPLE_DATA.Length+4, record.RecordSize);
}
[Test]
public void TestStore()
diff --git a/testcases/main/HSSF/Record/Chart/TestSeriesToChartGroupRecord.cs b/testcases/main/HSSF/Record/Chart/TestSeriesToChartGroupRecord.cs
index 2157cfa98..9c1095204 100644
--- a/testcases/main/HSSF/Record/Chart/TestSeriesToChartGroupRecord.cs
+++ b/testcases/main/HSSF/Record/Chart/TestSeriesToChartGroupRecord.cs
@@ -23,7 +23,7 @@ namespace TestCases.HSSF.Record.Chart
using System;
using NPOI.HSSF.Record;
using NPOI.HSSF.Record.Chart;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
* Tests the serialization and deserialization of the SeriesToChartGroupRecord
@@ -49,10 +49,10 @@ public TestSeriesToChartGroupRecord()
public void TestLoad()
{
SeriesToChartGroupRecord record = new SeriesToChartGroupRecord(TestcaseRecordInputStream.Create(0x1045, data));
- Assert.AreEqual(0x0, record.ChartGroupIndex);
+ ClassicAssert.AreEqual(0x0, record.ChartGroupIndex);
- Assert.AreEqual(0x6, record.RecordSize);
+ ClassicAssert.AreEqual(0x6, record.RecordSize);
}
[Test]
public void TestStore()
@@ -62,9 +62,9 @@ public void TestStore()
byte[] recordBytes = record.Serialize();
- Assert.AreEqual(recordBytes.Length - 4, data.Length);
+ ClassicAssert.AreEqual(recordBytes.Length - 4, data.Length);
for (int i = 0; i < data.Length; i++)
- Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
+ ClassicAssert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
}
}
}
diff --git a/testcases/main/HSSF/Record/Chart/TestShtPropsRecord.cs b/testcases/main/HSSF/Record/Chart/TestShtPropsRecord.cs
index 9ea861be1..3f783a02e 100644
--- a/testcases/main/HSSF/Record/Chart/TestShtPropsRecord.cs
+++ b/testcases/main/HSSF/Record/Chart/TestShtPropsRecord.cs
@@ -23,7 +23,7 @@ namespace TestCases.HSSF.Record.Chart
using System;
using NPOI.HSSF.Record;
using NPOI.HSSF.Record.Chart;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
* Tests the serialization and deserialization of the SheetPropertiesRecord
@@ -50,16 +50,16 @@ public TestShtPropsRecord()
public void TestLoad()
{
ShtPropsRecord record = new ShtPropsRecord(TestcaseRecordInputStream.Create(0x1044, data));
- Assert.AreEqual(10, record.Flags);
- Assert.AreEqual(false, record.IsManSerAlloc);
- Assert.AreEqual(true, record.IsPlotVisibleOnly);
- Assert.AreEqual(false, record.IsNotSizeWithWindow);
- Assert.AreEqual(true, record.IsManPlotArea);
- Assert.AreEqual(false, record.IsAlwaysAutoPlotArea);
- Assert.AreEqual(0, record.Blank);
+ ClassicAssert.AreEqual(10, record.Flags);
+ ClassicAssert.AreEqual(false, record.IsManSerAlloc);
+ ClassicAssert.AreEqual(true, record.IsPlotVisibleOnly);
+ ClassicAssert.AreEqual(false, record.IsNotSizeWithWindow);
+ ClassicAssert.AreEqual(true, record.IsManPlotArea);
+ ClassicAssert.AreEqual(false, record.IsAlwaysAutoPlotArea);
+ ClassicAssert.AreEqual(0, record.Blank);
- Assert.AreEqual(8, record.RecordSize);
+ ClassicAssert.AreEqual(8, record.RecordSize);
}
[Test]
public void TestStore()
@@ -74,9 +74,9 @@ public void TestStore()
byte[] recordBytes = record.Serialize();
- Assert.AreEqual(recordBytes.Length - 4, data.Length);
+ ClassicAssert.AreEqual(recordBytes.Length - 4, data.Length);
for (int i = 0; i < data.Length; i++)
- Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
+ ClassicAssert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/Record/Chart/TestTextRecord.cs b/testcases/main/HSSF/Record/Chart/TestTextRecord.cs
index 60ba2222d..e6ad8f184 100644
--- a/testcases/main/HSSF/Record/Chart/TestTextRecord.cs
+++ b/testcases/main/HSSF/Record/Chart/TestTextRecord.cs
@@ -23,7 +23,7 @@ namespace TestCases.HSSF.Record.Chart
using System;
using NPOI.HSSF.Record;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
* Tests the serialization and deserialization of the TextRecord
@@ -59,35 +59,35 @@ public void TestLoad()
{
TextRecord record = new TextRecord(TestcaseRecordInputStream.Create((short)0x1025, data));
- Assert.AreEqual(TextRecord.HORIZONTAL_ALIGNMENT_CENTER, record.HorizontalAlignment);
- Assert.AreEqual(TextRecord.VERTICAL_ALIGNMENT_CENTER, record.VerticalAlignment);
- Assert.AreEqual(TextRecord.DISPLAY_MODE_TRANSPARENT, record.DisplayMode);
- Assert.AreEqual(0, record.RgbColor);
- Assert.AreEqual(-42, record.X);
- Assert.AreEqual(-60, record.Y);
- Assert.AreEqual(0, record.Width);
- Assert.AreEqual(0, record.Height);
- Assert.AreEqual(177, record.Options1);
- Assert.AreEqual(true, record.IsAutoColor);
- Assert.AreEqual(false, record.ShowKey);
- Assert.AreEqual(false, record.ShowValue);
- //Assert.AreEqual(false, record.IsVertical);
- Assert.AreEqual(true, record.IsAutoGeneratedText);
- Assert.AreEqual(true, record.IsGenerated);
- Assert.AreEqual(false, record.IsAutoLabelDeleted);
- Assert.AreEqual(true, record.IsAutoBackground);
- //Assert.AreEqual(TextRecord.ROTATION_NONE, record.Rotation);
- Assert.AreEqual(false, record.ShowCategoryLabelAsPercentage);
- Assert.AreEqual(false, record.ShowValueAsPercentage);
- Assert.AreEqual(false, record.ShowBubbleSizes);
- Assert.AreEqual(false, record.ShowLabel);
- Assert.AreEqual(77, record.IndexOfColorValue);
- Assert.AreEqual(11088, record.Options2);
- Assert.AreEqual(0, record.DataLabelPlacement);
- Assert.AreEqual(0, record.TextRotation);
+ ClassicAssert.AreEqual(TextRecord.HORIZONTAL_ALIGNMENT_CENTER, record.HorizontalAlignment);
+ ClassicAssert.AreEqual(TextRecord.VERTICAL_ALIGNMENT_CENTER, record.VerticalAlignment);
+ ClassicAssert.AreEqual(TextRecord.DISPLAY_MODE_TRANSPARENT, record.DisplayMode);
+ ClassicAssert.AreEqual(0, record.RgbColor);
+ ClassicAssert.AreEqual(-42, record.X);
+ ClassicAssert.AreEqual(-60, record.Y);
+ ClassicAssert.AreEqual(0, record.Width);
+ ClassicAssert.AreEqual(0, record.Height);
+ ClassicAssert.AreEqual(177, record.Options1);
+ ClassicAssert.AreEqual(true, record.IsAutoColor);
+ ClassicAssert.AreEqual(false, record.ShowKey);
+ ClassicAssert.AreEqual(false, record.ShowValue);
+ //ClassicAssert.AreEqual(false, record.IsVertical);
+ ClassicAssert.AreEqual(true, record.IsAutoGeneratedText);
+ ClassicAssert.AreEqual(true, record.IsGenerated);
+ ClassicAssert.AreEqual(false, record.IsAutoLabelDeleted);
+ ClassicAssert.AreEqual(true, record.IsAutoBackground);
+ //ClassicAssert.AreEqual(TextRecord.ROTATION_NONE, record.Rotation);
+ ClassicAssert.AreEqual(false, record.ShowCategoryLabelAsPercentage);
+ ClassicAssert.AreEqual(false, record.ShowValueAsPercentage);
+ ClassicAssert.AreEqual(false, record.ShowBubbleSizes);
+ ClassicAssert.AreEqual(false, record.ShowLabel);
+ ClassicAssert.AreEqual(77, record.IndexOfColorValue);
+ ClassicAssert.AreEqual(11088, record.Options2);
+ ClassicAssert.AreEqual(0, record.DataLabelPlacement);
+ ClassicAssert.AreEqual(0, record.TextRotation);
- Assert.AreEqual(36, record.RecordSize);
+ ClassicAssert.AreEqual(36, record.RecordSize);
}
[Test]
public void TestStore()
@@ -121,9 +121,9 @@ public void TestStore()
byte [] recordBytes = record.Serialize();
- Assert.AreEqual(recordBytes.Length - 4, data.Length);
+ ClassicAssert.AreEqual(recordBytes.Length - 4, data.Length);
for (int i = 0; i < data.Length; i++)
- Assert.AreEqual(data[i], recordBytes[i+4],"At offset " + i);
+ ClassicAssert.AreEqual(data[i], recordBytes[i+4],"At offset " + i);
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/Record/Chart/TestTickRecord.cs b/testcases/main/HSSF/Record/Chart/TestTickRecord.cs
index a33f2c618..e539ce409 100644
--- a/testcases/main/HSSF/Record/Chart/TestTickRecord.cs
+++ b/testcases/main/HSSF/Record/Chart/TestTickRecord.cs
@@ -23,7 +23,7 @@ namespace TestCases.HSSF.Record.Chart
using System;
using NPOI.HSSF.Record;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
* Tests the serialization and deserialization of the TickRecord
@@ -54,23 +54,23 @@ public TestTickRecord()
public void TestLoad()
{
TickRecord record = new TickRecord(TestcaseRecordInputStream.Create(0x101e, data));
- Assert.AreEqual((byte)2, record.MajorTickType);
- Assert.AreEqual((byte)0, record.MinorTickType);
- Assert.AreEqual((byte)3, record.LabelPosition);
- Assert.AreEqual((short)1, record.Background);
- Assert.AreEqual(0, record.LabelColorRgb);
- Assert.AreEqual((short)0, record.Zero1);
- Assert.AreEqual((short)0, record.Zero2);
- Assert.AreEqual((short)35, record.Options);
- Assert.AreEqual(true, record.IsAutoTextColor);
- Assert.AreEqual(true, record.IsAutoTextBackground);
- Assert.AreEqual((short)0x0, record.Rotation);
- Assert.AreEqual(true, record.IsAutorotate);
- Assert.AreEqual((short)77, record.TickColor);
- Assert.AreEqual((short)0x0, record.Zero3);
+ ClassicAssert.AreEqual((byte)2, record.MajorTickType);
+ ClassicAssert.AreEqual((byte)0, record.MinorTickType);
+ ClassicAssert.AreEqual((byte)3, record.LabelPosition);
+ ClassicAssert.AreEqual((short)1, record.Background);
+ ClassicAssert.AreEqual(0, record.LabelColorRgb);
+ ClassicAssert.AreEqual((short)0, record.Zero1);
+ ClassicAssert.AreEqual((short)0, record.Zero2);
+ ClassicAssert.AreEqual((short)35, record.Options);
+ ClassicAssert.AreEqual(true, record.IsAutoTextColor);
+ ClassicAssert.AreEqual(true, record.IsAutoTextBackground);
+ ClassicAssert.AreEqual((short)0x0, record.Rotation);
+ ClassicAssert.AreEqual(true, record.IsAutorotate);
+ ClassicAssert.AreEqual((short)77, record.TickColor);
+ ClassicAssert.AreEqual((short)0x0, record.Zero3);
- Assert.AreEqual(34, record.RecordSize);
+ ClassicAssert.AreEqual(34, record.RecordSize);
}
[Test]
public void TestStore()
@@ -93,9 +93,9 @@ public void TestStore()
byte[] recordBytes = record.Serialize();
- Assert.AreEqual(recordBytes.Length - 4, data.Length);
+ ClassicAssert.AreEqual(recordBytes.Length - 4, data.Length);
for (int i = 0; i < data.Length; i++)
- Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
+ ClassicAssert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
}
}
}
diff --git a/testcases/main/HSSF/Record/Chart/TestUnitsRecord.cs b/testcases/main/HSSF/Record/Chart/TestUnitsRecord.cs
index b3f61ad57..3ff2126e9 100644
--- a/testcases/main/HSSF/Record/Chart/TestUnitsRecord.cs
+++ b/testcases/main/HSSF/Record/Chart/TestUnitsRecord.cs
@@ -24,7 +24,7 @@ namespace TestCases.HSSF.Record.Chart
using System;
using NPOI.HSSF.Record;
using NPOI.HSSF.Record.Chart;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
* Tests the serialization and deserialization of the UnitsRecord
@@ -50,10 +50,10 @@ public void TestLoad()
{
UnitsRecord record = new UnitsRecord(TestcaseRecordInputStream.Create((short)0x1001, data));
- Assert.AreEqual(0, record.Units);
+ ClassicAssert.AreEqual(0, record.Units);
- Assert.AreEqual(6, record.RecordSize);
+ ClassicAssert.AreEqual(6, record.RecordSize);
}
[Test]
public void TestStore()
@@ -63,9 +63,9 @@ public void TestStore()
byte[] recordBytes = record.Serialize();
- Assert.AreEqual(recordBytes.Length - 4, data.Length);
+ ClassicAssert.AreEqual(recordBytes.Length - 4, data.Length);
for (int i = 0; i < data.Length; i++)
- Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
+ ClassicAssert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
}
}
}
diff --git a/testcases/main/HSSF/Record/Chart/TestValueRangeRecord.cs b/testcases/main/HSSF/Record/Chart/TestValueRangeRecord.cs
index 101ec3dc6..2db14045b 100644
--- a/testcases/main/HSSF/Record/Chart/TestValueRangeRecord.cs
+++ b/testcases/main/HSSF/Record/Chart/TestValueRangeRecord.cs
@@ -23,7 +23,7 @@ namespace TestCases.HSSF.Record.Chart
using System;
using NPOI.HSSF.Record;
using NPOI.HSSF.Record.Chart;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
* Tests the serialization and deserialization of the ValueRangeRecord
@@ -54,23 +54,23 @@ public void TestLoad()
{
ValueRangeRecord record = new ValueRangeRecord(TestcaseRecordInputStream.Create(0x101f, data));
- Assert.AreEqual(0.0, record.MinimumAxisValue, 0.001);
- Assert.AreEqual(0.0, record.MaximumAxisValue, 0.001);
- Assert.AreEqual(0.0, record.MajorIncrement, 0.001);
- Assert.AreEqual(0.0, record.MinorIncrement, 0.001);
- Assert.AreEqual(0.0, record.CategoryAxisCross, 0.001);
- Assert.AreEqual(0x011f, record.Options);
- Assert.AreEqual(true, record.IsAutomaticMinimum);
- Assert.AreEqual(true, record.IsAutomaticMaximum);
- Assert.AreEqual(true, record.IsAutomaticMajor);
- Assert.AreEqual(true, record.IsAutomaticMinor);
- Assert.AreEqual(true, record.IsAutomaticCategoryCrossing);
- Assert.AreEqual(false, record.IsLogarithmicScale);
- Assert.AreEqual(false, record.IsValuesInReverse);
- Assert.AreEqual(false, record.IsCrossCategoryAxisAtMaximum);
- Assert.AreEqual(true, record.IsReserved);
+ ClassicAssert.AreEqual(0.0, record.MinimumAxisValue, 0.001);
+ ClassicAssert.AreEqual(0.0, record.MaximumAxisValue, 0.001);
+ ClassicAssert.AreEqual(0.0, record.MajorIncrement, 0.001);
+ ClassicAssert.AreEqual(0.0, record.MinorIncrement, 0.001);
+ ClassicAssert.AreEqual(0.0, record.CategoryAxisCross, 0.001);
+ ClassicAssert.AreEqual(0x011f, record.Options);
+ ClassicAssert.AreEqual(true, record.IsAutomaticMinimum);
+ ClassicAssert.AreEqual(true, record.IsAutomaticMaximum);
+ ClassicAssert.AreEqual(true, record.IsAutomaticMajor);
+ ClassicAssert.AreEqual(true, record.IsAutomaticMinor);
+ ClassicAssert.AreEqual(true, record.IsAutomaticCategoryCrossing);
+ ClassicAssert.AreEqual(false, record.IsLogarithmicScale);
+ ClassicAssert.AreEqual(false, record.IsValuesInReverse);
+ ClassicAssert.AreEqual(false, record.IsCrossCategoryAxisAtMaximum);
+ ClassicAssert.AreEqual(true, record.IsReserved);
- Assert.AreEqual(42 + 4, record.RecordSize);
+ ClassicAssert.AreEqual(42 + 4, record.RecordSize);
}
[Test]
public void TestStore()
@@ -92,9 +92,9 @@ public void TestStore()
record.IsReserved=(true);
byte[] recordBytes = record.Serialize();
- Assert.AreEqual(recordBytes.Length - 4, data.Length);
+ ClassicAssert.AreEqual(recordBytes.Length - 4, data.Length);
for (int i = 0; i < data.Length; i++)
- Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
+ ClassicAssert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/Record/Common/TestUnicodeString.cs b/testcases/main/HSSF/Record/Common/TestUnicodeString.cs
index 62b5e97d6..6cb6d953d 100644
--- a/testcases/main/HSSF/Record/Common/TestUnicodeString.cs
+++ b/testcases/main/HSSF/Record/Common/TestUnicodeString.cs
@@ -20,7 +20,7 @@ namespace TestCases.HSSF.Record.Common
using System;
using System.IO;
using System.Text;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.Record;
using NPOI.HSSF.Record.Cont;
using NPOI.Util;
@@ -59,7 +59,7 @@ private static void ConfirmSize(int expectedSize, UnicodeString s, int amountUse
s.Serialize(out1);
int size1 = out1.TotalSize;
int actualSize = size1-size0;
- Assert.AreEqual(expectedSize, actualSize);
+ ClassicAssert.AreEqual(expectedSize, actualSize);
}
[Test]
public void TestSmallStringSize()
@@ -168,8 +168,8 @@ public void TestPerfectContinuedStringSize()
public void TestFormatRun()
{
UnicodeString.FormatRun fr = new UnicodeString.FormatRun((short)4, (short)0x15c);
- Assert.AreEqual(4, fr.CharacterPos);
- Assert.AreEqual(0x15c, fr.FontIndex);
+ ClassicAssert.AreEqual(4, fr.CharacterPos);
+ ClassicAssert.AreEqual(0x15c, fr.FontIndex);
MemoryStream baos = new MemoryStream();
LittleEndianOutputStream out1 = new LittleEndianOutputStream(baos);
@@ -177,30 +177,30 @@ public void TestFormatRun()
fr.Serialize(out1);
byte[] b = baos.ToArray();
- Assert.AreEqual(4, b.Length);
- Assert.AreEqual(4, b[0]);
- Assert.AreEqual(0, b[1]);
- Assert.AreEqual(0x5c, b[2]);
- Assert.AreEqual(0x01, b[3]);
+ ClassicAssert.AreEqual(4, b.Length);
+ ClassicAssert.AreEqual(4, b[0]);
+ ClassicAssert.AreEqual(0, b[1]);
+ ClassicAssert.AreEqual(0x5c, b[2]);
+ ClassicAssert.AreEqual(0x01, b[3]);
LittleEndianInputStream inp = new LittleEndianInputStream(
new MemoryStream(b)
);
fr = new UnicodeString.FormatRun(inp);
- Assert.AreEqual(4, fr.CharacterPos);
- Assert.AreEqual(0x15c, fr.FontIndex);
+ ClassicAssert.AreEqual(4, fr.CharacterPos);
+ ClassicAssert.AreEqual(0x15c, fr.FontIndex);
}
[Test]
public void TestExtRstFromEmpty()
{
UnicodeString.ExtRst ext = new UnicodeString.ExtRst();
- Assert.AreEqual(0, ext.NumberOfRuns);
- Assert.AreEqual(0, ext.FormattingFontIndex);
- Assert.AreEqual(0, ext.FormattingOptions);
- Assert.AreEqual("", ext.PhoneticText);
- Assert.AreEqual(0, ext.PhRuns.Length);
- Assert.AreEqual(10, ext.DataSize); // Excludes 4 byte header
+ ClassicAssert.AreEqual(0, ext.NumberOfRuns);
+ ClassicAssert.AreEqual(0, ext.FormattingFontIndex);
+ ClassicAssert.AreEqual(0, ext.FormattingOptions);
+ ClassicAssert.AreEqual("", ext.PhoneticText);
+ ClassicAssert.AreEqual(0, ext.PhRuns.Length);
+ ClassicAssert.AreEqual(10, ext.DataSize); // Excludes 4 byte header
MemoryStream baos = new MemoryStream();
LittleEndianOutputStream out1 = new LittleEndianOutputStream(baos);
@@ -210,37 +210,37 @@ public void TestExtRstFromEmpty()
cout.WriteContinue();
byte[] b = baos.ToArray();
- Assert.AreEqual(20, b.Length);
+ ClassicAssert.AreEqual(20, b.Length);
// First 4 bytes from the outputstream
- Assert.AreEqual(-1, (sbyte)b[0]);
- Assert.AreEqual(-1, (sbyte)b[1]);
- Assert.AreEqual(14, b[2]);
- Assert.AreEqual(00, b[3]);
+ ClassicAssert.AreEqual(-1, (sbyte)b[0]);
+ ClassicAssert.AreEqual(-1, (sbyte)b[1]);
+ ClassicAssert.AreEqual(14, b[2]);
+ ClassicAssert.AreEqual(00, b[3]);
// Reserved
- Assert.AreEqual(1, b[4]);
- Assert.AreEqual(0, b[5]);
+ ClassicAssert.AreEqual(1, b[4]);
+ ClassicAssert.AreEqual(0, b[5]);
// Data size
- Assert.AreEqual(10, b[6]);
- Assert.AreEqual(00, b[7]);
+ ClassicAssert.AreEqual(10, b[6]);
+ ClassicAssert.AreEqual(00, b[7]);
// Font*2
- Assert.AreEqual(0, b[8]);
- Assert.AreEqual(0, b[9]);
- Assert.AreEqual(0, b[10]);
- Assert.AreEqual(0, b[11]);
+ ClassicAssert.AreEqual(0, b[8]);
+ ClassicAssert.AreEqual(0, b[9]);
+ ClassicAssert.AreEqual(0, b[10]);
+ ClassicAssert.AreEqual(0, b[11]);
// 0 Runs
- Assert.AreEqual(0, b[12]);
- Assert.AreEqual(0, b[13]);
+ ClassicAssert.AreEqual(0, b[12]);
+ ClassicAssert.AreEqual(0, b[13]);
// Size=0, *2
- Assert.AreEqual(0, b[14]);
- Assert.AreEqual(0, b[15]);
- Assert.AreEqual(0, b[16]);
- Assert.AreEqual(0, b[17]);
+ ClassicAssert.AreEqual(0, b[14]);
+ ClassicAssert.AreEqual(0, b[15]);
+ ClassicAssert.AreEqual(0, b[16]);
+ ClassicAssert.AreEqual(0, b[17]);
// Last 2 bytes from the outputstream
- Assert.AreEqual(ContinueRecord.sid, b[18]);
- Assert.AreEqual(0, b[19]);
+ ClassicAssert.AreEqual(ContinueRecord.sid, b[18]);
+ ClassicAssert.AreEqual(0, b[19]);
// Load in again and re-test
@@ -251,11 +251,11 @@ public void TestExtRstFromEmpty()
);
ext = new UnicodeString.ExtRst(inp, data.Length);
- Assert.AreEqual(0, ext.NumberOfRuns);
- Assert.AreEqual(0, ext.FormattingFontIndex);
- Assert.AreEqual(0, ext.FormattingOptions);
- Assert.AreEqual("", ext.PhoneticText);
- Assert.AreEqual(0, ext.PhRuns.Length);
+ ClassicAssert.AreEqual(0, ext.NumberOfRuns);
+ ClassicAssert.AreEqual(0, ext.FormattingFontIndex);
+ ClassicAssert.AreEqual(0, ext.FormattingOptions);
+ ClassicAssert.AreEqual("", ext.PhoneticText);
+ ClassicAssert.AreEqual(0, ext.PhRuns.Length);
}
[Test]
public void TestExtRstFromData()
@@ -267,19 +267,19 @@ public void TestExtRstFromData()
00, 00, 00, 00,
00, 00 // Cruft at the end, as found from real files
};
- Assert.AreEqual(16, data.Length);
+ ClassicAssert.AreEqual(16, data.Length);
LittleEndianInputStream inp = new LittleEndianInputStream(
new MemoryStream(data)
);
UnicodeString.ExtRst ext = new UnicodeString.ExtRst(inp, data.Length);
- Assert.AreEqual(0x0c, ext.DataSize); // Excludes 4 byte header
+ ClassicAssert.AreEqual(0x0c, ext.DataSize); // Excludes 4 byte header
- Assert.AreEqual(0, ext.NumberOfRuns);
- Assert.AreEqual(0x37, ext.FormattingOptions);
- Assert.AreEqual(0, ext.FormattingFontIndex);
- Assert.AreEqual("", ext.PhoneticText);
- Assert.AreEqual(0, ext.PhRuns.Length);
+ ClassicAssert.AreEqual(0, ext.NumberOfRuns);
+ ClassicAssert.AreEqual(0x37, ext.FormattingOptions);
+ ClassicAssert.AreEqual(0, ext.FormattingFontIndex);
+ ClassicAssert.AreEqual("", ext.PhoneticText);
+ ClassicAssert.AreEqual(0, ext.PhRuns.Length);
}
[Test]
public void TestCorruptExtRstDetection()
@@ -288,7 +288,7 @@ public void TestCorruptExtRstDetection()
0x79, 0x79, 0x11, 0x11,
0x22, 0x22, 0x33, 0x33,
};
- Assert.AreEqual(8, data.Length);
+ ClassicAssert.AreEqual(8, data.Length);
LittleEndianInputStream inp = new LittleEndianInputStream(
new MemoryStream(data)
@@ -296,17 +296,17 @@ public void TestCorruptExtRstDetection()
UnicodeString.ExtRst ext = new UnicodeString.ExtRst(inp, data.Length);
// Will be empty
- Assert.AreEqual(ext, new UnicodeString.ExtRst());
+ ClassicAssert.AreEqual(ext, new UnicodeString.ExtRst());
// If written, will be the usual size
- Assert.AreEqual(10, ext.DataSize); // Excludes 4 byte header
+ ClassicAssert.AreEqual(10, ext.DataSize); // Excludes 4 byte header
// Is empty
- Assert.AreEqual(0, ext.NumberOfRuns);
- Assert.AreEqual(0, ext.FormattingOptions);
- Assert.AreEqual(0, ext.FormattingFontIndex);
- Assert.AreEqual("", ext.PhoneticText);
- Assert.AreEqual(0, ext.PhRuns.Length);
+ ClassicAssert.AreEqual(0, ext.NumberOfRuns);
+ ClassicAssert.AreEqual(0, ext.FormattingOptions);
+ ClassicAssert.AreEqual(0, ext.FormattingFontIndex);
+ ClassicAssert.AreEqual("", ext.PhoneticText);
+ ClassicAssert.AreEqual(0, ext.PhRuns.Length);
}
diff --git a/testcases/main/HSSF/Record/Crypto/TestBiff8DecryptingStream.cs b/testcases/main/HSSF/Record/Crypto/TestBiff8DecryptingStream.cs
index d758c5b6c..5e00e7f27 100644
--- a/testcases/main/HSSF/Record/Crypto/TestBiff8DecryptingStream.cs
+++ b/testcases/main/HSSF/Record/Crypto/TestBiff8DecryptingStream.cs
@@ -19,7 +19,7 @@ namespace TestCases.HSSF.Record.Crypto
{
using System;
using System.IO;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.Util;
using TestCases.Exceptions;
using NPOI.HSSF.Record.Crypto;
@@ -74,7 +74,7 @@ public StreamTester(MockStream ms, String keyDigestHex, int expectedFirstInt)
_ms = ms;
byte[] keyDigest = HexRead.ReadFromString(keyDigestHex);
_bds = new Biff8DecryptingStream(_ms, 0, new Biff8EncryptionKey(keyDigest));
- Assert.AreEqual(expectedFirstInt, _bds.ReadInt());
+ ClassicAssert.AreEqual(expectedFirstInt, _bds.ReadInt());
_errorsOccurred = false;
}
@@ -89,12 +89,12 @@ public Biff8DecryptingStream GetBDS()
*/
public void RollForward(int fromPosition, int toPosition)
{
- Assert.AreEqual(fromPosition, _ms.GetPosition());
+ ClassicAssert.AreEqual(fromPosition, _ms.GetPosition());
for (int i = fromPosition; i < toPosition; i++)
{
_bds.ReadByte();
}
- Assert.AreEqual(toPosition, _ms.GetPosition());
+ ClassicAssert.AreEqual(toPosition, _ms.GetPosition());
}
public void ConfirmByte(int expVal)
@@ -176,7 +176,7 @@ private static void logErr(int stackFrameCount, String msg)
public void AssertNoErrors()
{
- Assert.IsFalse(_errorsOccurred, "Some values decrypted incorrectly");
+ ClassicAssert.IsFalse(_errorsOccurred, "Some values decrypted incorrectly");
}
}
@@ -207,9 +207,9 @@ public void TestReadsAlignedWithBoundary()
st.RollForward(0x7215, 0x1B9AD);
st.ConfirmShort(-1);
st.RollForward(0x1B9AF, 0x37D99);
- Assert.AreEqual(0xFFFF, st.ReadUShort());
+ ClassicAssert.AreEqual(0xFFFF, st.ReadUShort());
st.RollForward(0x37D9B, 0x4A6F2);
- Assert.AreEqual(-1, st.ReadShort());
+ ClassicAssert.AreEqual(-1, st.ReadShort());
st.AssertNoErrors();
}
@@ -250,12 +250,12 @@ public void TestReadHeaderUshort()
throw new AssertionException(
"Indentified bug in key alignment After call to ReadHeaderUshort()");
}
- Assert.AreEqual(0x16885243, nextInt);
+ ClassicAssert.AreEqual(0x16885243, nextInt);
if (hval == 0x283E)
{
throw new AssertionException("readHeaderUshort() incorrectly decrypted result");
}
- Assert.AreEqual(0x504F, hval);
+ ClassicAssert.AreEqual(0x504F, hval);
// confirm next key change
st.RollForward(0x0405, 0x07FC);
diff --git a/testcases/main/HSSF/Record/Crypto/TestBiff8EncryptionKey.cs b/testcases/main/HSSF/Record/Crypto/TestBiff8EncryptionKey.cs
index 242dc6942..bb3cb72d5 100644
--- a/testcases/main/HSSF/Record/Crypto/TestBiff8EncryptionKey.cs
+++ b/testcases/main/HSSF/Record/Crypto/TestBiff8EncryptionKey.cs
@@ -18,7 +18,7 @@ limitations under the License.
namespace TestCases.HSSF.Record.Crypto
{
using System;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.Util;
using TestCases.Exceptions;
using NPOI.HSSF.Record.Crypto;
@@ -108,11 +108,11 @@ private static void ConfirmValid(bool expectedResult,
bool actResult = key.Validate(saltData, saltHash);
if (expectedResult)
{
- Assert.IsTrue(actResult, "validate failed");
+ ClassicAssert.IsTrue(actResult, "validate failed");
}
else
{
- Assert.IsFalse(actResult, "validate succeeded unexpectedly");
+ ClassicAssert.IsFalse(actResult, "validate succeeded unexpectedly");
}
}
}
diff --git a/testcases/main/HSSF/Record/Crypto/TestRC4.cs b/testcases/main/HSSF/Record/Crypto/TestRC4.cs
index 160227a2b..7125c91b9 100644
--- a/testcases/main/HSSF/Record/Crypto/TestRC4.cs
+++ b/testcases/main/HSSF/Record/Crypto/TestRC4.cs
@@ -19,7 +19,7 @@ namespace TestCases.HSSF.Record.Crypto
{
using System;
using System.Text;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.Util;
using TestCases.Exceptions;
using NPOI.HSSF.Record.Crypto;
diff --git a/testcases/main/HSSF/Record/Crypto/TestXorEncryption.cs b/testcases/main/HSSF/Record/Crypto/TestXorEncryption.cs
index e6f387b0d..883376052 100644
--- a/testcases/main/HSSF/Record/Crypto/TestXorEncryption.cs
+++ b/testcases/main/HSSF/Record/Crypto/TestXorEncryption.cs
@@ -24,7 +24,7 @@ namespace TestCases.HSSF.Record.Crypto
using NPOI.POIFS.FileSystem;
using NPOI.SS.UserModel;
using NPOI.Util;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using TestCases.HSSF;
[TestFixture]
@@ -47,8 +47,8 @@ public void TestXorEncryption1() {
// verifier = 52250
int verifier = CryptoFunctions.CreateXorVerifier1("abc");
int key = CryptoFunctions.CreateXorKey1("abc");
- Assert.AreEqual(20810, key);
- Assert.AreEqual(52250, verifier);
+ ClassicAssert.AreEqual(20810, key);
+ ClassicAssert.AreEqual(52250, verifier);
byte[] xorArrAct = CryptoFunctions.CreateXorArray1("abc");
byte[] xorArrExp = HexRead.ReadFromString("AC-CC-A4-AB-D6-BA-C3-BA-D6-A3-2B-45-D3-79-29-BB");
@@ -65,9 +65,9 @@ public void TestUserFile() {
IWorkbook hwb = new HSSFWorkbook(fs.Root, true);
ISheet sh = hwb.GetSheetAt(0);
- Assert.AreEqual(1.0, sh.GetRow(0).GetCell(0).NumericCellValue, 0.0);
- Assert.AreEqual(2.0, sh.GetRow(1).GetCell(0).NumericCellValue, 0.0);
- Assert.AreEqual(3.0, sh.GetRow(2).GetCell(0).NumericCellValue, 0.0);
+ ClassicAssert.AreEqual(1.0, sh.GetRow(0).GetCell(0).NumericCellValue, 0.0);
+ ClassicAssert.AreEqual(2.0, sh.GetRow(1).GetCell(0).NumericCellValue, 0.0);
+ ClassicAssert.AreEqual(3.0, sh.GetRow(2).GetCell(0).NumericCellValue, 0.0);
fs.Close();
}
diff --git a/testcases/main/HSSF/Record/Pivot/TestExtendedPivotTableViewFieldsRecord.cs b/testcases/main/HSSF/Record/Pivot/TestExtendedPivotTableViewFieldsRecord.cs
index f577c8a52..f12ea36a3 100644
--- a/testcases/main/HSSF/Record/Pivot/TestExtendedPivotTableViewFieldsRecord.cs
+++ b/testcases/main/HSSF/Record/Pivot/TestExtendedPivotTableViewFieldsRecord.cs
@@ -18,7 +18,7 @@ limitations under the License.
namespace TestCases.HSSF.Record.Pivot
{
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.Record;
using NPOI.HSSF.Record.PivotTable;
using NPOI.Util;
@@ -55,7 +55,7 @@ public void TestSubNameNotPresent_bug46693()
throw e;
}
- Assert.AreEqual(data.Length, rec.RecordSize);
+ ClassicAssert.AreEqual(data.Length, rec.RecordSize);
}
[Test]
diff --git a/testcases/main/HSSF/Record/Pivot/TestPageItemRecord.cs b/testcases/main/HSSF/Record/Pivot/TestPageItemRecord.cs
index cb036e2cc..31ea0675c 100644
--- a/testcases/main/HSSF/Record/Pivot/TestPageItemRecord.cs
+++ b/testcases/main/HSSF/Record/Pivot/TestPageItemRecord.cs
@@ -18,7 +18,7 @@ limitations under the License.
namespace TestCases.HSSF.Record.Pivot
{
using System;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.Record;
using NPOI.HSSF.Record.PivotTable;
using NPOI.Util;
@@ -43,9 +43,9 @@ public void TestMoreThanOneInfoItem_bug46917()
{
throw new AssertionException("Identified bug 46917");
}
- Assert.AreEqual(0, in1.Remaining);
+ ClassicAssert.AreEqual(0, in1.Remaining);
- Assert.AreEqual(4 + data.Length, rec.RecordSize);
+ ClassicAssert.AreEqual(4 + data.Length, rec.RecordSize);
}
[Test]
@@ -61,8 +61,8 @@ private static PageItemRecord ConfirmSerialize(String hexDump)
byte[] data = HexRead.ReadFromString(hexDump);
RecordInputStream in1 = TestcaseRecordInputStream.Create(PageItemRecord.sid, data);
PageItemRecord rec = new PageItemRecord(in1);
- Assert.AreEqual(0, in1.Remaining);
- Assert.AreEqual(4 + data.Length, rec.RecordSize);
+ ClassicAssert.AreEqual(0, in1.Remaining);
+ ClassicAssert.AreEqual(4 + data.Length, rec.RecordSize);
byte[] data2 = rec.Serialize();
TestcaseRecordInputStream.ConfirmRecordEncoding(PageItemRecord.sid, data, data2);
return rec;
diff --git a/testcases/main/HSSF/Record/Pivot/TestViewFieldsRecord.cs b/testcases/main/HSSF/Record/Pivot/TestViewFieldsRecord.cs
index 20689cee4..59af4d9bb 100644
--- a/testcases/main/HSSF/Record/Pivot/TestViewFieldsRecord.cs
+++ b/testcases/main/HSSF/Record/Pivot/TestViewFieldsRecord.cs
@@ -19,7 +19,7 @@ namespace TestCases.HSSF.Record.Pivot
{
using System;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.Record;
using NPOI.Util;
@@ -45,8 +45,8 @@ public void TestUnicodeFlag_bug46693()
{
throw new AssertionException("Identified bug 46693b");
}
- Assert.AreEqual(0, in1.Remaining);
- Assert.AreEqual(4 + data.Length, rec.RecordSize);
+ ClassicAssert.AreEqual(0, in1.Remaining);
+ ClassicAssert.AreEqual(4 + data.Length, rec.RecordSize);
}
[Test]
@@ -64,8 +64,8 @@ private static ViewFieldsRecord ConfirmSerialize(String hexDump)
byte[] data = HexRead.ReadFromString(hexDump);
RecordInputStream in1 = TestcaseRecordInputStream.Create(ViewFieldsRecord.sid, data);
ViewFieldsRecord rec = new ViewFieldsRecord(in1);
- Assert.AreEqual(0, in1.Remaining);
- Assert.AreEqual(4 + data.Length, rec.RecordSize);
+ ClassicAssert.AreEqual(0, in1.Remaining);
+ ClassicAssert.AreEqual(4 + data.Length, rec.RecordSize);
byte[] data2 = rec.Serialize();
TestcaseRecordInputStream.ConfirmRecordEncoding(ViewFieldsRecord.sid, data, data2);
return rec;
diff --git a/testcases/main/HSSF/Record/TestArrayRecord.cs b/testcases/main/HSSF/Record/TestArrayRecord.cs
index 5c49f00ea..a6b628d66 100644
--- a/testcases/main/HSSF/Record/TestArrayRecord.cs
+++ b/testcases/main/HSSF/Record/TestArrayRecord.cs
@@ -18,7 +18,7 @@ limitations under the License.
namespace TestCases.HSSF.Record
{
using System;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.SS.Formula;
using NPOI.SS.Formula.PTG;
using NPOI.SS.Util;
@@ -41,20 +41,20 @@ public void TestRead()
RecordInputStream in1 = TestcaseRecordInputStream.Create(data);
ArrayRecord r1 = new ArrayRecord(in1);
CellRangeAddress8Bit range = r1.Range;
- Assert.AreEqual(1, range.FirstColumn);
- Assert.AreEqual(1, range.LastColumn);
- Assert.AreEqual(1, range.FirstRow);
- Assert.AreEqual(1, range.LastRow);
+ ClassicAssert.AreEqual(1, range.FirstColumn);
+ ClassicAssert.AreEqual(1, range.LastColumn);
+ ClassicAssert.AreEqual(1, range.FirstRow);
+ ClassicAssert.AreEqual(1, range.LastRow);
Ptg[] ptg = r1.FormulaTokens;
- Assert.AreEqual(FormulaRenderer.ToFormulaString(null, ptg), "MAX(C1:C2-D1:D2)");
+ ClassicAssert.AreEqual(FormulaRenderer.ToFormulaString(null, ptg), "MAX(C1:C2-D1:D2)");
//construct a new ArrayRecord with the same contents as r1
Ptg[] fmlaPtg = FormulaParser.Parse("MAX(C1:C2-D1:D2)", null, FormulaType.Array, 0, -1);
ArrayRecord r2 = new ArrayRecord(Formula.Create(fmlaPtg), new CellRangeAddress8Bit(1, 1, 1, 1));
byte[] ser = r2.Serialize();
//serialize and check that the data is the same as in r1
- Assert.AreEqual(HexDump.ToHex(data), HexDump.ToHex(ser));
+ ClassicAssert.AreEqual(HexDump.ToHex(data), HexDump.ToHex(ser));
}
@@ -72,10 +72,10 @@ public void TestBug57231()
// Write the output to a file
HSSFWorkbook wbBack = HSSFTestDataSamples.WriteOutAndReadBack(wb);
- Assert.IsNotNull(wbBack);
+ ClassicAssert.IsNotNull(wbBack);
- Assert.IsNotNull(wbBack.GetSheet("master"));
- Assert.IsNotNull(wbBack.GetSheet("newName"));
+ ClassicAssert.IsNotNull(wbBack.GetSheet("master"));
+ ClassicAssert.IsNotNull(wbBack.GetSheet("newName"));
}
}
diff --git a/testcases/main/HSSF/Record/TestAutoFilterInfoRecord.cs b/testcases/main/HSSF/Record/TestAutoFilterInfoRecord.cs
index b719de743..58401d9c8 100644
--- a/testcases/main/HSSF/Record/TestAutoFilterInfoRecord.cs
+++ b/testcases/main/HSSF/Record/TestAutoFilterInfoRecord.cs
@@ -18,7 +18,7 @@ limitations under the License.
namespace TestCases.HSSF.Record
{
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.Record.AutoFilter;
using NPOI.Util;
@@ -39,11 +39,11 @@ public void TestRead()
AutoFilterInfoRecord record = new AutoFilterInfoRecord(TestcaseRecordInputStream.Create(AutoFilterInfoRecord.sid, data));
- Assert.AreEqual(AutoFilterInfoRecord.sid, record.Sid);
- Assert.AreEqual(data.Length, record.RecordSize - 4);
- Assert.AreEqual(5, record.NumEntries);
+ ClassicAssert.AreEqual(AutoFilterInfoRecord.sid, record.Sid);
+ ClassicAssert.AreEqual(data.Length, record.RecordSize - 4);
+ ClassicAssert.AreEqual(5, record.NumEntries);
record.NumEntries = (/*setter*/(short)3);
- Assert.AreEqual(3, record.NumEntries);
+ ClassicAssert.AreEqual(3, record.NumEntries);
}
[Test]
public void TestWrite()
@@ -52,9 +52,9 @@ public void TestWrite()
record.NumEntries = (/*setter*/(short)3);
byte[] ser = record.Serialize();
- Assert.AreEqual(ser.Length - 4, data.Length);
+ ClassicAssert.AreEqual(ser.Length - 4, data.Length);
record = new AutoFilterInfoRecord(TestcaseRecordInputStream.Create(ser));
- Assert.AreEqual(3, record.NumEntries);
+ ClassicAssert.AreEqual(3, record.NumEntries);
}
[Test]
public void TestClone()
@@ -64,11 +64,11 @@ public void TestClone()
byte[] src = record.Serialize();
AutoFilterInfoRecord Cloned = (AutoFilterInfoRecord)record.Clone();
- Assert.AreEqual(3, record.NumEntries);
+ ClassicAssert.AreEqual(3, record.NumEntries);
byte[] cln = Cloned.Serialize();
- Assert.AreEqual(record.RecordSize, Cloned.RecordSize);
- Assert.IsTrue(Arrays.Equals(src, cln));
+ ClassicAssert.AreEqual(record.RecordSize, Cloned.RecordSize);
+ ClassicAssert.IsTrue(Arrays.Equals(src, cln));
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/Record/TestBOFRecord.cs b/testcases/main/HSSF/Record/TestBOFRecord.cs
index feac9b67c..9ce42a29b 100644
--- a/testcases/main/HSSF/Record/TestBOFRecord.cs
+++ b/testcases/main/HSSF/Record/TestBOFRecord.cs
@@ -19,7 +19,7 @@ namespace TestCases.HSSF.Record
{
using System;
using System.IO;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using TestCases.HSSF;
using NPOI.HSSF.Record;
diff --git a/testcases/main/HSSF/Record/TestBoolErrRecord.cs b/testcases/main/HSSF/Record/TestBoolErrRecord.cs
index b0fe7584b..c6c929066 100644
--- a/testcases/main/HSSF/Record/TestBoolErrRecord.cs
+++ b/testcases/main/HSSF/Record/TestBoolErrRecord.cs
@@ -22,7 +22,7 @@ namespace TestCases.HSSF.Record
using TestCases.HSSF.Record;
using NPOI.Util;
using NPOI.HSSF.Record;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
* Tests for {@link BoolErrRecord}
@@ -40,8 +40,8 @@ public void TestError()
RecordInputStream in1 = TestcaseRecordInputStream.Create(BoolErrRecord.sid, data);
BoolErrRecord ber = new BoolErrRecord(in1);
- Assert.IsTrue(ber.IsError);
- Assert.AreEqual(7, ber.ErrorValue);
+ ClassicAssert.IsTrue(ber.IsError);
+ ClassicAssert.AreEqual(7, ber.ErrorValue);
TestcaseRecordInputStream.ConfirmRecordEncoding(BoolErrRecord.sid, data, ber.Serialize());
}
@@ -78,9 +78,9 @@ public void TestOooBadFormat_bug47479()
}
throw e;
}
- Assert.IsFalse(hasMore);
- Assert.IsTrue(ber.IsBoolean);
- Assert.AreEqual(true, ber.BooleanValue);
+ ClassicAssert.IsFalse(hasMore);
+ ClassicAssert.IsTrue(ber.IsBoolean);
+ ClassicAssert.AreEqual(true, ber.BooleanValue);
// Check that the record re-Serializes correctly
byte[] outData = ber.Serialize();
@@ -89,7 +89,7 @@ public void TestOooBadFormat_bug47479()
"00 00 00 00 0F 00 " +
"01 00 " // normal number of data bytes
);
- Assert.IsTrue(Arrays.Equals(expData, outData));
+ ClassicAssert.IsTrue(Arrays.Equals(expData, outData));
}
}
}
diff --git a/testcases/main/HSSF/Record/TestBoundSheetRecord.cs b/testcases/main/HSSF/Record/TestBoundSheetRecord.cs
index ba8612fdb..0d299bf88 100644
--- a/testcases/main/HSSF/Record/TestBoundSheetRecord.cs
+++ b/testcases/main/HSSF/Record/TestBoundSheetRecord.cs
@@ -21,7 +21,7 @@ namespace TestCases.HSSF.Record
{
using System;
using NPOI.HSSF.Record;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using System.Collections.Generic;
using NPOI.Util;
@@ -40,7 +40,7 @@ public class TestBoundSheetRecord
public void TestRecordLength()
{
BoundSheetRecord record = new BoundSheetRecord("Sheet1");
- Assert.AreEqual(18, record.RecordSize, " 2 + 2 + 4 + 2 + 1 + 1 + len(str)");
+ ClassicAssert.AreEqual(18, record.RecordSize, " 2 + 2 + 4 + 2 + 1 + 1 + len(str)");
}
[Test]
public void TestWideRecordLength()
@@ -48,7 +48,7 @@ public void TestWideRecordLength()
BoundSheetRecord record = new BoundSheetRecord("Sheet\u20ac");
record.Sheetname = ("Sheet\u20ac");
- Assert.AreEqual(24, record.RecordSize, " 2 + 2 + 4 + 2 + 1 + 1 + len(str) * 2");
+ ClassicAssert.AreEqual(24, record.RecordSize, " 2 + 2 + 4 + 2 + 1 + 1 + len(str) * 2");
}
[Test]
public void TestName()
@@ -58,7 +58,7 @@ public void TestName()
try
{
record.Sheetname = ("s//*s");
- Assert.IsTrue(false, "Should have thrown ArgumentException, but didnt");
+ ClassicAssert.IsTrue(false, "Should have thrown ArgumentException, but didnt");
}
catch (ArgumentException)
{
@@ -83,10 +83,10 @@ public void TestDeSerializeUnicode() {
RecordInputStream in1 = TestcaseRecordInputStream.Create(data);
BoundSheetRecord bsr = new BoundSheetRecord(in1);
// sheet name is unicode Russian for 'minor page'
- Assert.AreEqual("\u0421\u0442\u0440\u0430\u043D\u0438\u0447\u043A\u0430", bsr.Sheetname);
+ ClassicAssert.AreEqual("\u0421\u0442\u0440\u0430\u043D\u0438\u0447\u043A\u0430", bsr.Sheetname);
byte[] data2 = bsr.Serialize();
- Assert.IsTrue(Arrays.Equals(data, data2));
+ ClassicAssert.IsTrue(Arrays.Equals(data, data2));
}
[Test]
public void TestOrdering()
@@ -104,10 +104,10 @@ public void TestOrdering()
l.Add(bs3);
BoundSheetRecord[] r = BoundSheetRecord.OrderByBofPosition(l);
- Assert.AreEqual(3, r.Length);
- Assert.AreEqual(bs1, r[0]);
- Assert.AreEqual(bs3, r[1]);
- Assert.AreEqual(bs2, r[2]);
+ ClassicAssert.AreEqual(3, r.Length);
+ ClassicAssert.AreEqual(bs1, r[0]);
+ ClassicAssert.AreEqual(bs3, r[1]);
+ ClassicAssert.AreEqual(bs2, r[2]);
}
[Test]
public void TestValidNames()
diff --git a/testcases/main/HSSF/Record/TestCFHeaderRecord.cs b/testcases/main/HSSF/Record/TestCFHeaderRecord.cs
index e78b20aff..00d626934 100644
--- a/testcases/main/HSSF/Record/TestCFHeaderRecord.cs
+++ b/testcases/main/HSSF/Record/TestCFHeaderRecord.cs
@@ -20,7 +20,7 @@ namespace TestCases.HSSF.Record
using System;
using NPOI.HSSF.Record;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.Record.CF;
using NPOI.HSSF.Util;
using NPOI.SS.Util;
@@ -48,24 +48,24 @@ public void TestCreateCFHeaderRecord()
};
record.CellRanges = (ranges);
ranges = record.CellRanges;
- Assert.AreEqual(6, ranges.Length);
+ ClassicAssert.AreEqual(6, ranges.Length);
CellRangeAddress enclosingCellRange = record.EnclosingCellRange;
- Assert.AreEqual(0, enclosingCellRange.FirstRow);
- Assert.AreEqual(65535, enclosingCellRange.LastRow);
- Assert.AreEqual(0, enclosingCellRange.FirstColumn);
- Assert.AreEqual(6, enclosingCellRange.LastColumn);
+ ClassicAssert.AreEqual(0, enclosingCellRange.FirstRow);
+ ClassicAssert.AreEqual(65535, enclosingCellRange.LastRow);
+ ClassicAssert.AreEqual(0, enclosingCellRange.FirstColumn);
+ ClassicAssert.AreEqual(6, enclosingCellRange.LastColumn);
- Assert.AreEqual(false, record.NeedRecalculation);
- Assert.AreEqual(0, record.ID);
+ ClassicAssert.AreEqual(false, record.NeedRecalculation);
+ ClassicAssert.AreEqual(0, record.ID);
record.NeedRecalculation = (true);
- Assert.AreEqual(true, record.NeedRecalculation);
- Assert.AreEqual(0, record.ID);
+ ClassicAssert.AreEqual(true, record.NeedRecalculation);
+ ClassicAssert.AreEqual(0, record.ID);
record.ID = (7);
record.NeedRecalculation = (false);
- Assert.AreEqual(false, record.NeedRecalculation);
- Assert.AreEqual(7, record.ID);
+ ClassicAssert.AreEqual(false, record.NeedRecalculation);
+ ClassicAssert.AreEqual(7, record.ID);
}
@@ -83,23 +83,23 @@ public void TestCreateCFHeader12Record()
};
record.CellRanges = (ranges);
ranges = record.CellRanges;
- Assert.AreEqual(6, ranges.Length);
+ ClassicAssert.AreEqual(6, ranges.Length);
CellRangeAddress enclosingCellRange = record.EnclosingCellRange;
- Assert.AreEqual(0, enclosingCellRange.FirstRow);
- Assert.AreEqual(65535, enclosingCellRange.LastRow);
- Assert.AreEqual(0, enclosingCellRange.FirstColumn);
- Assert.AreEqual(6, enclosingCellRange.LastColumn);
- Assert.AreEqual(false, record.NeedRecalculation);
- Assert.AreEqual(0, record.ID);
+ ClassicAssert.AreEqual(0, enclosingCellRange.FirstRow);
+ ClassicAssert.AreEqual(65535, enclosingCellRange.LastRow);
+ ClassicAssert.AreEqual(0, enclosingCellRange.FirstColumn);
+ ClassicAssert.AreEqual(6, enclosingCellRange.LastColumn);
+ ClassicAssert.AreEqual(false, record.NeedRecalculation);
+ ClassicAssert.AreEqual(0, record.ID);
record.NeedRecalculation = (true);
- Assert.AreEqual(true, record.NeedRecalculation);
- Assert.AreEqual(0, record.ID);
+ ClassicAssert.AreEqual(true, record.NeedRecalculation);
+ ClassicAssert.AreEqual(0, record.ID);
record.ID = (7);
record.NeedRecalculation = (false);
- Assert.AreEqual(false, record.NeedRecalculation);
- Assert.AreEqual(7, record.ID);
+ ClassicAssert.AreEqual(false, record.NeedRecalculation);
+ ClassicAssert.AreEqual(7, record.ID);
}
@@ -141,24 +141,24 @@ public void TestSerialization()
CFHeaderRecord record = new CFHeaderRecord(TestcaseRecordInputStream.Create(CFHeaderRecord.sid, recordData));
- Assert.AreEqual(3, record.NumberOfConditionalFormats, "#CFRULES");
- Assert.IsTrue(record.NeedRecalculation);
+ ClassicAssert.AreEqual(3, record.NumberOfConditionalFormats, "#CFRULES");
+ ClassicAssert.IsTrue(record.NeedRecalculation);
Confirm(record.EnclosingCellRange, 0, 3, 0, 3);
CellRangeAddress[] ranges = record.CellRanges;
- Assert.AreEqual(4, ranges.Length);
+ ClassicAssert.AreEqual(4, ranges.Length);
Confirm(ranges[0], 0, 1, 0, 1);
Confirm(ranges[1], 0, 1, 2, 3);
Confirm(ranges[2], 2, 3, 0, 1);
Confirm(ranges[3], 2, 3, 2, 3);
- Assert.AreEqual(recordData.Length + 4, record.RecordSize);
+ ClassicAssert.AreEqual(recordData.Length + 4, record.RecordSize);
byte[] output = record.Serialize();
- Assert.AreEqual(recordData.Length + 4, output.Length, "Output size"); //includes sid+recordlength
+ ClassicAssert.AreEqual(recordData.Length + 4, output.Length, "Output size"); //includes sid+recordlength
for (int i = 0; i < recordData.Length; i++)
{
- Assert.AreEqual(recordData[i], output[i + 4], "CFHeaderRecord doesn't match");
+ ClassicAssert.AreEqual(recordData[i], output[i + 4], "CFHeaderRecord doesn't match");
}
}
[Test]
@@ -205,32 +205,32 @@ public void TestExtremeRows()
throw e;
}
- Assert.AreEqual(19, record.NumberOfConditionalFormats, "#CFRULES");
- Assert.IsFalse(record.NeedRecalculation);
+ ClassicAssert.AreEqual(19, record.NumberOfConditionalFormats, "#CFRULES");
+ ClassicAssert.IsFalse(record.NeedRecalculation);
Confirm(record.EnclosingCellRange, 0, 65535, 0, 255);
CellRangeAddress[] ranges = record.CellRanges;
- Assert.AreEqual(3, ranges.Length);
+ ClassicAssert.AreEqual(3, ranges.Length);
Confirm(ranges[0], 40000, 50000, 2, 2);
Confirm(ranges[1], 0, 65535, 5, 5);
Confirm(ranges[2], 7, 7, 0, 255);
byte[] output = record.Serialize();
- Assert.AreEqual(recordData.Length + 4, output.Length, "Output size"); //includes sid+recordlength
+ ClassicAssert.AreEqual(recordData.Length + 4, output.Length, "Output size"); //includes sid+recordlength
for (int i = 0; i < recordData.Length; i++)
{
- Assert.AreEqual(recordData[i], output[i + 4], "CFHeaderRecord doesn't match");
+ ClassicAssert.AreEqual(recordData[i], output[i + 4], "CFHeaderRecord doesn't match");
}
}
private static void Confirm(CellRangeAddress cr, int expFirstRow, int expLastRow, int expFirstCol, int expLastColumn)
{
- Assert.AreEqual(expFirstRow, cr.FirstRow, "first row");
- Assert.AreEqual(expLastRow, cr.LastRow, "last row");
- Assert.AreEqual(expFirstCol, cr.FirstColumn, "first column");
- Assert.AreEqual(expLastColumn, cr.LastColumn, "last column");
+ ClassicAssert.AreEqual(expFirstRow, cr.FirstRow, "first row");
+ ClassicAssert.AreEqual(expLastRow, cr.LastRow, "last row");
+ ClassicAssert.AreEqual(expFirstCol, cr.FirstColumn, "first column");
+ ClassicAssert.AreEqual(expLastColumn, cr.LastColumn, "last column");
}
}
diff --git a/testcases/main/HSSF/Record/TestCFRuleRecord.cs b/testcases/main/HSSF/Record/TestCFRuleRecord.cs
index df13a13f2..1ce906a84 100644
--- a/testcases/main/HSSF/Record/TestCFRuleRecord.cs
+++ b/testcases/main/HSSF/Record/TestCFRuleRecord.cs
@@ -18,7 +18,7 @@ limitations under the License.
namespace TestCases.HSSF.Record
{
using System;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NUnit.Framework.Constraints;
using NPOI.HSSF.Record;
using NPOI.HSSF.Record.CF;
@@ -46,22 +46,22 @@ public void TestConstructors()
ISheet sheet = workbook.CreateSheet();
CFRuleRecord rule1 = CFRuleRecord.Create((HSSFSheet)sheet, "7");
- Assert.AreEqual(CFRuleRecord.CONDITION_TYPE_FORMULA, rule1.ConditionType);
- Assert.AreEqual((byte)ComparisonOperator.NoComparison, rule1.ComparisonOperation);
- Assert.IsNotNull(rule1.ParsedExpression1);
- Assert.AreSame(Ptg.EMPTY_PTG_ARRAY, rule1.ParsedExpression2);
+ ClassicAssert.AreEqual(CFRuleRecord.CONDITION_TYPE_FORMULA, rule1.ConditionType);
+ ClassicAssert.AreEqual((byte)ComparisonOperator.NoComparison, rule1.ComparisonOperation);
+ ClassicAssert.IsNotNull(rule1.ParsedExpression1);
+ ClassicAssert.AreSame(Ptg.EMPTY_PTG_ARRAY, rule1.ParsedExpression2);
CFRuleRecord rule2 = CFRuleRecord.Create((HSSFSheet)sheet, (byte)ComparisonOperator.Between, "2", "5");
- Assert.AreEqual(CFRuleRecord.CONDITION_TYPE_CELL_VALUE_IS, rule2.ConditionType);
- Assert.AreEqual((byte)ComparisonOperator.Between, rule2.ComparisonOperation);
- Assert.IsNotNull(rule2.ParsedExpression1);
- Assert.IsNotNull(rule2.ParsedExpression2);
+ ClassicAssert.AreEqual(CFRuleRecord.CONDITION_TYPE_CELL_VALUE_IS, rule2.ConditionType);
+ ClassicAssert.AreEqual((byte)ComparisonOperator.Between, rule2.ComparisonOperation);
+ ClassicAssert.IsNotNull(rule2.ParsedExpression1);
+ ClassicAssert.IsNotNull(rule2.ParsedExpression2);
CFRuleRecord rule3 = CFRuleRecord.Create((HSSFSheet)sheet, (byte)ComparisonOperator.Equal, null, null);
- Assert.AreEqual(CFRuleRecord.CONDITION_TYPE_CELL_VALUE_IS, rule3.ConditionType);
- Assert.AreEqual((byte)ComparisonOperator.Equal, rule3.ComparisonOperation);
- Assert.AreSame(Ptg.EMPTY_PTG_ARRAY, rule3.ParsedExpression2);
- Assert.AreSame(Ptg.EMPTY_PTG_ARRAY, rule3.ParsedExpression2);
+ ClassicAssert.AreEqual(CFRuleRecord.CONDITION_TYPE_CELL_VALUE_IS, rule3.ConditionType);
+ ClassicAssert.AreEqual((byte)ComparisonOperator.Equal, rule3.ComparisonOperation);
+ ClassicAssert.AreSame(Ptg.EMPTY_PTG_ARRAY, rule3.ParsedExpression2);
+ ClassicAssert.AreSame(Ptg.EMPTY_PTG_ARRAY, rule3.ParsedExpression2);
}
[Test]
public void TestCreateCFRuleRecord()
@@ -85,11 +85,11 @@ public void TestCreateCFRuleRecord()
byte[] output = record.Serialize();
// Compare
- Assert.AreEqual(recordData.Length + 4, output.Length, "Output size"); //includes sid+recordlength
+ ClassicAssert.AreEqual(recordData.Length + 4, output.Length, "Output size"); //includes sid+recordlength
for (int i = 0; i < recordData.Length; i++)
{
- Assert.AreEqual(recordData[i], output[i + 4], "CFRuleRecord doesn't match");
+ ClassicAssert.AreEqual(recordData[i], output[i + 4], "CFRuleRecord doesn't match");
}
}
[Test]
@@ -109,10 +109,10 @@ public void TestCreateCFRule12Record()
// Serialize again
byte[] output = record.Serialize();
// Compare
- Assert.AreEqual(recordData.Length + 4, output.Length, "Output size"); //includes sid+recordlength
+ ClassicAssert.AreEqual(recordData.Length + 4, output.Length, "Output size"); //includes sid+recordlength
for (int i = 0; i < recordData.Length; i++)
{
- Assert.AreEqual(recordData[i], output[i + 4], "CFRule12Record doesn't match");
+ ClassicAssert.AreEqual(recordData[i], output[i + 4], "CFRule12Record doesn't match");
}
}
@@ -129,8 +129,8 @@ public void TestCreateIconCFRule12Record()
// Check it
testCFRule12Record(record);
- Assert.AreEqual(IconSet.GREY_5_ARROWS, record.MultiStateFormatting.IconSet);
- Assert.AreEqual(5, record.MultiStateFormatting.Thresholds.Length);
+ ClassicAssert.AreEqual(IconSet.GREY_5_ARROWS, record.MultiStateFormatting.IconSet);
+ ClassicAssert.AreEqual(5, record.MultiStateFormatting.Thresholds.Length);
// Serialize
byte[] serializedRecord = record.Serialize();
// Strip header
@@ -140,15 +140,15 @@ public void TestCreateIconCFRule12Record()
record = new CFRule12Record(TestcaseRecordInputStream.Create(CFRule12Record.sid, recordData));
// Check it has the icon, and the right number of thresholds
- Assert.AreEqual(IconSet.GREY_5_ARROWS, record.MultiStateFormatting.IconSet);
- Assert.AreEqual(5, record.MultiStateFormatting.Thresholds.Length);
+ ClassicAssert.AreEqual(IconSet.GREY_5_ARROWS, record.MultiStateFormatting.IconSet);
+ ClassicAssert.AreEqual(5, record.MultiStateFormatting.Thresholds.Length);
// Serialize again
byte[] output = record.Serialize();
// Compare
- Assert.AreEqual(recordData.Length + 4, output.Length, "Output size"); //includes sid+recordlength
+ ClassicAssert.AreEqual(recordData.Length + 4, output.Length, "Output size"); //includes sid+recordlength
for (int i = 0; i < recordData.Length; i++)
{
- Assert.AreEqual(recordData[i], output[i + 4], "CFRule12Record doesn't match");
+ ClassicAssert.AreEqual(recordData[i], output[i + 4], "CFRule12Record doesn't match");
}
}
@@ -158,222 +158,222 @@ private void TestCFRuleRecord1(CFRuleRecord record)
testCFRuleBase(record);
- Assert.IsFalse(record.IsLeftBorderModified);
+ ClassicAssert.IsFalse(record.IsLeftBorderModified);
record.IsLeftBorderModified = (true);
- Assert.IsTrue(record.IsLeftBorderModified);
+ ClassicAssert.IsTrue(record.IsLeftBorderModified);
- Assert.IsFalse(record.IsRightBorderModified);
+ ClassicAssert.IsFalse(record.IsRightBorderModified);
record.IsRightBorderModified = (true);
- Assert.IsTrue(record.IsRightBorderModified);
+ ClassicAssert.IsTrue(record.IsRightBorderModified);
- Assert.IsFalse(record.IsTopBorderModified);
+ ClassicAssert.IsFalse(record.IsTopBorderModified);
record.IsTopBorderModified = (true);
- Assert.IsTrue(record.IsTopBorderModified);
+ ClassicAssert.IsTrue(record.IsTopBorderModified);
- Assert.IsFalse(record.IsBottomBorderModified);
+ ClassicAssert.IsFalse(record.IsBottomBorderModified);
record.IsBottomBorderModified = (true);
- Assert.IsTrue(record.IsBottomBorderModified);
+ ClassicAssert.IsTrue(record.IsBottomBorderModified);
- Assert.IsFalse(record.IsTopLeftBottomRightBorderModified);
+ ClassicAssert.IsFalse(record.IsTopLeftBottomRightBorderModified);
record.IsTopLeftBottomRightBorderModified = (true);
- Assert.IsTrue(record.IsTopLeftBottomRightBorderModified);
+ ClassicAssert.IsTrue(record.IsTopLeftBottomRightBorderModified);
- Assert.IsFalse(record.IsBottomLeftTopRightBorderModified);
+ ClassicAssert.IsFalse(record.IsBottomLeftTopRightBorderModified);
record.IsBottomLeftTopRightBorderModified = (true);
- Assert.IsTrue(record.IsBottomLeftTopRightBorderModified);
+ ClassicAssert.IsTrue(record.IsBottomLeftTopRightBorderModified);
- Assert.IsFalse(record.IsPatternBackgroundColorModified);
+ ClassicAssert.IsFalse(record.IsPatternBackgroundColorModified);
record.IsPatternBackgroundColorModified = (true);
- Assert.IsTrue(record.IsPatternBackgroundColorModified);
+ ClassicAssert.IsTrue(record.IsPatternBackgroundColorModified);
- Assert.IsFalse(record.IsPatternColorModified);
+ ClassicAssert.IsFalse(record.IsPatternColorModified);
record.IsPatternColorModified = (true);
- Assert.IsTrue(record.IsPatternColorModified);
+ ClassicAssert.IsTrue(record.IsPatternColorModified);
- Assert.IsFalse(record.IsPatternStyleModified);
+ ClassicAssert.IsFalse(record.IsPatternStyleModified);
record.IsPatternStyleModified = (true);
- Assert.IsTrue(record.IsPatternStyleModified);
+ ClassicAssert.IsTrue(record.IsPatternStyleModified);
}
private void testCFRule12Record(CFRule12Record record)
{
- Assert.AreEqual(CFRule12Record.sid, record.GetFutureRecordType());
- Assert.AreEqual("A1", record.GetAssociatedRange().FormatAsString());
+ ClassicAssert.AreEqual(CFRule12Record.sid, record.GetFutureRecordType());
+ ClassicAssert.AreEqual("A1", record.GetAssociatedRange().FormatAsString());
testCFRuleBase(record);
}
private void testCFRuleBase(CFRuleBase record)
{
FontFormatting fontFormatting = new FontFormatting();
TestFontFormattingAccessors(fontFormatting);
- Assert.IsFalse(record.ContainsFontFormattingBlock);
+ ClassicAssert.IsFalse(record.ContainsFontFormattingBlock);
record.FontFormatting = (fontFormatting);
- Assert.IsTrue(record.ContainsFontFormattingBlock);
+ ClassicAssert.IsTrue(record.ContainsFontFormattingBlock);
BorderFormatting borderFormatting = new BorderFormatting();
TestBorderFormattingAccessors(borderFormatting);
- Assert.IsFalse(record.ContainsBorderFormattingBlock);
+ ClassicAssert.IsFalse(record.ContainsBorderFormattingBlock);
record.BorderFormatting = (borderFormatting);
- Assert.IsTrue(record.ContainsBorderFormattingBlock);
+ ClassicAssert.IsTrue(record.ContainsBorderFormattingBlock);
PatternFormatting patternFormatting = new PatternFormatting();
TestPatternFormattingAccessors(patternFormatting);
- Assert.IsFalse(record.ContainsPatternFormattingBlock);
+ ClassicAssert.IsFalse(record.ContainsPatternFormattingBlock);
record.PatternFormatting = (patternFormatting);
- Assert.IsTrue(record.ContainsPatternFormattingBlock);
+ ClassicAssert.IsTrue(record.ContainsPatternFormattingBlock);
}
private void TestPatternFormattingAccessors(PatternFormatting patternFormatting)
{
patternFormatting.FillBackgroundColor = (HSSFColor.Green.Index);
- Assert.AreEqual(HSSFColor.Green.Index, patternFormatting.FillBackgroundColor);
+ ClassicAssert.AreEqual(HSSFColor.Green.Index, patternFormatting.FillBackgroundColor);
patternFormatting.FillForegroundColor = (HSSFColor.Indigo.Index);
- Assert.AreEqual(HSSFColor.Indigo.Index, patternFormatting.FillForegroundColor);
+ ClassicAssert.AreEqual(HSSFColor.Indigo.Index, patternFormatting.FillForegroundColor);
patternFormatting.FillPattern = FillPattern.Diamonds;
- Assert.AreEqual(FillPattern.Diamonds, patternFormatting.FillPattern);
+ ClassicAssert.AreEqual(FillPattern.Diamonds, patternFormatting.FillPattern);
}
private void TestBorderFormattingAccessors(BorderFormatting borderFormatting)
{
borderFormatting.IsBackwardDiagonalOn = (false);
- Assert.IsFalse(borderFormatting.IsBackwardDiagonalOn);
+ ClassicAssert.IsFalse(borderFormatting.IsBackwardDiagonalOn);
borderFormatting.IsBackwardDiagonalOn = (true);
- Assert.IsTrue(borderFormatting.IsBackwardDiagonalOn);
+ ClassicAssert.IsTrue(borderFormatting.IsBackwardDiagonalOn);
borderFormatting.BorderBottom = BorderStyle.Dotted;
- Assert.AreEqual(BorderStyle.Dotted, borderFormatting.BorderBottom);
+ ClassicAssert.AreEqual(BorderStyle.Dotted, borderFormatting.BorderBottom);
borderFormatting.BorderDiagonal = (BorderStyle.Medium);
- Assert.AreEqual(BorderStyle.Medium, borderFormatting.BorderDiagonal);
+ ClassicAssert.AreEqual(BorderStyle.Medium, borderFormatting.BorderDiagonal);
borderFormatting.BorderLeft = (BorderStyle.MediumDashDotDot);
- Assert.AreEqual(BorderStyle.MediumDashDotDot, borderFormatting.BorderLeft);
+ ClassicAssert.AreEqual(BorderStyle.MediumDashDotDot, borderFormatting.BorderLeft);
borderFormatting.BorderRight = (BorderStyle.MediumDashed);
- Assert.AreEqual(BorderStyle.MediumDashed, borderFormatting.BorderRight);
+ ClassicAssert.AreEqual(BorderStyle.MediumDashed, borderFormatting.BorderRight);
borderFormatting.BorderTop = (BorderStyle.Hair);
- Assert.AreEqual(BorderStyle.Hair, borderFormatting.BorderTop);
+ ClassicAssert.AreEqual(BorderStyle.Hair, borderFormatting.BorderTop);
borderFormatting.BottomBorderColor = (HSSFColor.Aqua.Index);
- Assert.AreEqual(HSSFColor.Aqua.Index, borderFormatting.BottomBorderColor);
+ ClassicAssert.AreEqual(HSSFColor.Aqua.Index, borderFormatting.BottomBorderColor);
borderFormatting.DiagonalBorderColor = (HSSFColor.Red.Index);
- Assert.AreEqual(HSSFColor.Red.Index, borderFormatting.DiagonalBorderColor);
+ ClassicAssert.AreEqual(HSSFColor.Red.Index, borderFormatting.DiagonalBorderColor);
- Assert.IsFalse(borderFormatting.IsForwardDiagonalOn);
+ ClassicAssert.IsFalse(borderFormatting.IsForwardDiagonalOn);
borderFormatting.IsForwardDiagonalOn = (true);
- Assert.IsTrue(borderFormatting.IsForwardDiagonalOn);
+ ClassicAssert.IsTrue(borderFormatting.IsForwardDiagonalOn);
borderFormatting.LeftBorderColor = (HSSFColor.Black.Index);
- Assert.AreEqual(HSSFColor.Black.Index, borderFormatting.LeftBorderColor);
+ ClassicAssert.AreEqual(HSSFColor.Black.Index, borderFormatting.LeftBorderColor);
borderFormatting.RightBorderColor = (HSSFColor.Blue.Index);
- Assert.AreEqual(HSSFColor.Blue.Index, borderFormatting.RightBorderColor);
+ ClassicAssert.AreEqual(HSSFColor.Blue.Index, borderFormatting.RightBorderColor);
borderFormatting.TopBorderColor = (HSSFColor.Gold.Index);
- Assert.AreEqual(HSSFColor.Gold.Index, borderFormatting.TopBorderColor);
+ ClassicAssert.AreEqual(HSSFColor.Gold.Index, borderFormatting.TopBorderColor);
}
private void TestFontFormattingAccessors(FontFormatting fontFormatting)
{
// Check for defaults
- Assert.IsFalse(fontFormatting.IsEscapementTypeModified);
- Assert.IsFalse(fontFormatting.IsFontCancellationModified);
- Assert.IsFalse(fontFormatting.IsFontOutlineModified);
- Assert.IsFalse(fontFormatting.IsFontShadowModified);
- Assert.IsFalse(fontFormatting.IsFontStyleModified);
- Assert.IsFalse(fontFormatting.IsUnderlineTypeModified);
- Assert.IsFalse(fontFormatting.IsFontWeightModified);
-
- Assert.IsFalse(fontFormatting.IsBold);
- Assert.IsFalse(fontFormatting.IsItalic);
- Assert.IsFalse(fontFormatting.IsOutlineOn);
- Assert.IsFalse(fontFormatting.IsShadowOn);
- Assert.IsFalse(fontFormatting.IsStruckout);
-
- Assert.AreEqual(FontSuperScript.None, fontFormatting.EscapementType);
- Assert.AreEqual(-1, fontFormatting.FontColorIndex);
- Assert.AreEqual(-1, fontFormatting.FontHeight);
- Assert.AreEqual(0, fontFormatting.FontWeight);
- Assert.AreEqual(FontUnderlineType.None, fontFormatting.UnderlineType);
+ ClassicAssert.IsFalse(fontFormatting.IsEscapementTypeModified);
+ ClassicAssert.IsFalse(fontFormatting.IsFontCancellationModified);
+ ClassicAssert.IsFalse(fontFormatting.IsFontOutlineModified);
+ ClassicAssert.IsFalse(fontFormatting.IsFontShadowModified);
+ ClassicAssert.IsFalse(fontFormatting.IsFontStyleModified);
+ ClassicAssert.IsFalse(fontFormatting.IsUnderlineTypeModified);
+ ClassicAssert.IsFalse(fontFormatting.IsFontWeightModified);
+
+ ClassicAssert.IsFalse(fontFormatting.IsBold);
+ ClassicAssert.IsFalse(fontFormatting.IsItalic);
+ ClassicAssert.IsFalse(fontFormatting.IsOutlineOn);
+ ClassicAssert.IsFalse(fontFormatting.IsShadowOn);
+ ClassicAssert.IsFalse(fontFormatting.IsStruckout);
+
+ ClassicAssert.AreEqual(FontSuperScript.None, fontFormatting.EscapementType);
+ ClassicAssert.AreEqual(-1, fontFormatting.FontColorIndex);
+ ClassicAssert.AreEqual(-1, fontFormatting.FontHeight);
+ ClassicAssert.AreEqual(0, fontFormatting.FontWeight);
+ ClassicAssert.AreEqual(FontUnderlineType.None, fontFormatting.UnderlineType);
fontFormatting.IsBold = (true);
- Assert.IsTrue(fontFormatting.IsBold);
+ ClassicAssert.IsTrue(fontFormatting.IsBold);
fontFormatting.IsBold = (false);
- Assert.IsFalse(fontFormatting.IsBold);
+ ClassicAssert.IsFalse(fontFormatting.IsBold);
fontFormatting.EscapementType = FontSuperScript.Sub;
- Assert.AreEqual(FontSuperScript.Sub, fontFormatting.EscapementType);
+ ClassicAssert.AreEqual(FontSuperScript.Sub, fontFormatting.EscapementType);
fontFormatting.EscapementType = FontSuperScript.Super;
- Assert.AreEqual(FontSuperScript.Super, fontFormatting.EscapementType);
+ ClassicAssert.AreEqual(FontSuperScript.Super, fontFormatting.EscapementType);
fontFormatting.EscapementType = FontSuperScript.None;
- Assert.AreEqual(FontSuperScript.None, fontFormatting.EscapementType);
+ ClassicAssert.AreEqual(FontSuperScript.None, fontFormatting.EscapementType);
fontFormatting.IsEscapementTypeModified = (false);
- Assert.IsFalse(fontFormatting.IsEscapementTypeModified);
+ ClassicAssert.IsFalse(fontFormatting.IsEscapementTypeModified);
fontFormatting.IsEscapementTypeModified = (true);
- Assert.IsTrue(fontFormatting.IsEscapementTypeModified);
+ ClassicAssert.IsTrue(fontFormatting.IsEscapementTypeModified);
fontFormatting.IsFontWeightModified = (false);
- Assert.IsFalse(fontFormatting.IsFontWeightModified);
+ ClassicAssert.IsFalse(fontFormatting.IsFontWeightModified);
fontFormatting.IsFontWeightModified = (true);
- Assert.IsTrue(fontFormatting.IsFontWeightModified);
+ ClassicAssert.IsTrue(fontFormatting.IsFontWeightModified);
fontFormatting.IsFontCancellationModified = (false);
- Assert.IsFalse(fontFormatting.IsFontCancellationModified);
+ ClassicAssert.IsFalse(fontFormatting.IsFontCancellationModified);
fontFormatting.IsFontCancellationModified = (true);
- Assert.IsTrue(fontFormatting.IsFontCancellationModified);
+ ClassicAssert.IsTrue(fontFormatting.IsFontCancellationModified);
fontFormatting.FontColorIndex = ((short)10);
- Assert.AreEqual(10, fontFormatting.FontColorIndex);
+ ClassicAssert.AreEqual(10, fontFormatting.FontColorIndex);
fontFormatting.FontHeight = (100);
- Assert.AreEqual(100, fontFormatting.FontHeight);
+ ClassicAssert.AreEqual(100, fontFormatting.FontHeight);
fontFormatting.IsFontOutlineModified = (false);
- Assert.IsFalse(fontFormatting.IsFontOutlineModified);
+ ClassicAssert.IsFalse(fontFormatting.IsFontOutlineModified);
fontFormatting.IsFontOutlineModified = (true);
- Assert.IsTrue(fontFormatting.IsFontOutlineModified);
+ ClassicAssert.IsTrue(fontFormatting.IsFontOutlineModified);
fontFormatting.IsFontShadowModified = (false);
- Assert.IsFalse(fontFormatting.IsFontShadowModified);
+ ClassicAssert.IsFalse(fontFormatting.IsFontShadowModified);
fontFormatting.IsFontShadowModified = (true);
- Assert.IsTrue(fontFormatting.IsFontShadowModified);
+ ClassicAssert.IsTrue(fontFormatting.IsFontShadowModified);
fontFormatting.IsFontStyleModified = (false);
- Assert.IsFalse(fontFormatting.IsFontStyleModified);
+ ClassicAssert.IsFalse(fontFormatting.IsFontStyleModified);
fontFormatting.IsFontStyleModified = (true);
- Assert.IsTrue(fontFormatting.IsFontStyleModified);
+ ClassicAssert.IsTrue(fontFormatting.IsFontStyleModified);
fontFormatting.IsItalic = (false);
- Assert.IsFalse(fontFormatting.IsItalic);
+ ClassicAssert.IsFalse(fontFormatting.IsItalic);
fontFormatting.IsItalic = (true);
- Assert.IsTrue(fontFormatting.IsItalic);
+ ClassicAssert.IsTrue(fontFormatting.IsItalic);
fontFormatting.IsOutlineOn = (false);
- Assert.IsFalse(fontFormatting.IsOutlineOn);
+ ClassicAssert.IsFalse(fontFormatting.IsOutlineOn);
fontFormatting.IsOutlineOn = (true);
- Assert.IsTrue(fontFormatting.IsOutlineOn);
+ ClassicAssert.IsTrue(fontFormatting.IsOutlineOn);
fontFormatting.IsShadowOn = (false);
- Assert.IsFalse(fontFormatting.IsShadowOn);
+ ClassicAssert.IsFalse(fontFormatting.IsShadowOn);
fontFormatting.IsShadowOn = (true);
- Assert.IsTrue(fontFormatting.IsShadowOn);
+ ClassicAssert.IsTrue(fontFormatting.IsShadowOn);
fontFormatting.IsStruckout = (false);
- Assert.IsFalse(fontFormatting.IsStruckout);
+ ClassicAssert.IsFalse(fontFormatting.IsStruckout);
fontFormatting.IsStruckout = (true);
- Assert.IsTrue(fontFormatting.IsStruckout);
+ ClassicAssert.IsTrue(fontFormatting.IsStruckout);
fontFormatting.UnderlineType = FontUnderlineType.DoubleAccounting;
- Assert.AreEqual(FontUnderlineType.DoubleAccounting, fontFormatting.UnderlineType);
+ ClassicAssert.AreEqual(FontUnderlineType.DoubleAccounting, fontFormatting.UnderlineType);
fontFormatting.IsUnderlineTypeModified = (false);
- Assert.IsFalse(fontFormatting.IsUnderlineTypeModified);
+ ClassicAssert.IsFalse(fontFormatting.IsUnderlineTypeModified);
fontFormatting.IsUnderlineTypeModified = (true);
- Assert.IsTrue(fontFormatting.IsUnderlineTypeModified);
+ ClassicAssert.IsTrue(fontFormatting.IsUnderlineTypeModified);
}
[Test]
public void TestWrite() {
@@ -386,15 +386,15 @@ public void TestWrite() {
rr.PatternFormatting=(patternFormatting);
byte[] data = rr.Serialize();
- Assert.AreEqual(26, data.Length);
- Assert.AreEqual(3, LittleEndian.GetShort(data, 6));
- Assert.AreEqual(3, LittleEndian.GetShort(data, 8));
+ ClassicAssert.AreEqual(26, data.Length);
+ ClassicAssert.AreEqual(3, LittleEndian.GetShort(data, 6));
+ ClassicAssert.AreEqual(3, LittleEndian.GetShort(data, 8));
int flags = LittleEndian.GetInt(data, 10);
- Assert.AreEqual(0x00380000, flags & 0x00380000,"unused flags should be 111");
- Assert.AreEqual(0, flags & 0x03C00000,"undocumented flags should be 0000"); // Otherwise Excel s unhappy
+ ClassicAssert.AreEqual(0x00380000, flags & 0x00380000,"unused flags should be 111");
+ ClassicAssert.AreEqual(0, flags & 0x03C00000,"undocumented flags should be 0000"); // Otherwise Excel s unhappy
// check all remaining flag bits (some are not well understood yet)
- Assert.AreEqual(0x203FFFFF, flags);
+ ClassicAssert.AreEqual(0x203FFFFF, flags);
}
private static byte[] DATA_REFN = {
@@ -418,14 +418,14 @@ public void TestReserializeRefNTokens()
RecordInputStream is1 = TestcaseRecordInputStream.Create (CFRuleRecord.sid, DATA_REFN);
CFRuleRecord rr = new CFRuleRecord(is1);
Ptg[] ptgs = rr.ParsedExpression1;
- Assert.AreEqual(3, ptgs.Length);
+ ClassicAssert.AreEqual(3, ptgs.Length);
if (ptgs[0] is RefPtg) {
throw new AssertionException("Identified bug 45234");
}
- Assert.AreEqual(typeof(RefNPtg), ptgs[0].GetType());
+ ClassicAssert.AreEqual(typeof(RefNPtg), ptgs[0].GetType());
RefNPtg refNPtg = (RefNPtg) ptgs[0];
- Assert.IsTrue(refNPtg.IsColRelative);
- Assert.IsTrue(refNPtg.IsRowRelative);
+ ClassicAssert.IsTrue(refNPtg.IsColRelative);
+ ClassicAssert.IsTrue(refNPtg.IsRowRelative);
byte[] data = rr.Serialize();
@@ -450,9 +450,9 @@ public void TestBug53691()
public void TestBug57231_rewrite()
{
HSSFWorkbook wb = HSSFITestDataProvider.Instance.OpenSampleWorkbook("57231_MixedGasReport.xls") as HSSFWorkbook;
- Assert.AreEqual(7, wb.NumberOfSheets);
+ ClassicAssert.AreEqual(7, wb.NumberOfSheets);
wb = HSSFITestDataProvider.Instance.WriteOutAndReadBack(wb) as HSSFWorkbook;
- Assert.AreEqual(7, wb.NumberOfSheets);
+ ClassicAssert.AreEqual(7, wb.NumberOfSheets);
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/Record/TestColumnInfoRecord.cs b/testcases/main/HSSF/Record/TestColumnInfoRecord.cs
index e189f1438..a0447822d 100644
--- a/testcases/main/HSSF/Record/TestColumnInfoRecord.cs
+++ b/testcases/main/HSSF/Record/TestColumnInfoRecord.cs
@@ -17,7 +17,7 @@ limitations under the License.
namespace TestCases.HSSF.Record
{
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.Util;
using TestCases.HSSF.Record;
@@ -37,16 +37,16 @@ public void TestBasic() {
RecordInputStream in1 = TestcaseRecordInputStream.Create(data);
ColumnInfoRecord cir = new ColumnInfoRecord(in1);
- Assert.AreEqual(0, in1.Remaining);
+ ClassicAssert.AreEqual(0, in1.Remaining);
- Assert.AreEqual(20, cir.FirstColumn);
- Assert.AreEqual(155, cir.LastColumn);
- Assert.AreEqual(6599, cir.ColumnWidth);
- Assert.AreEqual(15, cir.XFIndex);
- Assert.AreEqual(true, cir.IsHidden);
- Assert.AreEqual(3, cir.OutlineLevel);
- Assert.AreEqual(true, cir.IsCollapsed);
- Assert.IsTrue(Arrays.Equals(data, cir.Serialize()));
+ ClassicAssert.AreEqual(20, cir.FirstColumn);
+ ClassicAssert.AreEqual(155, cir.LastColumn);
+ ClassicAssert.AreEqual(6599, cir.ColumnWidth);
+ ClassicAssert.AreEqual(15, cir.XFIndex);
+ ClassicAssert.AreEqual(true, cir.IsHidden);
+ ClassicAssert.AreEqual(3, cir.OutlineLevel);
+ ClassicAssert.AreEqual(true, cir.IsCollapsed);
+ ClassicAssert.IsTrue(Arrays.Equals(data, cir.Serialize()));
}
/**
@@ -75,8 +75,8 @@ public void TestZeroResevedBytes_bug48332()
}
throw e;
}
- Assert.AreEqual(0, in1.Remaining);
- Assert.IsTrue(Arrays.Equals(outData, cir.Serialize()));
+ ClassicAssert.AreEqual(0, in1.Remaining);
+ ClassicAssert.IsTrue(Arrays.Equals(outData, cir.Serialize()));
}
/**
@@ -91,8 +91,8 @@ public void TestOneReservedByte()
byte[] outData = HexRead.ReadFromString("7D 00 0C 00 00 00 00 00 24 02 0F 00 00 00 01 00");
RecordInputStream in1 = TestcaseRecordInputStream.Create(inpData);
ColumnInfoRecord cir = new ColumnInfoRecord(in1);
- Assert.AreEqual(0, in1.Remaining);
- Assert.IsTrue(Arrays.Equals(outData, cir.Serialize()));
+ ClassicAssert.AreEqual(0, in1.Remaining);
+ ClassicAssert.IsTrue(Arrays.Equals(outData, cir.Serialize()));
}
}
diff --git a/testcases/main/HSSF/Record/TestCommonObjectDataSubRecord.cs b/testcases/main/HSSF/Record/TestCommonObjectDataSubRecord.cs
index 5327951dc..094b7b955 100644
--- a/testcases/main/HSSF/Record/TestCommonObjectDataSubRecord.cs
+++ b/testcases/main/HSSF/Record/TestCommonObjectDataSubRecord.cs
@@ -23,7 +23,7 @@ namespace TestCases.HSSF.Record
using System;
using NPOI.HSSF.Record;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
* Tests the serialization and deserialization of the CommonObjectDataSubRecord
@@ -50,17 +50,17 @@ public void TestLoad()
CommonObjectDataSubRecord record = new CommonObjectDataSubRecord(TestcaseRecordInputStream.Create((short)0x15, data),data.Length);
- Assert.AreEqual(CommonObjectType.ListBox, record.ObjectType);
- Assert.AreEqual((short)1, record.ObjectId);
- Assert.AreEqual((short)1, record.Option);
- Assert.AreEqual(true, record.IsLocked);
- Assert.AreEqual(false, record.IsPrintable);
- Assert.AreEqual(false, record.IsAutoFill);
- Assert.AreEqual(false, record.IsAutoline);
- Assert.AreEqual((int)24593, record.Reserved1);
- Assert.AreEqual((int)218103808, record.Reserved2);
- Assert.AreEqual((int)294, record.Reserved3);
- Assert.AreEqual(18, record.DataSize);
+ ClassicAssert.AreEqual(CommonObjectType.ListBox, record.ObjectType);
+ ClassicAssert.AreEqual((short)1, record.ObjectId);
+ ClassicAssert.AreEqual((short)1, record.Option);
+ ClassicAssert.AreEqual(true, record.IsLocked);
+ ClassicAssert.AreEqual(false, record.IsPrintable);
+ ClassicAssert.AreEqual(false, record.IsAutoFill);
+ ClassicAssert.AreEqual(false, record.IsAutoline);
+ ClassicAssert.AreEqual((int)24593, record.Reserved1);
+ ClassicAssert.AreEqual((int)218103808, record.Reserved2);
+ ClassicAssert.AreEqual((int)294, record.Reserved3);
+ ClassicAssert.AreEqual(18, record.DataSize);
}
[Test]
public void TestStore()
@@ -79,9 +79,9 @@ public void TestStore()
record.Reserved3 = ((int)294);
byte[] recordBytes = record.Serialize();
- Assert.AreEqual(recordBytes.Length - 4, data.Length);
+ ClassicAssert.AreEqual(recordBytes.Length - 4, data.Length);
for (int i = 0; i < data.Length; i++)
- Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
+ ClassicAssert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/Record/TestDConRefRecord.cs b/testcases/main/HSSF/Record/TestDConRefRecord.cs
index 6fd48f54a..5f8bdb6b5 100644
--- a/testcases/main/HSSF/Record/TestDConRefRecord.cs
+++ b/testcases/main/HSSF/Record/TestDConRefRecord.cs
@@ -19,7 +19,7 @@ limitations Under the License.
using System.IO;
using NPOI.HSSF.Record;
using NPOI.Util;
-using NUnit.Framework;
+using NUnit.Framework;using NUnit.Framework.Legacy;
namespace TestCases.HSSF.Record
{
@@ -227,7 +227,7 @@ private void TestReadWrite(byte[] data, String message)
d.Serialize(o);
o.Flush();
- Assert.IsTrue(Arrays.Equals(data, bos.ToArray()), message);
+ ClassicAssert.IsTrue(Arrays.Equals(data, bos.ToArray()), message);
}
/**
@@ -261,13 +261,13 @@ public void TestGetDataSize()
DConRefRecord instance = new DConRefRecord(TestcaseRecordInputStream.Create(81, data1));
int expResult = data1.Length;
int result = instance.RecordSize - 4;
- Assert.AreEqual(expResult, result, "single byte external reference, volume type path data size");
+ ClassicAssert.AreEqual(expResult, result, "single byte external reference, volume type path data size");
instance = new DConRefRecord(TestcaseRecordInputStream.Create(81, data2));
- Assert.AreEqual(data2.Length, instance.RecordSize - 4, "double byte self reference data size");
+ ClassicAssert.AreEqual(data2.Length, instance.RecordSize - 4, "double byte self reference data size");
instance = new DConRefRecord(TestcaseRecordInputStream.Create(81, data3));
- Assert.AreEqual(data3.Length, instance.RecordSize - 4, "single byte self reference data size");
+ ClassicAssert.AreEqual(data3.Length, instance.RecordSize - 4, "single byte self reference data size");
instance = new DConRefRecord(TestcaseRecordInputStream.Create(81, data4));
- Assert.AreEqual(data4.Length, instance.RecordSize - 4, "double byte external reference, UNC volume type path data size");
+ ClassicAssert.AreEqual(data4.Length, instance.RecordSize - 4, "double byte external reference, UNC volume type path data size");
}
/**
@@ -279,7 +279,7 @@ public void TestGetSid()
DConRefRecord instance = new DConRefRecord(TestcaseRecordInputStream.Create(81, data1));
short expResult = 81;
short result = instance.Sid;
- Assert.AreEqual(expResult, result, "SID");
+ ClassicAssert.AreEqual(expResult, result, "SID");
}
/**
@@ -292,7 +292,7 @@ public void TestGetPath()
DConRefRecord instance = new DConRefRecord(TestcaseRecordInputStream.Create(81, data1));
byte[] expResult = Arrays.CopyOfRange(data1, 9, data1.Length);
byte[] result = instance.GetPath();
- Assert.IsTrue(Arrays.Equals(expResult, result), "get path");
+ ClassicAssert.IsTrue(Arrays.Equals(expResult, result), "get path");
}
/**
@@ -302,9 +302,9 @@ public void TestGetPath()
public void TestIsExternalRef()
{
DConRefRecord instance = new DConRefRecord(TestcaseRecordInputStream.Create(81, data1));
- Assert.IsTrue(instance.IsExternalRef, "external reference");
+ ClassicAssert.IsTrue(instance.IsExternalRef, "external reference");
instance = new DConRefRecord(TestcaseRecordInputStream.Create(81, data2));
- Assert.IsFalse(instance.IsExternalRef, "internal reference");
+ ClassicAssert.IsFalse(instance.IsExternalRef, "internal reference");
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/Record/TestDVALRecord.cs b/testcases/main/HSSF/Record/TestDVALRecord.cs
index 4b7cae0ab..df7656780 100644
--- a/testcases/main/HSSF/Record/TestDVALRecord.cs
+++ b/testcases/main/HSSF/Record/TestDVALRecord.cs
@@ -20,7 +20,7 @@ namespace TestCases.HSSF.Record
using System.IO;
using NPOI.Util;
using NPOI.HSSF.Record;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
*
@@ -46,15 +46,15 @@ public void TestRead()
in1.NextRecord();
DVALRecord dv = new DVALRecord(in1);
- Assert.AreEqual(55, dv.Options);
- Assert.AreEqual(56, dv.HorizontalPos);
- Assert.AreEqual(57, dv.VerticalPos);
- Assert.AreEqual(58, dv.ObjectID);
+ ClassicAssert.AreEqual(55, dv.Options);
+ ClassicAssert.AreEqual(56, dv.HorizontalPos);
+ ClassicAssert.AreEqual(57, dv.VerticalPos);
+ ClassicAssert.AreEqual(58, dv.ObjectID);
if (dv.DVRecNo == 0)
{
Assert.Fail("Identified bug 44510");
}
- Assert.AreEqual(59, dv.DVRecNo);
+ ClassicAssert.AreEqual(59, dv.DVRecNo);
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/Record/TestDrawingGroupRecord.cs b/testcases/main/HSSF/Record/TestDrawingGroupRecord.cs
index fe2964dff..43571309b 100644
--- a/testcases/main/HSSF/Record/TestDrawingGroupRecord.cs
+++ b/testcases/main/HSSF/Record/TestDrawingGroupRecord.cs
@@ -19,7 +19,7 @@ namespace TestCases.HSSF.Record
{
using System;
using NPOI.HSSF.Record;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.DDF;
using NPOI.Util;
@@ -33,7 +33,7 @@ public class TestDrawingGroupRecord
public void TestRecordSize()
{
DrawingGroupRecord r = new DrawingGroupRecord();
- Assert.AreEqual(4, r.RecordSize);
+ ClassicAssert.AreEqual(4, r.RecordSize);
EscherSpRecord sp = new EscherSpRecord();
sp.RecordId = (EscherSpRecord.RECORD_ID);
@@ -46,25 +46,25 @@ public void TestRecordSize()
dggContainer.AddChildRecord(sp);
r.AddEscherRecord(dggContainer);
- Assert.AreEqual(28, r.RecordSize);
+ ClassicAssert.AreEqual(28, r.RecordSize);
byte[] data = new byte[28];
int size = r.Serialize(0, data);
- Assert.AreEqual("[EB, 00, 18, 00, 0F, 00, 00, F0, 10, 00, 00, 00, 11, 11, 0A, F0, 08, 00, 00, 00, FF, FF, FF, FF, FF, FF, FF, FF]", HexDump.ToHex(data));
- Assert.AreEqual(28, size);
+ ClassicAssert.AreEqual("[EB, 00, 18, 00, 0F, 00, 00, F0, 10, 00, 00, 00, 11, 11, 0A, F0, 08, 00, 00, 00, FF, FF, FF, FF, FF, FF, FF, FF]", HexDump.ToHex(data));
+ ClassicAssert.AreEqual(28, size);
- Assert.AreEqual(24, dggContainer.RecordSize);
+ ClassicAssert.AreEqual(24, dggContainer.RecordSize);
r = new DrawingGroupRecord();
r.RawData = (new byte[MAX_DATA_SIZE]);
- Assert.AreEqual(MAX_RECORD_SIZE, r.RecordSize);
+ ClassicAssert.AreEqual(MAX_RECORD_SIZE, r.RecordSize);
r.RawData = (new byte[MAX_DATA_SIZE + 1]);
- Assert.AreEqual(MAX_RECORD_SIZE + 5, r.RecordSize);
+ ClassicAssert.AreEqual(MAX_RECORD_SIZE + 5, r.RecordSize);
r.RawData = (new byte[MAX_DATA_SIZE * 2]);
- Assert.AreEqual(MAX_RECORD_SIZE * 2, r.RecordSize);
+ ClassicAssert.AreEqual(MAX_RECORD_SIZE * 2, r.RecordSize);
r.RawData = (new byte[MAX_DATA_SIZE * 2 + 1]);
- Assert.AreEqual(MAX_RECORD_SIZE * 2 + 5, r.RecordSize);
+ ClassicAssert.AreEqual(MAX_RECORD_SIZE * 2 + 5, r.RecordSize);
}
[Test]
public void TestSerialize()
@@ -77,15 +77,15 @@ public void TestSerialize()
r.RawData = (rawData);
byte[] buffer = new byte[r.RecordSize];
int size = r.Serialize(0, buffer);
- Assert.AreEqual(104, size);
- Assert.AreEqual("[EB, 00, 64, 00, 64, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, C8]", HexDump.ToHex(buffer));
+ ClassicAssert.AreEqual(104, size);
+ ClassicAssert.AreEqual("[EB, 00, 64, 00, 64, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, C8]", HexDump.ToHex(buffer));
// check at max record size
rawData = new byte[MAX_DATA_SIZE];
r.RawData = (rawData);
buffer = new byte[r.RecordSize];
size = r.Serialize(0, buffer);
- Assert.AreEqual(MAX_RECORD_SIZE, size);
+ ClassicAssert.AreEqual(MAX_RECORD_SIZE, size);
// check over max record size
rawData = new byte[MAX_DATA_SIZE + 1];
@@ -93,9 +93,9 @@ public void TestSerialize()
r.RawData = (rawData);
buffer = new byte[r.RecordSize];
size = r.Serialize(0, buffer);
- Assert.AreEqual(MAX_RECORD_SIZE + 5, size);
- Assert.AreEqual("[EB, 00, 20, 20]", HexDump.ToHex(cut(buffer, 0, 4)));
- Assert.AreEqual("[00, EB, 00, 01, 00, FF]", HexDump.ToHex(cut(buffer, MAX_RECORD_SIZE - 1, MAX_RECORD_SIZE + 5)));
+ ClassicAssert.AreEqual(MAX_RECORD_SIZE + 5, size);
+ ClassicAssert.AreEqual("[EB, 00, 20, 20]", HexDump.ToHex(cut(buffer, 0, 4)));
+ ClassicAssert.AreEqual("[00, EB, 00, 01, 00, FF]", HexDump.ToHex(cut(buffer, MAX_RECORD_SIZE - 1, MAX_RECORD_SIZE + 5)));
// check continue record
rawData = new byte[MAX_DATA_SIZE * 2 + 1];
@@ -103,19 +103,19 @@ public void TestSerialize()
r.RawData = (rawData);
buffer = new byte[r.RecordSize];
size = r.Serialize(0, buffer);
- Assert.AreEqual(MAX_RECORD_SIZE * 2 + 5, size);
- Assert.AreEqual(MAX_RECORD_SIZE * 2 + 5, r.RecordSize);
- Assert.AreEqual("[EB, 00, 20, 20]", HexDump.ToHex(cut(buffer, 0, 4)));
- Assert.AreEqual("[EB, 00, 20, 20]", HexDump.ToHex(cut(buffer, MAX_RECORD_SIZE, MAX_RECORD_SIZE + 4)));
- Assert.AreEqual("[3C, 00, 01, 00, FF]", HexDump.ToHex(cut(buffer, MAX_RECORD_SIZE * 2, MAX_RECORD_SIZE * 2 + 5)));
+ ClassicAssert.AreEqual(MAX_RECORD_SIZE * 2 + 5, size);
+ ClassicAssert.AreEqual(MAX_RECORD_SIZE * 2 + 5, r.RecordSize);
+ ClassicAssert.AreEqual("[EB, 00, 20, 20]", HexDump.ToHex(cut(buffer, 0, 4)));
+ ClassicAssert.AreEqual("[EB, 00, 20, 20]", HexDump.ToHex(cut(buffer, MAX_RECORD_SIZE, MAX_RECORD_SIZE + 4)));
+ ClassicAssert.AreEqual("[3C, 00, 01, 00, FF]", HexDump.ToHex(cut(buffer, MAX_RECORD_SIZE * 2, MAX_RECORD_SIZE * 2 + 5)));
// check continue record
rawData = new byte[664532];
r.RawData = (rawData);
buffer = new byte[r.RecordSize];
size = r.Serialize(0, buffer);
- Assert.AreEqual(664856, size);
- Assert.AreEqual(664856, r.RecordSize);
+ ClassicAssert.AreEqual(664856, size);
+ ClassicAssert.AreEqual(664856, r.RecordSize);
}
private byte[] cut(byte[] data, int fromInclusive, int toExclusive)
@@ -134,12 +134,12 @@ public void TestGrossSizeFromDataSize()
//System.out.println( " Diff: " + (DrawingGroupRecord.GrossSizeFromDataSize( i ) - i) );
}
- Assert.AreEqual(4, DrawingGroupRecord.GrossSizeFromDataSize(0));
- Assert.AreEqual(5, DrawingGroupRecord.GrossSizeFromDataSize(1));
- Assert.AreEqual(MAX_RECORD_SIZE, DrawingGroupRecord.GrossSizeFromDataSize(MAX_DATA_SIZE));
- Assert.AreEqual(MAX_RECORD_SIZE + 5, DrawingGroupRecord.GrossSizeFromDataSize(MAX_DATA_SIZE + 1));
- Assert.AreEqual(MAX_RECORD_SIZE * 2, DrawingGroupRecord.GrossSizeFromDataSize(MAX_DATA_SIZE * 2));
- Assert.AreEqual(MAX_RECORD_SIZE * 2 + 5, DrawingGroupRecord.GrossSizeFromDataSize(MAX_DATA_SIZE * 2 + 1));
+ ClassicAssert.AreEqual(4, DrawingGroupRecord.GrossSizeFromDataSize(0));
+ ClassicAssert.AreEqual(5, DrawingGroupRecord.GrossSizeFromDataSize(1));
+ ClassicAssert.AreEqual(MAX_RECORD_SIZE, DrawingGroupRecord.GrossSizeFromDataSize(MAX_DATA_SIZE));
+ ClassicAssert.AreEqual(MAX_RECORD_SIZE + 5, DrawingGroupRecord.GrossSizeFromDataSize(MAX_DATA_SIZE + 1));
+ ClassicAssert.AreEqual(MAX_RECORD_SIZE * 2, DrawingGroupRecord.GrossSizeFromDataSize(MAX_DATA_SIZE * 2));
+ ClassicAssert.AreEqual(MAX_RECORD_SIZE * 2 + 5, DrawingGroupRecord.GrossSizeFromDataSize(MAX_DATA_SIZE * 2 + 1));
}
}
diff --git a/testcases/main/HSSF/Record/TestDrawingRecord.cs b/testcases/main/HSSF/Record/TestDrawingRecord.cs
index 9e08999ed..c8af730d0 100644
--- a/testcases/main/HSSF/Record/TestDrawingRecord.cs
+++ b/testcases/main/HSSF/Record/TestDrawingRecord.cs
@@ -20,7 +20,7 @@ namespace TestCases.HSSF.Record
using System;
using System.Collections.Generic;
using System.IO;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.Record;
using NPOI.Util;
@@ -54,12 +54,12 @@ public void TestReadContinued()
out1.Write(dataX, 0, dataX.Length);
List rec = RecordFactory.CreateRecords(new MemoryStream(out1.ToArray()));
- Assert.AreEqual(2, rec.Count);
- Assert.IsTrue(rec[0] is DrawingRecord);
- Assert.IsTrue(rec[1] is ContinueRecord);
+ ClassicAssert.AreEqual(2, rec.Count);
+ ClassicAssert.IsTrue(rec[0] is DrawingRecord);
+ ClassicAssert.IsTrue(rec[1] is ContinueRecord);
- Assert.IsTrue(Arrays.Equals(data1, ((DrawingRecord)rec[0]).RecordData));
- Assert.IsTrue(Arrays.Equals(data2, ((ContinueRecord)rec[1]).Data));
+ ClassicAssert.IsTrue(Arrays.Equals(data1, ((DrawingRecord)rec[0]).RecordData));
+ ClassicAssert.IsTrue(Arrays.Equals(data2, ((ContinueRecord)rec[1]).Data));
}
diff --git a/testcases/main/HSSF/Record/TestEmbeddedObjectRefSubRecord.cs b/testcases/main/HSSF/Record/TestEmbeddedObjectRefSubRecord.cs
index 0651728a3..665fffddf 100644
--- a/testcases/main/HSSF/Record/TestEmbeddedObjectRefSubRecord.cs
+++ b/testcases/main/HSSF/Record/TestEmbeddedObjectRefSubRecord.cs
@@ -18,7 +18,7 @@ namespace TestCases.HSSF.Record
{
using System;
using NPOI.HSSF.Record;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.Util;
using System.IO;
@@ -52,11 +52,11 @@ public void TestStore()
EmbeddedObjectRefSubRecord record2 = new EmbeddedObjectRefSubRecord(in2, src.Length - 4);
ConfirmData(src, ser);
- Assert.AreEqual(record1.OLEClassName, record2.OLEClassName);
+ ClassicAssert.AreEqual(record1.OLEClassName, record2.OLEClassName);
byte[] ser2 = record1.Serialize();
- Assert.IsTrue(Arrays.Equals(ser, ser2));
+ ClassicAssert.IsTrue(Arrays.Equals(ser, ser2));
}
/**
* @param expectedData does not include sid & size
@@ -64,7 +64,7 @@ public void TestStore()
*/
private static void ConfirmData(byte[] expectedData, byte[] actualFullRecordData)
{
- Assert.AreEqual(expectedData.Length, actualFullRecordData.Length - 4);
+ ClassicAssert.AreEqual(expectedData.Length, actualFullRecordData.Length - 4);
for (int i = 0; i < expectedData.Length; i++)
{
if (expectedData[i] != actualFullRecordData[i + 4])
@@ -83,11 +83,11 @@ public void TestCreate()
in2.NextRecord();
EmbeddedObjectRefSubRecord record2 = new EmbeddedObjectRefSubRecord(in2, ser.Length - 4);
- Assert.AreEqual(record1.OLEClassName, record2.OLEClassName);
- Assert.AreEqual(record1.StreamId, record2.StreamId);
+ ClassicAssert.AreEqual(record1.OLEClassName, record2.OLEClassName);
+ ClassicAssert.AreEqual(record1.StreamId, record2.StreamId);
byte[] ser2 = record1.Serialize();
- Assert.IsTrue(Arrays.Equals(ser, ser2));
+ ClassicAssert.IsTrue(Arrays.Equals(ser, ser2));
}
diff --git a/testcases/main/HSSF/Record/TestEndSubRecord.cs b/testcases/main/HSSF/Record/TestEndSubRecord.cs
index fcd0e5c08..e4d696cac 100644
--- a/testcases/main/HSSF/Record/TestEndSubRecord.cs
+++ b/testcases/main/HSSF/Record/TestEndSubRecord.cs
@@ -23,7 +23,7 @@ namespace TestCases.HSSF.Record
using System;
using NPOI.HSSF.Record;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
* Tests the serialization and deserialization of the EndSubRecord
@@ -42,7 +42,7 @@ public void TestLoad()
{
EndSubRecord record = new EndSubRecord(TestcaseRecordInputStream.Create((short)0x00, data),data.Length);
- Assert.AreEqual(0, record.DataSize);
+ ClassicAssert.AreEqual(0, record.DataSize);
}
[Test]
public void TestStore()
@@ -50,9 +50,9 @@ public void TestStore()
EndSubRecord record = new EndSubRecord();
byte[] recordBytes = record.Serialize();
- Assert.AreEqual(recordBytes.Length - 4, data.Length);
+ ClassicAssert.AreEqual(recordBytes.Length - 4, data.Length);
for (int i = 0; i < data.Length; i++)
- Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
+ ClassicAssert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/Record/TestEscherAggregate.cs b/testcases/main/HSSF/Record/TestEscherAggregate.cs
index 7cbfbc3de..c982760aa 100644
--- a/testcases/main/HSSF/Record/TestEscherAggregate.cs
+++ b/testcases/main/HSSF/Record/TestEscherAggregate.cs
@@ -24,7 +24,7 @@ namespace TestCases.HSSF.Record
using NPOI.Util;
using NPOI.HSSF.Model;
using NPOI.HSSF.Record;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using System.Collections.Generic;
/**
@@ -84,9 +84,9 @@ public void TestCreateAggregate()
EscherAggregate aggregate = EscherAggregate.CreateAggregate(records, 0);
- Assert.AreEqual(1, aggregate.EscherRecords.Count);
- Assert.AreEqual(unchecked((short)0xF002), aggregate.GetEscherRecord(0).RecordId);
- Assert.AreEqual(2, aggregate.GetEscherRecord(0).ChildRecords.Count);
+ ClassicAssert.AreEqual(1, aggregate.EscherRecords.Count);
+ ClassicAssert.AreEqual(unchecked((short)0xF002), aggregate.GetEscherRecord(0).RecordId);
+ ClassicAssert.AreEqual(2, aggregate.GetEscherRecord(0).ChildRecords.Count);
// System.out.println( "aggregate = " + aggregate );
}
@@ -131,8 +131,8 @@ public void TestSerialize()
byte[] data = new byte[112];
int bytesWritten = aggregate.Serialize(0, data);
- Assert.AreEqual(112, bytesWritten);
- Assert.AreEqual("[EC, 00, 40, 00, 0F, 00, 00, 00, 58, 00, 00, 00, 0F, 00, 04, F0, 10, 00, 00, 00, 00, 00, 0A, F0, 08, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 0F, 00, 04, F0, 18, 00, 00, 00, 00, 00, 0A, F0, 08, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 11, F0, 00, 00, 00, 00, 5D, 00, 00, 00, EC, 00, 20, 00, 0F, 00, 04, F0, 18, 00, 00, 00, 00, 00, 0A, F0, 08, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 11, F0, 00, 00, 00, 00, 5D, 00, 00, 00]",
+ ClassicAssert.AreEqual(112, bytesWritten);
+ ClassicAssert.AreEqual("[EC, 00, 40, 00, 0F, 00, 00, 00, 58, 00, 00, 00, 0F, 00, 04, F0, 10, 00, 00, 00, 00, 00, 0A, F0, 08, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 0F, 00, 04, F0, 18, 00, 00, 00, 00, 00, 0A, F0, 08, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 11, F0, 00, 00, 00, 00, 5D, 00, 00, 00, EC, 00, 20, 00, 0F, 00, 04, F0, 18, 00, 00, 00, 00, 00, 0A, F0, 08, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 11, F0, 00, 00, 00, 00, 5D, 00, 00, 00]",
HexDump.ToHex(data));
}
diff --git a/testcases/main/HSSF/Record/TestExtSSTRecord.cs b/testcases/main/HSSF/Record/TestExtSSTRecord.cs
index 6ba87f5f5..0040364cc 100644
--- a/testcases/main/HSSF/Record/TestExtSSTRecord.cs
+++ b/testcases/main/HSSF/Record/TestExtSSTRecord.cs
@@ -21,7 +21,7 @@ namespace TestCases.HSSF.Record
{
using System;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.Util;
using TestCases.HSSF.Record;
using NPOI.HSSF.Record;
@@ -825,15 +825,15 @@ public class TestExtSSTRecord
*/
public static void AssertAreEqual(SSTRecord expected, SSTRecord actual)
{
- Assert.AreEqual(expected.NumStrings, actual.NumStrings, "number of strings");
- Assert.AreEqual(expected.NumUniqueStrings, actual.NumUniqueStrings, "number of unique strings");
- Assert.AreEqual(expected.CountStrings, actual.CountStrings, "count of strings");
+ ClassicAssert.AreEqual(expected.NumStrings, actual.NumStrings, "number of strings");
+ ClassicAssert.AreEqual(expected.NumUniqueStrings, actual.NumUniqueStrings, "number of unique strings");
+ ClassicAssert.AreEqual(expected.CountStrings, actual.CountStrings, "count of strings");
for (int k = 0; k < expected.CountStrings; k++)
{
UnicodeString us1 = expected.GetString(k);
UnicodeString us2 = actual.GetString(k);
- Assert.IsTrue(us1.Equals(us2), "String at idx=" + k);
+ ClassicAssert.IsTrue(us1.Equals(us2), "String at idx=" + k);
}
}
@@ -846,27 +846,27 @@ public void Test50967()
byte[] bytes = HexRead.ReadFromString(data_50967);
RecordInputStream in1 = TestcaseRecordInputStream.Create(bytes);
- Assert.AreEqual(ExtSSTRecord.sid, in1.Sid);
+ ClassicAssert.AreEqual(ExtSSTRecord.sid, in1.Sid);
ExtSSTRecord src = new ExtSSTRecord(in1);
- Assert.AreEqual(12386, src.DataSize);
+ ClassicAssert.AreEqual(12386, src.DataSize);
InfoSubRecord[] sub1 = src.InfoSubRecords;
byte[] Serialized = src.Serialize();
in1 = TestcaseRecordInputStream.Create(Serialized);
- Assert.AreEqual(ExtSSTRecord.sid, in1.Sid);
+ ClassicAssert.AreEqual(ExtSSTRecord.sid, in1.Sid);
ExtSSTRecord dst = new ExtSSTRecord(in1);
- Assert.AreEqual(12386, dst.DataSize);
+ ClassicAssert.AreEqual(12386, dst.DataSize);
InfoSubRecord[] sub2 = src.InfoSubRecords;
- Assert.AreEqual(sub1.Length, sub2.Length);
+ ClassicAssert.AreEqual(sub1.Length, sub2.Length);
for (int i = 0; i < sub1.Length; i++)
{
InfoSubRecord s1 = sub1[i];
InfoSubRecord s2 = sub2[i];
- Assert.AreEqual(s1.BucketSSTOffset, s2.BucketSSTOffset);
- Assert.AreEqual(s1.StreamPos, s2.StreamPos);
+ ClassicAssert.AreEqual(s1.BucketSSTOffset, s2.BucketSSTOffset);
+ ClassicAssert.AreEqual(s1.StreamPos, s2.StreamPos);
}
}
diff --git a/testcases/main/HSSF/Record/TestExtendedFormatRecord.cs b/testcases/main/HSSF/Record/TestExtendedFormatRecord.cs
index 21e6d062f..fa139ccf1 100644
--- a/testcases/main/HSSF/Record/TestExtendedFormatRecord.cs
+++ b/testcases/main/HSSF/Record/TestExtendedFormatRecord.cs
@@ -19,7 +19,7 @@ namespace TestCases.HSSF.Record
{
using System;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using TestCases.HSSF.Record;
using NPOI.HSSF.Record;
/**
@@ -48,17 +48,17 @@ private static ExtendedFormatRecord CreateEFR()
public void TestLoad()
{
ExtendedFormatRecord record = CreateEFR();
- Assert.AreEqual(0, record.FontIndex);
- Assert.AreEqual(0, record.FormatIndex);
- Assert.AreEqual(0xF5 - 256, record.CellOptions);
- Assert.AreEqual(0x20, record.AlignmentOptions);
- Assert.AreEqual(0, record.IndentionOptions);
- Assert.AreEqual(0, record.BorderOptions);
- Assert.AreEqual(0, record.PaletteOptions);
- Assert.AreEqual(0, record.AdtlPaletteOptions);
- Assert.AreEqual(0x20c0, record.FillPaletteOptions);
-
- Assert.AreEqual(20 + 4, record.RecordSize);
+ ClassicAssert.AreEqual(0, record.FontIndex);
+ ClassicAssert.AreEqual(0, record.FormatIndex);
+ ClassicAssert.AreEqual(0xF5 - 256, record.CellOptions);
+ ClassicAssert.AreEqual(0x20, record.AlignmentOptions);
+ ClassicAssert.AreEqual(0, record.IndentionOptions);
+ ClassicAssert.AreEqual(0, record.BorderOptions);
+ ClassicAssert.AreEqual(0, record.PaletteOptions);
+ ClassicAssert.AreEqual(0, record.AdtlPaletteOptions);
+ ClassicAssert.AreEqual(0x20c0, record.FillPaletteOptions);
+
+ ClassicAssert.AreEqual(20 + 4, record.RecordSize);
}
[Test]
@@ -122,9 +122,9 @@ public void TestStore()
record.FillBackground = (/*setter*/(short)0x41);
byte[] recordBytes = record.Serialize();
- Assert.AreEqual(recordBytes.Length - 4, data.Length);
+ ClassicAssert.AreEqual(recordBytes.Length - 4, data.Length);
for (int i = 0; i < data.Length; i++)
- Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
+ ClassicAssert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
}
[Test]
public void TestCloneOnto()
@@ -135,29 +135,29 @@ public void TestCloneOnto()
other.CloneStyleFrom(base1);
byte[] recordBytes = other.Serialize();
- Assert.AreEqual(recordBytes.Length - 4, data.Length);
+ ClassicAssert.AreEqual(recordBytes.Length - 4, data.Length);
for (int i = 0; i < data.Length; i++)
- Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
+ ClassicAssert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
}
[Test]
public void TestRotation()
{
ExtendedFormatRecord record = CreateEFR();
- Assert.AreEqual(0, record.Rotation);
+ ClassicAssert.AreEqual(0, record.Rotation);
record.Rotation = ((short)1);
- Assert.AreEqual(1, record.Rotation);
+ ClassicAssert.AreEqual(1, record.Rotation);
record.Rotation = ((short)89);
- Assert.AreEqual(89, record.Rotation);
+ ClassicAssert.AreEqual(89, record.Rotation);
record.Rotation = ((short)90);
- Assert.AreEqual(90, record.Rotation);
+ ClassicAssert.AreEqual(90, record.Rotation);
// internally values below zero are stored differently
record.Rotation = ((short)-1);
- Assert.AreEqual(255, record.Rotation);
+ ClassicAssert.AreEqual(255, record.Rotation);
record.Rotation = ((short)-89);
- Assert.AreEqual(-77, 90 - record.Rotation);
+ ClassicAssert.AreEqual(-77, 90 - record.Rotation);
record.Rotation = ((short)-90);
- Assert.AreEqual(-76, 90 - record.Rotation);
+ ClassicAssert.AreEqual(-76, 90 - record.Rotation);
}
}
diff --git a/testcases/main/HSSF/Record/TestExternalNameRecord.cs b/testcases/main/HSSF/Record/TestExternalNameRecord.cs
index 4f1725a38..18dab4467 100644
--- a/testcases/main/HSSF/Record/TestExternalNameRecord.cs
+++ b/testcases/main/HSSF/Record/TestExternalNameRecord.cs
@@ -19,7 +19,7 @@ namespace TestCases.HSSF.Record
{
using System;
using NPOI.HSSF.Record;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.Util;
/**
*
@@ -55,7 +55,7 @@ public void TestBasicDeserializeReserialize()
{
ExternalNameRecord enr = CreateSimpleENR(dataFDS);
- Assert.AreEqual("FDS", enr.Text);
+ ClassicAssert.AreEqual("FDS", enr.Text);
try
{
@@ -77,9 +77,9 @@ public void TestBasicSize()
{
throw new AssertionException("Identified bug 44695");
}
- Assert.AreEqual(17, enr.RecordSize);
+ ClassicAssert.AreEqual(17, enr.RecordSize);
- Assert.IsNotNull(enr.Serialize());
+ ClassicAssert.IsNotNull(enr.Serialize());
}
[Test]
public void TestAutoStdDocName()
@@ -98,14 +98,14 @@ public void TestAutoStdDocName()
}
throw e;
}
- Assert.AreEqual("'191219AW4 Corp,[WORKOUT_PX]'", enr.Text);
- Assert.IsTrue(enr.IsAutomaticLink);
- Assert.IsFalse(enr.IsBuiltInName);
- Assert.IsFalse(enr.IsIconifiedPictureLink);
+ ClassicAssert.AreEqual("'191219AW4 Corp,[WORKOUT_PX]'", enr.Text);
+ ClassicAssert.IsTrue(enr.IsAutomaticLink);
+ ClassicAssert.IsFalse(enr.IsBuiltInName);
+ ClassicAssert.IsFalse(enr.IsIconifiedPictureLink);
- Assert.IsFalse(enr.IsOLELink);
- Assert.IsFalse(enr.IsPicureLink);
- Assert.IsTrue(enr.IsStdDocumentNameIdentifier);
+ ClassicAssert.IsFalse(enr.IsOLELink);
+ ClassicAssert.IsFalse(enr.IsPicureLink);
+ ClassicAssert.IsTrue(enr.IsStdDocumentNameIdentifier);
TestcaseRecordInputStream.ConfirmRecordEncoding(0x0023, dataAutoDocName, enr.Serialize());
@@ -115,13 +115,13 @@ public void TestPlainName()
{
ExternalNameRecord enr = CreateSimpleENR(dataPlainName);
- Assert.AreEqual("Rate_Date", enr.Text);
- Assert.IsFalse(enr.IsAutomaticLink);
- Assert.IsFalse(enr.IsBuiltInName);
- Assert.IsFalse(enr.IsIconifiedPictureLink);
- Assert.IsFalse(enr.IsOLELink);
- Assert.IsFalse(enr.IsPicureLink);
- Assert.IsFalse(enr.IsStdDocumentNameIdentifier);
+ ClassicAssert.AreEqual("Rate_Date", enr.Text);
+ ClassicAssert.IsFalse(enr.IsAutomaticLink);
+ ClassicAssert.IsFalse(enr.IsBuiltInName);
+ ClassicAssert.IsFalse(enr.IsIconifiedPictureLink);
+ ClassicAssert.IsFalse(enr.IsOLELink);
+ ClassicAssert.IsFalse(enr.IsPicureLink);
+ ClassicAssert.IsFalse(enr.IsStdDocumentNameIdentifier);
TestcaseRecordInputStream.ConfirmRecordEncoding(0x0023, dataPlainName, enr.Serialize());
}
@@ -157,7 +157,7 @@ public void TestDDELink_bug47229()
}
throw e;
}
- Assert.AreEqual("010672AT0 MUNI,[RTG_MOODY_UNDERLYING,RTG_SP_UNDERLYING]", enr.Text);
+ ClassicAssert.AreEqual("010672AT0 MUNI,[RTG_MOODY_UNDERLYING,RTG_SP_UNDERLYING]", enr.Text);
TestcaseRecordInputStream.ConfirmRecordEncoding(0x0023, dataDDE, enr.Serialize());
}
@@ -186,7 +186,7 @@ public void TestUnicodeName_bug47384()
}
throw e;
}
- Assert.AreEqual("\u0159azen\u00ED_Billa", enr.Text);
+ ClassicAssert.AreEqual("\u0159azen\u00ED_Billa", enr.Text);
}
[Test]
@@ -201,7 +201,7 @@ public void TestNPEWithFileFrom49219()
ExternalNameRecord enr = CreateSimpleENR(data);
byte[] ser = enr.Serialize();
- Assert.AreEqual("[23, 00, 11, 00, 02, 7F, 00, 00, 00, 00, 09, 00, 52, 61, 74, 65, 5F, 44, 61, 74, 65]",
+ ClassicAssert.AreEqual("[23, 00, 11, 00, 02, 7F, 00, 00, 00, 00, 09, 00, 52, 61, 74, 65, 5F, 44, 61, 74, 65]",
HexDump.ToHex(ser));
}
diff --git a/testcases/main/HSSF/Record/TestFeatRecord.cs b/testcases/main/HSSF/Record/TestFeatRecord.cs
index 2e29a7965..fd66ecf09 100644
--- a/testcases/main/HSSF/Record/TestFeatRecord.cs
+++ b/testcases/main/HSSF/Record/TestFeatRecord.cs
@@ -18,7 +18,7 @@ limitations under the License.
namespace TestCases.HSSF.Record
{
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.Model;
using NPOI.HSSF.Record.Common;
using NPOI.HSSF.UserModel;
@@ -40,7 +40,7 @@ public void TestWithoutFeatRecord()
HSSFTestDataSamples.OpenSampleWorkbook("46136-WithWarnings.xls");
InternalWorkbook wb = HSSFTestHelper.GetWorkbookForTest(hssf);
- Assert.AreEqual(1, hssf.NumberOfSheets);
+ ClassicAssert.AreEqual(1, hssf.NumberOfSheets);
int countFR = 0;
int countFRH = 0;
@@ -66,8 +66,8 @@ public void TestWithoutFeatRecord()
}
}
- Assert.AreEqual(0, countFR);
- Assert.AreEqual(0, countFRH);
+ ClassicAssert.AreEqual(0, countFR);
+ ClassicAssert.AreEqual(0, countFRH);
// Now check on the sheet
HSSFSheet s = (HSSFSheet)hssf.GetSheetAt(0);
@@ -97,8 +97,8 @@ public void TestWithoutFeatRecord()
}
}
- Assert.AreEqual(0, countFR);
- Assert.AreEqual(0, countFRH);
+ ClassicAssert.AreEqual(0, countFR);
+ ClassicAssert.AreEqual(0, countFRH);
}
public void TestReadFeatRecord()
@@ -110,7 +110,7 @@ public void TestReadFeatRecord()
FeatRecord fr = null;
FeatHdrRecord fhr = null;
- Assert.AreEqual(1, hssf.NumberOfSheets);
+ ClassicAssert.AreEqual(1, hssf.NumberOfSheets);
// First check it isn't on the Workbook
int countFR = 0;
@@ -136,8 +136,8 @@ public void TestReadFeatRecord()
}
}
- Assert.AreEqual(0, countFR);
- Assert.AreEqual(0, countFRH);
+ ClassicAssert.AreEqual(0, countFR);
+ ClassicAssert.AreEqual(0, countFRH);
// Now find it on our sheet
HSSFSheet s = (HSSFSheet)hssf.GetSheetAt(0);
@@ -169,40 +169,40 @@ public void TestReadFeatRecord()
}
}
- Assert.AreEqual(1, countFR);
- Assert.AreEqual(1, countFRH);
- Assert.IsNotNull(fr);
- Assert.IsNotNull(fhr);
+ ClassicAssert.AreEqual(1, countFR);
+ ClassicAssert.AreEqual(1, countFRH);
+ ClassicAssert.IsNotNull(fr);
+ ClassicAssert.IsNotNull(fhr);
// Now check the contents are as expected
- Assert.AreEqual(
+ ClassicAssert.AreEqual(
FeatHdrRecord.SHAREDFEATURES_ISFFEC2,
fr.Isf_sharedFeatureType
);
// Applies to one cell only
- Assert.AreEqual(1, fr.CellRefs.Length);
- Assert.AreEqual(0, fr.CellRefs[0].FirstRow);
- Assert.AreEqual(0, fr.CellRefs[0].LastRow);
- Assert.AreEqual(0, fr.CellRefs[0].FirstColumn);
- Assert.AreEqual(0, fr.CellRefs[0].LastColumn);
+ ClassicAssert.AreEqual(1, fr.CellRefs.Length);
+ ClassicAssert.AreEqual(0, fr.CellRefs[0].FirstRow);
+ ClassicAssert.AreEqual(0, fr.CellRefs[0].LastRow);
+ ClassicAssert.AreEqual(0, fr.CellRefs[0].FirstColumn);
+ ClassicAssert.AreEqual(0, fr.CellRefs[0].LastColumn);
// More Checking of shared features stuff
- Assert.AreEqual(4, fr.CbFeatData);
- Assert.AreEqual(4, fr.SharedFeature.DataSize);
- Assert.AreEqual(typeof(FeatFormulaErr2), fr.SharedFeature.GetType());
+ ClassicAssert.AreEqual(4, fr.CbFeatData);
+ ClassicAssert.AreEqual(4, fr.SharedFeature.DataSize);
+ ClassicAssert.AreEqual(typeof(FeatFormulaErr2), fr.SharedFeature.GetType());
FeatFormulaErr2 fferr2 = (FeatFormulaErr2)fr.SharedFeature;
- Assert.AreEqual(0x04, fferr2.RawErrorCheckValue);
-
- Assert.IsFalse(fferr2.CheckCalculationErrors);
- Assert.IsFalse(fferr2.CheckDateTimeFormats);
- Assert.IsFalse(fferr2.CheckEmptyCellRef);
- Assert.IsFalse(fferr2.CheckInconsistentFormulas);
- Assert.IsFalse(fferr2.CheckInconsistentRanges);
- Assert.IsTrue(fferr2.CheckNumbersAsText);
- Assert.IsFalse(fferr2.CheckUnprotectedFormulas);
- Assert.IsFalse(fferr2.PerformDataValidation);
+ ClassicAssert.AreEqual(0x04, fferr2.RawErrorCheckValue);
+
+ ClassicAssert.IsFalse(fferr2.CheckCalculationErrors);
+ ClassicAssert.IsFalse(fferr2.CheckDateTimeFormats);
+ ClassicAssert.IsFalse(fferr2.CheckEmptyCellRef);
+ ClassicAssert.IsFalse(fferr2.CheckInconsistentFormulas);
+ ClassicAssert.IsFalse(fferr2.CheckInconsistentRanges);
+ ClassicAssert.IsTrue(fferr2.CheckNumbersAsText);
+ ClassicAssert.IsFalse(fferr2.CheckUnprotectedFormulas);
+ ClassicAssert.IsFalse(fferr2.PerformDataValidation);
}
/**
diff --git a/testcases/main/HSSF/Record/TestFontRecord.cs b/testcases/main/HSSF/Record/TestFontRecord.cs
index 7e774b1e0..6365720b9 100644
--- a/testcases/main/HSSF/Record/TestFontRecord.cs
+++ b/testcases/main/HSSF/Record/TestFontRecord.cs
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using System.Text;
-using NUnit.Framework;
+using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.Record;
using NPOI.Util;
using NPOI.SS.UserModel;
@@ -29,21 +29,21 @@ public void TestLoad()
{
FontRecord record = new FontRecord(TestcaseRecordInputStream.Create(0x31, data));
- Assert.AreEqual(0xc8, record.FontHeight);
- Assert.AreEqual(0x00, record.Attributes);
- Assert.IsFalse(record.IsItalic);
- Assert.IsFalse(record.IsStrikeout);
- Assert.IsFalse(record.IsMacoutlined);
- Assert.IsFalse(record.IsMacshadowed);
- Assert.AreEqual(0x7fff, record.ColorPaletteIndex);
- Assert.AreEqual(0x190, record.BoldWeight);
- Assert.AreEqual(FontSuperScript.None, record.SuperSubScript);
- Assert.AreEqual(FontUnderlineType.None, record.Underline);
- Assert.AreEqual(0x00, record.Family);
- Assert.AreEqual(0x00, record.Charset);
- Assert.AreEqual("Arial", record.FontName);
+ ClassicAssert.AreEqual(0xc8, record.FontHeight);
+ ClassicAssert.AreEqual(0x00, record.Attributes);
+ ClassicAssert.IsFalse(record.IsItalic);
+ ClassicAssert.IsFalse(record.IsStrikeout);
+ ClassicAssert.IsFalse(record.IsMacoutlined);
+ ClassicAssert.IsFalse(record.IsMacshadowed);
+ ClassicAssert.AreEqual(0x7fff, record.ColorPaletteIndex);
+ ClassicAssert.AreEqual(0x190, record.BoldWeight);
+ ClassicAssert.AreEqual(FontSuperScript.None, record.SuperSubScript);
+ ClassicAssert.AreEqual(FontUnderlineType.None, record.Underline);
+ ClassicAssert.AreEqual(0x00, record.Family);
+ ClassicAssert.AreEqual(0x00, record.Charset);
+ ClassicAssert.AreEqual("Arial", record.FontName);
- Assert.AreEqual(21 + 4, record.RecordSize);
+ ClassicAssert.AreEqual(21 + 4, record.RecordSize);
}
[Test]
public void TestStore()
@@ -86,9 +86,9 @@ public void TestCloneOnto()
other.CloneStyleFrom(base1);
byte[] recordBytes = other.Serialize();
- Assert.AreEqual(recordBytes.Length - 4, data.Length);
+ ClassicAssert.AreEqual(recordBytes.Length - 4, data.Length);
for (int i = 0; i < data.Length; i++)
- Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
+ ClassicAssert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
}
[Test]
public void TestSameProperties()
@@ -96,17 +96,17 @@ public void TestSameProperties()
FontRecord f1 = new FontRecord(TestcaseRecordInputStream.Create(0x31, data));
FontRecord f2 = new FontRecord(TestcaseRecordInputStream.Create(0x31, data));
- Assert.IsTrue(f1.SameProperties(f2));
+ ClassicAssert.IsTrue(f1.SameProperties(f2));
f2.FontName = ("Arial2");
- Assert.IsFalse(f1.SameProperties(f2));
+ ClassicAssert.IsFalse(f1.SameProperties(f2));
f2.FontName = ("Arial");
- Assert.IsTrue(f1.SameProperties(f2));
+ ClassicAssert.IsTrue(f1.SameProperties(f2));
f2.FontHeight = ((short)11);
- Assert.IsFalse(f1.SameProperties(f2));
+ ClassicAssert.IsFalse(f1.SameProperties(f2));
f2.FontHeight = ((short)0xc8);
- Assert.IsTrue(f1.SameProperties(f2));
+ ClassicAssert.IsTrue(f1.SameProperties(f2));
}
/**
@@ -129,9 +129,9 @@ public void TestEmptyName_bug47250()
{
throw new AssertionException("Identified bug 47250");
}
- Assert.AreEqual(0, in1.Available());
+ ClassicAssert.AreEqual(0, in1.Available());
- Assert.AreEqual(0, fr.FontName.Length);
+ ClassicAssert.AreEqual(0, fr.FontName.Length);
byte[] recordBytes = fr.Serialize();
TestcaseRecordInputStream.ConfirmRecordEncoding(SID, emptyNameData, recordBytes);
}
diff --git a/testcases/main/HSSF/Record/TestFormulaRecord.cs b/testcases/main/HSSF/Record/TestFormulaRecord.cs
index 03deb0191..75ee99f52 100644
--- a/testcases/main/HSSF/Record/TestFormulaRecord.cs
+++ b/testcases/main/HSSF/Record/TestFormulaRecord.cs
@@ -23,7 +23,7 @@ namespace TestCases.HSSF.Record
using System.IO;
using System.Collections;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.SS.Formula.PTG;
using NPOI.HSSF.UserModel;
using NPOI.SS.UserModel;
@@ -46,10 +46,10 @@ public void TestCreateFormulaRecord()
record.Row=(1);
record.XFIndex=((short)4);
- Assert.AreEqual(record.Column, (short)0);
- //Assert.AreEqual(record.Row,(short)1);
- Assert.AreEqual((short)record.Row, (short)1);
- Assert.AreEqual(record.XFIndex, (short)4);
+ ClassicAssert.AreEqual(record.Column, (short)0);
+ //ClassicAssert.AreEqual(record.Row,(short)1);
+ ClassicAssert.AreEqual((short)record.Row, (short)1);
+ ClassicAssert.AreEqual(record.XFIndex, (short)4);
}
/**
@@ -89,16 +89,16 @@ public void TestCheckNanPreserve()
};
FormulaRecord record = new FormulaRecord(TestcaseRecordInputStream.Create(FormulaRecord.sid, formulaByte));
- Assert.AreEqual(0, record.Row, "Row");
- Assert.AreEqual(0, record.Column, "Column");
- Assert.AreEqual(record.CachedResultType,NPOI.SS.UserModel.CellType.Error);
+ ClassicAssert.AreEqual(0, record.Row, "Row");
+ ClassicAssert.AreEqual(0, record.Column, "Column");
+ ClassicAssert.AreEqual(record.CachedResultType,NPOI.SS.UserModel.CellType.Error);
byte[] output = record.Serialize();
- Assert.AreEqual(33, output.Length, "Output size"); //includes sid+recordlength
+ ClassicAssert.AreEqual(33, output.Length, "Output size"); //includes sid+recordlength
for (int i = 5; i < 13; i++)
{
- Assert.AreEqual(formulaByte[i], output[i + 4], "FormulaByte NaN doesn't match");
+ ClassicAssert.AreEqual(formulaByte[i], output[i + 4], "FormulaByte NaN doesn't match");
}
}
@@ -118,11 +118,11 @@ public void TestExpFormula()
formulaByte[20] = (byte)0x05;
formulaByte[22] = (byte)0x01;
FormulaRecord record = new FormulaRecord(TestcaseRecordInputStream.Create(FormulaRecord.sid, formulaByte));
- Assert.AreEqual(0, record.Row, "Row");
- Assert.AreEqual(0, record.Column, "Column");
+ ClassicAssert.AreEqual(0, record.Row, "Row");
+ ClassicAssert.AreEqual(0, record.Column, "Column");
byte[] output = record.Serialize();
- Assert.AreEqual(31, output.Length, "Output size"); //includes sid+recordlength
- Assert.AreEqual(1, output[26], "OffSet 22");
+ ClassicAssert.AreEqual(31, output.Length, "Output size"); //includes sid+recordlength
+ ClassicAssert.AreEqual(1, output[26], "OffSet 22");
}
[Test]
public void TestWithConcat()
@@ -150,19 +150,19 @@ public void TestWithConcat()
FormulaRecord fr = new FormulaRecord(inp);
Ptg[] ptgs = fr.ParsedExpression;
- Assert.AreEqual(9, ptgs.Length);
- Assert.AreEqual(typeof(IntPtg), ptgs[0].GetType());
- Assert.AreEqual(typeof(AttrPtg), ptgs[1].GetType());
- Assert.AreEqual(typeof(RefPtg), ptgs[2].GetType());
- Assert.AreEqual(typeof(AttrPtg), ptgs[3].GetType());
- Assert.AreEqual(typeof(RefPtg), ptgs[4].GetType());
- Assert.AreEqual(typeof(AttrPtg), ptgs[5].GetType());
- Assert.AreEqual(typeof(RefPtg), ptgs[6].GetType());
- Assert.AreEqual(typeof(AttrPtg), ptgs[7].GetType());
- Assert.AreEqual(typeof(FuncVarPtg), ptgs[8].GetType());
+ ClassicAssert.AreEqual(9, ptgs.Length);
+ ClassicAssert.AreEqual(typeof(IntPtg), ptgs[0].GetType());
+ ClassicAssert.AreEqual(typeof(AttrPtg), ptgs[1].GetType());
+ ClassicAssert.AreEqual(typeof(RefPtg), ptgs[2].GetType());
+ ClassicAssert.AreEqual(typeof(AttrPtg), ptgs[3].GetType());
+ ClassicAssert.AreEqual(typeof(RefPtg), ptgs[4].GetType());
+ ClassicAssert.AreEqual(typeof(AttrPtg), ptgs[5].GetType());
+ ClassicAssert.AreEqual(typeof(RefPtg), ptgs[6].GetType());
+ ClassicAssert.AreEqual(typeof(AttrPtg), ptgs[7].GetType());
+ ClassicAssert.AreEqual(typeof(FuncVarPtg), ptgs[8].GetType());
FuncVarPtg choose = (FuncVarPtg)ptgs[8];
- Assert.AreEqual("CHOOSE", choose.Name);
+ ClassicAssert.AreEqual("CHOOSE", choose.Name);
}
[Test]
public void TestReSerialize()
@@ -173,15 +173,15 @@ public void TestReSerialize()
formulaRecord.ParsedExpression = (/*setter*/new Ptg[] { new RefPtg("B$5"), });
formulaRecord.Value = (/*setter*/3.3);
byte[] ser = formulaRecord.Serialize();
- Assert.AreEqual(31, ser.Length);
+ ClassicAssert.AreEqual(31, ser.Length);
RecordInputStream in1 = TestcaseRecordInputStream.Create(ser);
FormulaRecord fr2 = new FormulaRecord(in1);
- Assert.AreEqual(3.3, fr2.Value, 0.0);
+ ClassicAssert.AreEqual(3.3, fr2.Value, 0.0);
Ptg[] ptgs = fr2.ParsedExpression;
- Assert.AreEqual(1, ptgs.Length);
+ ClassicAssert.AreEqual(1, ptgs.Length);
RefPtg rp = (RefPtg)ptgs[0];
- Assert.AreEqual("B$5", rp.ToFormulaString());
+ ClassicAssert.AreEqual("B$5", rp.ToFormulaString());
}
/**
@@ -195,9 +195,9 @@ public void TestCachedValue_bug46479()
FormulaRecord fr1 = new FormulaRecord();
// Test some other cached value types
fr0.Value = (/*setter*/3.5);
- Assert.AreEqual(3.5, fr0.Value, 0.0);
+ ClassicAssert.AreEqual(3.5, fr0.Value, 0.0);
fr0.SetCachedResultErrorCode (FormulaError.REF.Code);
- Assert.AreEqual(FormulaError.REF.Code, fr0.CachedErrorValue);
+ ClassicAssert.AreEqual(FormulaError.REF.Code, fr0.CachedErrorValue);
fr0.SetCachedResultBoolean(false);
fr1.SetCachedResultBoolean(true);
@@ -205,8 +205,8 @@ public void TestCachedValue_bug46479()
{
throw new AssertionException("Identified bug 46479c");
}
- Assert.AreEqual(false, fr0.CachedBooleanValue);
- Assert.AreEqual(true, fr1.CachedBooleanValue);
+ ClassicAssert.AreEqual(false, fr0.CachedBooleanValue);
+ ClassicAssert.AreEqual(true, fr1.CachedBooleanValue);
}
}
}
diff --git a/testcases/main/HSSF/Record/TestFtCblsSubRecord.cs b/testcases/main/HSSF/Record/TestFtCblsSubRecord.cs
index b17285a6d..f3886c72f 100644
--- a/testcases/main/HSSF/Record/TestFtCblsSubRecord.cs
+++ b/testcases/main/HSSF/Record/TestFtCblsSubRecord.cs
@@ -20,7 +20,7 @@ namespace TestCases.HSSF.Record
using System;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using TestCases.HSSF.Record;
using NPOI.Util;
using NPOI.HSSF.Record;
@@ -46,18 +46,18 @@ public void TestRead()
FtCblsSubRecord record = new FtCblsSubRecord(TestcaseRecordInputStream.Create(FtCblsSubRecord.sid, data), data.Length);
- Assert.AreEqual(FtCblsSubRecord.sid, record.Sid);
- Assert.AreEqual(data.Length, record.DataSize);
+ ClassicAssert.AreEqual(FtCblsSubRecord.sid, record.Sid);
+ ClassicAssert.AreEqual(data.Length, record.DataSize);
}
[Test]
public void TestWrite()
{
FtCblsSubRecord record = new FtCblsSubRecord();
- Assert.AreEqual(FtCblsSubRecord.sid, record.Sid);
- Assert.AreEqual(data.Length, record.DataSize);
+ ClassicAssert.AreEqual(FtCblsSubRecord.sid, record.Sid);
+ ClassicAssert.AreEqual(data.Length, record.DataSize);
byte[] ser = record.Serialize();
- Assert.AreEqual(ser.Length - 4, data.Length);
+ ClassicAssert.AreEqual(ser.Length - 4, data.Length);
}
[Test]
@@ -69,8 +69,8 @@ public void TestClone()
FtCblsSubRecord Cloned = (FtCblsSubRecord)record.Clone();
byte[] cln = Cloned.Serialize();
- Assert.AreEqual(record.DataSize, Cloned.DataSize);
- Assert.IsTrue(Arrays.Equals(src, cln));
+ ClassicAssert.AreEqual(record.DataSize, Cloned.DataSize);
+ ClassicAssert.IsTrue(Arrays.Equals(src, cln));
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/Record/TestHyperlinkRecord.cs b/testcases/main/HSSF/Record/TestHyperlinkRecord.cs
index 0e31b5c5b..6137fa725 100644
--- a/testcases/main/HSSF/Record/TestHyperlinkRecord.cs
+++ b/testcases/main/HSSF/Record/TestHyperlinkRecord.cs
@@ -25,7 +25,7 @@ namespace TestCases.HSSF.Record
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
* Test HyperlinkRecord
@@ -273,7 +273,7 @@ public void InitializeCultere()
private void ConfirmGUID(GUID expectedGuid, GUID actualGuid)
{
- Assert.AreEqual(expectedGuid, actualGuid);
+ ClassicAssert.AreEqual(expectedGuid, actualGuid);
}
[Test]
@@ -281,77 +281,77 @@ public void TestReadURLLink()
{
RecordInputStream is1 = TestcaseRecordInputStream.Create(HyperlinkRecord.sid, data1);
HyperlinkRecord link = new HyperlinkRecord(is1);
- Assert.AreEqual(2, link.FirstRow);
- Assert.AreEqual(2, link.LastRow);
- Assert.AreEqual(0, link.FirstColumn);
- Assert.AreEqual(0, link.LastColumn);
+ ClassicAssert.AreEqual(2, link.FirstRow);
+ ClassicAssert.AreEqual(2, link.LastRow);
+ ClassicAssert.AreEqual(0, link.FirstColumn);
+ ClassicAssert.AreEqual(0, link.LastColumn);
ConfirmGUID(HyperlinkRecord.STD_MONIKER, link.Guid);
ConfirmGUID(HyperlinkRecord.URL_MONIKER, link.Moniker);
- Assert.AreEqual(2, link.LabelOptions);
+ ClassicAssert.AreEqual(2, link.LabelOptions);
int opts = HyperlinkRecord.HLINK_URL | HyperlinkRecord.HLINK_ABS | HyperlinkRecord.HLINK_LABEL;
- Assert.AreEqual(0x17, opts);
- Assert.AreEqual(opts, link.LinkOptions);
- Assert.AreEqual(0, link.FileOptions);
+ ClassicAssert.AreEqual(0x17, opts);
+ ClassicAssert.AreEqual(opts, link.LinkOptions);
+ ClassicAssert.AreEqual(0, link.FileOptions);
- Assert.AreEqual("My Link", link.Label);
- Assert.AreEqual("http://www.lakings.com/", link.Address);
+ ClassicAssert.AreEqual("My Link", link.Label);
+ ClassicAssert.AreEqual("http://www.lakings.com/", link.Address);
}
[Test]
public void TestReadFileLink()
{
RecordInputStream is1 = TestcaseRecordInputStream.Create((short)HyperlinkRecord.sid, data2);
HyperlinkRecord link = new HyperlinkRecord(is1);
- Assert.AreEqual(0, link.FirstRow);
- Assert.AreEqual(0, link.LastRow);
- Assert.AreEqual(0, link.FirstColumn);
- Assert.AreEqual(0, link.LastColumn);
+ ClassicAssert.AreEqual(0, link.FirstRow);
+ ClassicAssert.AreEqual(0, link.LastRow);
+ ClassicAssert.AreEqual(0, link.FirstColumn);
+ ClassicAssert.AreEqual(0, link.LastColumn);
ConfirmGUID(HyperlinkRecord.STD_MONIKER, link.Guid);
ConfirmGUID(HyperlinkRecord.FILE_MONIKER, link.Moniker);
- Assert.AreEqual(2, link.LabelOptions);
+ ClassicAssert.AreEqual(2, link.LabelOptions);
int opts = HyperlinkRecord.HLINK_URL | HyperlinkRecord.HLINK_LABEL;
- Assert.AreEqual(0x15, opts);
- Assert.AreEqual(opts, link.LinkOptions);
+ ClassicAssert.AreEqual(0x15, opts);
+ ClassicAssert.AreEqual(opts, link.LinkOptions);
- Assert.AreEqual("file", link.Label);
- Assert.AreEqual("link1.xls", link.ShortFilename);
+ ClassicAssert.AreEqual("file", link.Label);
+ ClassicAssert.AreEqual("link1.xls", link.ShortFilename);
}
[Test]
public void TestReadEmailLink()
{
RecordInputStream is1 = TestcaseRecordInputStream.Create((short)HyperlinkRecord.sid, data3);
HyperlinkRecord link = new HyperlinkRecord(is1);
- Assert.AreEqual(1, link.FirstRow);
- Assert.AreEqual(1, link.LastRow);
- Assert.AreEqual(0, link.FirstColumn);
- Assert.AreEqual(0, link.LastColumn);
+ ClassicAssert.AreEqual(1, link.FirstRow);
+ ClassicAssert.AreEqual(1, link.LastRow);
+ ClassicAssert.AreEqual(0, link.FirstColumn);
+ ClassicAssert.AreEqual(0, link.LastColumn);
ConfirmGUID(HyperlinkRecord.STD_MONIKER, link.Guid);
ConfirmGUID(HyperlinkRecord.URL_MONIKER, link.Moniker);
- Assert.AreEqual(2, link.LabelOptions);
+ ClassicAssert.AreEqual(2, link.LabelOptions);
int opts = HyperlinkRecord.HLINK_URL | HyperlinkRecord.HLINK_ABS | HyperlinkRecord.HLINK_LABEL;
- Assert.AreEqual(0x17, opts);
- Assert.AreEqual(opts, link.LinkOptions);
+ ClassicAssert.AreEqual(0x17, opts);
+ ClassicAssert.AreEqual(opts, link.LinkOptions);
- Assert.AreEqual("email", link.Label);
- Assert.AreEqual("mailto:ebgans@mail.ru?subject=Hello,%20Ebgans!", link.Address);
+ ClassicAssert.AreEqual("email", link.Label);
+ ClassicAssert.AreEqual("mailto:ebgans@mail.ru?subject=Hello,%20Ebgans!", link.Address);
}
[Test]
public void TestReadDocumentLink()
{
RecordInputStream is1 = TestcaseRecordInputStream.Create(HyperlinkRecord.sid, data4);
HyperlinkRecord link = new HyperlinkRecord(is1);
- Assert.AreEqual(3, link.FirstRow);
- Assert.AreEqual(3, link.LastRow);
- Assert.AreEqual(0, link.FirstColumn);
- Assert.AreEqual(0, link.LastColumn);
+ ClassicAssert.AreEqual(3, link.FirstRow);
+ ClassicAssert.AreEqual(3, link.LastRow);
+ ClassicAssert.AreEqual(0, link.FirstColumn);
+ ClassicAssert.AreEqual(0, link.LastColumn);
ConfirmGUID(HyperlinkRecord.STD_MONIKER, link.Guid);
- Assert.AreEqual(2, link.LabelOptions);
+ ClassicAssert.AreEqual(2, link.LabelOptions);
int opts = HyperlinkRecord.HLINK_LABEL | HyperlinkRecord.HLINK_PLACE;
- Assert.AreEqual(0x1C, opts);
- Assert.AreEqual(opts, link.LinkOptions);
+ ClassicAssert.AreEqual(0x1C, opts);
+ ClassicAssert.AreEqual(opts, link.LinkOptions);
- Assert.AreEqual("place", link.Label);
- Assert.AreEqual("Sheet1!A1", link.TextMark);
- Assert.AreEqual("Sheet1!A1", link.Address);
+ ClassicAssert.AreEqual("place", link.Label);
+ ClassicAssert.AreEqual("Sheet1!A1", link.TextMark);
+ ClassicAssert.AreEqual("Sheet1!A1", link.Address);
}
private void Serialize(byte[] data)
{
@@ -361,8 +361,8 @@ private void Serialize(byte[] data)
is1 = TestcaseRecordInputStream.Create(bytes1);
link = new HyperlinkRecord(is1);
byte[] bytes2 = link.Serialize();
- Assert.AreEqual(bytes1.Length, bytes2.Length);
- Assert.IsTrue(Arrays.Equals(bytes1, bytes2));
+ ClassicAssert.AreEqual(bytes1.Length, bytes2.Length);
+ ClassicAssert.IsTrue(Arrays.Equals(bytes1, bytes2));
}
[Test]
public void TestSerialize()
@@ -385,8 +385,8 @@ public void TestCreateURLRecord()
byte[] tmp = link.Serialize();
byte[] ser = new byte[tmp.Length - 4];
Array.Copy(tmp, 4, ser, 0, ser.Length);
- Assert.AreEqual(data1.Length, ser.Length);
- Assert.IsTrue(Arrays.Equals(data1, ser));
+ ClassicAssert.AreEqual(data1.Length, ser.Length);
+ ClassicAssert.IsTrue(Arrays.Equals(data1, ser));
}
[Test]
public void TestCreateFileRecord()
@@ -401,8 +401,8 @@ public void TestCreateFileRecord()
byte[] tmp = link.Serialize();
byte[] ser = new byte[tmp.Length - 4];
Array.Copy(tmp, 4, ser, 0, ser.Length);
- Assert.AreEqual(data2.Length, ser.Length);
- Assert.IsTrue(Arrays.Equals(data2, ser));
+ ClassicAssert.AreEqual(data2.Length, ser.Length);
+ ClassicAssert.IsTrue(Arrays.Equals(data2, ser));
}
[Test]
public void TestCreateDocumentRecord()
@@ -417,8 +417,8 @@ public void TestCreateDocumentRecord()
byte[] tmp = link.Serialize();
byte[] ser = new byte[tmp.Length - 4];
Array.Copy(tmp, 4, ser, 0, ser.Length);
- //Assert.AreEqual(data4.Length, ser.Length);
- Assert.IsTrue(Arrays.Equals(data4, ser));
+ //ClassicAssert.AreEqual(data4.Length, ser.Length);
+ ClassicAssert.IsTrue(Arrays.Equals(data4, ser));
}
[Test]
public void TestCreateEmailtRecord()
@@ -433,8 +433,8 @@ public void TestCreateEmailtRecord()
byte[] tmp = link.Serialize();
byte[] ser = new byte[tmp.Length - 4];
Array.Copy(tmp, 4, ser, 0, ser.Length);
- Assert.AreEqual(data3.Length, ser.Length);
- Assert.IsTrue(Arrays.Equals(data3, ser));
+ ClassicAssert.AreEqual(data3.Length, ser.Length);
+ ClassicAssert.IsTrue(Arrays.Equals(data3, ser));
}
[Test]
public void TestClone()
@@ -445,7 +445,7 @@ public void TestClone()
RecordInputStream is1 = TestcaseRecordInputStream.Create(HyperlinkRecord.sid, data[i]);
HyperlinkRecord link = new HyperlinkRecord(is1);
HyperlinkRecord clone = (HyperlinkRecord)link.Clone();
- Assert.IsTrue(Arrays.Equals(link.Serialize(), clone.Serialize()));
+ ClassicAssert.IsTrue(Arrays.Equals(link.Serialize(), clone.Serialize()));
}
}
@@ -471,8 +471,8 @@ public void TestReserializeLinkToWorkbook()
{
throw new AssertionException("Identified bug in reading workbook link");
}
- Assert.AreNotEqual("YEARFR~1.XLS", hr.Address, "Identified bug in reading workbook link");
- Assert.AreEqual("yearfracExamples.xls", hr.Address);
+ ClassicAssert.AreNotEqual("YEARFR~1.XLS", hr.Address, "Identified bug in reading workbook link");
+ ClassicAssert.AreEqual("yearfracExamples.xls", hr.Address);
}
[Test]
public void TestReserializeUNC()
@@ -497,26 +497,26 @@ public void TestGUID()
GUID g;
g = GUID.Parse("3F2504E0-4F89-11D3-9A0C-0305E82C3301");
ConfirmGUID(g, 0x3F2504E0, 0x4F89, 0x11D3, unchecked((long)0x9A0C0305E82C3301L));
- Assert.AreEqual("3F2504E0-4F89-11D3-9A0C-0305E82C3301", g.FormatAsString());
+ ClassicAssert.AreEqual("3F2504E0-4F89-11D3-9A0C-0305E82C3301", g.FormatAsString());
g = GUID.Parse("13579BDF-0246-8ACE-0123-456789ABCDEF");
ConfirmGUID(g, 0x13579BDF, 0x0246, 0x8ACE, unchecked((long)0x0123456789ABCDEFL));
- Assert.AreEqual("13579BDF-0246-8ACE-0123-456789ABCDEF", g.FormatAsString());
+ ClassicAssert.AreEqual("13579BDF-0246-8ACE-0123-456789ABCDEF", g.FormatAsString());
byte[] buf = new byte[16];
g.Serialize(new LittleEndianByteArrayOutputStream(buf, 0));
String expectedDump = "[DF, 9B, 57, 13, 46, 02, CE, 8A, 01, 23, 45, 67, 89, AB, CD, EF]";
- Assert.AreEqual(expectedDump, HexDump.ToHex(buf));
+ ClassicAssert.AreEqual(expectedDump, HexDump.ToHex(buf));
// STD Moniker
g = CreateFromStreamDump("[D0, C9, EA, 79, F9, BA, CE, 11, 8C, 82, 00, AA, 00, 4B, A9, 0B]");
- Assert.AreEqual("79EAC9D0-BAF9-11CE-8C82-00AA004BA90B", g.FormatAsString());
+ ClassicAssert.AreEqual("79EAC9D0-BAF9-11CE-8C82-00AA004BA90B", g.FormatAsString());
// URL Moniker
g = CreateFromStreamDump("[E0, C9, EA, 79, F9, BA, CE, 11, 8C, 82, 00, AA, 00, 4B, A9, 0B]");
- Assert.AreEqual("79EAC9E0-BAF9-11CE-8C82-00AA004BA90B", g.FormatAsString());
+ ClassicAssert.AreEqual("79EAC9E0-BAF9-11CE-8C82-00AA004BA90B", g.FormatAsString());
// File Moniker
g = CreateFromStreamDump("[03, 03, 00, 00, 00, 00, 00, 00, C0, 00, 00, 00, 00, 00, 00, 46]");
- Assert.AreEqual("00000303-0000-0000-C000-000000000046", g.FormatAsString());
+ ClassicAssert.AreEqual("00000303-0000-0000-C000-000000000046", g.FormatAsString());
}
private static GUID CreateFromStreamDump(String s)
@@ -526,29 +526,29 @@ private static GUID CreateFromStreamDump(String s)
private void ConfirmGUID(GUID g, int d1, int d2, int d3, long d4)
{
- Assert.AreEqual(new String(HexDump.IntToHex(d1)), new String(HexDump.IntToHex(g.D1)));
- Assert.AreEqual(new String(HexDump.ShortToHex(d2)), new String(HexDump.ShortToHex(g.D2)));
- Assert.AreEqual(new String(HexDump.ShortToHex(d3)), new String(HexDump.ShortToHex(g.D3)));
- Assert.AreEqual(new String(HexDump.LongToHex(d4)), new String(HexDump.LongToHex(g.D4)));
+ ClassicAssert.AreEqual(new String(HexDump.IntToHex(d1)), new String(HexDump.IntToHex(g.D1)));
+ ClassicAssert.AreEqual(new String(HexDump.ShortToHex(d2)), new String(HexDump.ShortToHex(g.D2)));
+ ClassicAssert.AreEqual(new String(HexDump.ShortToHex(d3)), new String(HexDump.ShortToHex(g.D3)));
+ ClassicAssert.AreEqual(new String(HexDump.LongToHex(d4)), new String(HexDump.LongToHex(g.D4)));
}
[Test]
public void Test47498()
{
RecordInputStream is1 = TestcaseRecordInputStream.Create(HyperlinkRecord.sid, data_47498);
HyperlinkRecord link = new HyperlinkRecord(is1);
- Assert.AreEqual(2, link.FirstRow);
- Assert.AreEqual(2, link.LastRow);
- Assert.AreEqual(0, link.FirstColumn);
- Assert.AreEqual(0, link.LastColumn);
+ ClassicAssert.AreEqual(2, link.FirstRow);
+ ClassicAssert.AreEqual(2, link.LastRow);
+ ClassicAssert.AreEqual(0, link.FirstColumn);
+ ClassicAssert.AreEqual(0, link.LastColumn);
ConfirmGUID(HyperlinkRecord.STD_MONIKER, link.Guid);
ConfirmGUID(HyperlinkRecord.URL_MONIKER, link.Moniker);
- Assert.AreEqual(2, link.LabelOptions);
+ ClassicAssert.AreEqual(2, link.LabelOptions);
int opts = HyperlinkRecord.HLINK_URL | HyperlinkRecord.HLINK_LABEL;
- Assert.AreEqual(opts, link.LinkOptions);
- Assert.AreEqual(0, link.FileOptions);
+ ClassicAssert.AreEqual(opts, link.LinkOptions);
+ ClassicAssert.AreEqual(0, link.FileOptions);
- Assert.AreEqual("PDF", link.Label);
- Assert.AreEqual("testfolder/test.PDF", link.Address);
+ ClassicAssert.AreEqual("PDF", link.Label);
+ ClassicAssert.AreEqual("testfolder/test.PDF", link.Address);
byte[] ser = link.Serialize();
TestcaseRecordInputStream.ConfirmRecordEncoding(HyperlinkRecord.sid, data_47498, ser);
diff --git a/testcases/main/HSSF/Record/TestInterfaceEndRecord.cs b/testcases/main/HSSF/Record/TestInterfaceEndRecord.cs
index 7eef9954c..61c364e63 100644
--- a/testcases/main/HSSF/Record/TestInterfaceEndRecord.cs
+++ b/testcases/main/HSSF/Record/TestInterfaceEndRecord.cs
@@ -20,7 +20,7 @@ namespace TestCases.HSSF.Record
using System;
using System.Collections.Generic;
using System.IO;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.Util;
using NPOI.HSSF.Record;
@@ -40,7 +40,7 @@ public class TestInterfaceEndRecord
public void TestCreate()
{
InterfaceEndRecord record = InterfaceEndRecord.Instance;
- Assert.AreEqual(0, record.GetDataSize());
+ ClassicAssert.AreEqual(0, record.GetDataSize());
}
/**
@@ -57,11 +57,11 @@ public void TestUnexpectedBytes_bug47251()
"0A 00 00 00"; // EOF
byte[] data = HexRead.ReadFromString(hex);
List records = RecordFactory.CreateRecords(new MemoryStream(data));
- Assert.AreEqual(3, records.Count);
+ ClassicAssert.AreEqual(3, records.Count);
Record rec1 = records[(1)];
- Assert.AreEqual(typeof(InterfaceHdrRecord), rec1.GetType());
+ ClassicAssert.AreEqual(typeof(InterfaceHdrRecord), rec1.GetType());
InterfaceHdrRecord r = (InterfaceHdrRecord)rec1;
- Assert.AreEqual("[E1, 00, 02, 00, B0, 04]", HexDump.ToHex(r.Serialize()));
+ ClassicAssert.AreEqual("[E1, 00, 02, 00, B0, 04]", HexDump.ToHex(r.Serialize()));
}
}
diff --git a/testcases/main/HSSF/Record/TestLabelRecord.cs b/testcases/main/HSSF/Record/TestLabelRecord.cs
index ce0849b75..cddecd717 100644
--- a/testcases/main/HSSF/Record/TestLabelRecord.cs
+++ b/testcases/main/HSSF/Record/TestLabelRecord.cs
@@ -22,7 +22,7 @@ namespace TestCases.HSSF.Record
using TestCases.HSSF;
using NPOI.HSSF.UserModel;
using NPOI.HSSF.Record;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
* Tests for LabelRecord
*
diff --git a/testcases/main/HSSF/Record/TestLbsDataSubRecord.cs b/testcases/main/HSSF/Record/TestLbsDataSubRecord.cs
index d95f03fa0..0701faf75 100644
--- a/testcases/main/HSSF/Record/TestLbsDataSubRecord.cs
+++ b/testcases/main/HSSF/Record/TestLbsDataSubRecord.cs
@@ -18,7 +18,7 @@ limitations under the License.
namespace TestCases.HSSF.Record
{
using System.IO;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.SS.Formula.PTG;
using NPOI.SS.Util;
using NPOI.Util;
@@ -53,17 +53,17 @@ public void Test_47701()
RecordInputStream in1 = TestcaseRecordInputStream.Create(ObjRecord.sid, data);
// check read OK
ObjRecord record = new ObjRecord(in1);
- Assert.AreEqual(3, record.SubRecords.Count);
+ ClassicAssert.AreEqual(3, record.SubRecords.Count);
SubRecord sr = record.SubRecords[(2)];
- Assert.IsTrue(sr is LbsDataSubRecord);
+ ClassicAssert.IsTrue(sr is LbsDataSubRecord);
LbsDataSubRecord lbs = (LbsDataSubRecord)sr;
- Assert.AreEqual(4, lbs.NumberOfItems);
+ ClassicAssert.AreEqual(4, lbs.NumberOfItems);
- Assert.IsTrue(lbs.Formula is AreaPtg);
+ ClassicAssert.IsTrue(lbs.Formula is AreaPtg);
AreaPtg ptg = (AreaPtg)lbs.Formula;
CellRangeAddress range = new CellRangeAddress(
ptg.FirstRow, ptg.LastRow, ptg.FirstColumn, ptg.LastColumn);
- Assert.AreEqual("H10:H13", range.FormatAsString());
+ ClassicAssert.AreEqual("H10:H13", range.FormatAsString());
// check that it re-Serializes to the same data
byte[] ser = record.Serialize();
@@ -99,10 +99,10 @@ public void Test_45778()
ObjRecord record = new ObjRecord(in1);
SubRecord sr = record.SubRecords[(2)];
- Assert.IsTrue(sr is LbsDataSubRecord);
+ ClassicAssert.IsTrue(sr is LbsDataSubRecord);
LbsDataSubRecord lbs = (LbsDataSubRecord)sr;
- Assert.AreEqual(8, lbs.NumberOfItems);
- Assert.IsNull(lbs.Formula);
+ ClassicAssert.AreEqual(8, lbs.NumberOfItems);
+ ClassicAssert.IsNull(lbs.Formula);
// check that it re-Serializes to the same data
byte[] ser = record.Serialize();
@@ -139,14 +139,14 @@ public void Test_Remove_padding()
// check that it re-Serializes to the same data
byte[] ser = record.Serialize();
- Assert.AreEqual(data.Length - 5, ser.Length);
- for (int i = 0; i < ser.Length; i++) Assert.AreEqual(data[i], ser[i]);
+ ClassicAssert.AreEqual(data.Length - 5, ser.Length);
+ for (int i = 0; i < ser.Length; i++) ClassicAssert.AreEqual(data[i], ser[i]);
//check we can read the Trimmed record
RecordInputStream in2 = TestcaseRecordInputStream.Create(ser);
ObjRecord record2 = new ObjRecord(in2);
byte[] ser2 = record2.Serialize();
- Assert.IsTrue(Arrays.Equals(ser, ser2));
+ ClassicAssert.IsTrue(Arrays.Equals(ser, ser2));
}
[Test]
public void Test_LbsDropData()
@@ -167,7 +167,7 @@ public void Test_LbsDropData()
MemoryStream baos = new MemoryStream();
lbs.Serialize(new LittleEndianOutputStream(baos));
- Assert.IsTrue(Arrays.Equals(data, baos.ToArray()));
+ ClassicAssert.IsTrue(Arrays.Equals(data, baos.ToArray()));
}
}
diff --git a/testcases/main/HSSF/Record/TestMergeCellsRecord.cs b/testcases/main/HSSF/Record/TestMergeCellsRecord.cs
index a74f440e9..9dc5bd6f5 100644
--- a/testcases/main/HSSF/Record/TestMergeCellsRecord.cs
+++ b/testcases/main/HSSF/Record/TestMergeCellsRecord.cs
@@ -22,7 +22,7 @@ namespace TestCases.HSSF.Record
using System;
using NPOI.HSSF.Record;
using NPOI.SS.Util;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.Record.Aggregates;
using System.Collections;
using NPOI.HSSF.Model;
@@ -47,22 +47,22 @@ public void TestCloneReferences()
MergeCellsRecord merge = new MergeCellsRecord(cras, 0, cras.Length);
MergeCellsRecord clone = (MergeCellsRecord)merge.Clone();
- Assert.AreNotSame(merge, clone, "Merged and cloned objects are the same");
+ ClassicAssert.AreNotSame(merge, clone, "Merged and cloned objects are the same");
CellRangeAddress mergeRegion = merge.GetAreaAt(0);
CellRangeAddress cloneRegion = clone.GetAreaAt(0);
- Assert.AreNotSame(mergeRegion, cloneRegion,
+ ClassicAssert.AreNotSame(mergeRegion, cloneRegion,
"Should not point to same objects when cloning");
- Assert.AreEqual(mergeRegion.FirstRow, cloneRegion.FirstRow,
+ ClassicAssert.AreEqual(mergeRegion.FirstRow, cloneRegion.FirstRow,
"New Clone Row From doesnt match");
- Assert.AreEqual(mergeRegion.LastRow, cloneRegion.LastRow,
+ ClassicAssert.AreEqual(mergeRegion.LastRow, cloneRegion.LastRow,
"New Clone Row To doesnt match");
- Assert.AreEqual(mergeRegion.FirstColumn, cloneRegion.FirstColumn,
+ ClassicAssert.AreEqual(mergeRegion.FirstColumn, cloneRegion.FirstColumn,
"New Clone Col From doesnt match");
- Assert.AreEqual(mergeRegion.LastColumn, cloneRegion.LastColumn,
+ ClassicAssert.AreEqual(mergeRegion.LastColumn, cloneRegion.LastColumn,
"New Clone Col To doesnt match");
- Assert.IsFalse(merge.GetAreaAt(0) == clone.GetAreaAt(0));
+ ClassicAssert.IsFalse(merge.GetAreaAt(0) == clone.GetAreaAt(0));
}
[Test]
public void testMCTable_bug46009()
diff --git a/testcases/main/HSSF/Record/TestNameCommentRecord.cs b/testcases/main/HSSF/Record/TestNameCommentRecord.cs
index 031279ffd..2b6af9415 100644
--- a/testcases/main/HSSF/Record/TestNameCommentRecord.cs
+++ b/testcases/main/HSSF/Record/TestNameCommentRecord.cs
@@ -2,7 +2,7 @@
using System.Text;
using System.Collections.Generic;
-using NUnit.Framework;
+using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.Util;
using NPOI.HSSF.Record;
@@ -30,9 +30,9 @@ public void TestReserialize()
+ "94 08 00 00 00 00 00 00 00 00 00 00 04 00 07 00 00 6E 61 6D 65 00 63 6F 6D 6D 65 6E 74]");
RecordInputStream in1 = TestcaseRecordInputStream.Create(NameCommentRecord.sid, data);
NameCommentRecord ncr = new NameCommentRecord(in1);
- Assert.AreEqual(0x0894, ncr.RecordType);
- Assert.AreEqual("name", ncr.NameText);
- Assert.AreEqual("comment", ncr.CommentText);
+ ClassicAssert.AreEqual(0x0894, ncr.RecordType);
+ ClassicAssert.AreEqual("name", ncr.NameText);
+ ClassicAssert.AreEqual("comment", ncr.CommentText);
byte[] data2 = ncr.Serialize();
TestcaseRecordInputStream.ConfirmRecordEncoding(NameCommentRecord.sid, data, data2);
}
diff --git a/testcases/main/HSSF/Record/TestNameRecord.cs b/testcases/main/HSSF/Record/TestNameRecord.cs
index 332350090..8ecf6ff94 100644
--- a/testcases/main/HSSF/Record/TestNameRecord.cs
+++ b/testcases/main/HSSF/Record/TestNameRecord.cs
@@ -18,7 +18,7 @@ limitations under the License.
namespace TestCases.HSSF.Record
{
using System;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.UserModel;
using NPOI.SS.Formula.PTG;
using NPOI.SS.UserModel;
@@ -50,8 +50,8 @@ public void TestFillExtras()
NameRecord name = new NameRecord(TestcaseRecordInputStream.Create(NameRecord.sid, examples));
String description = name.DescriptionText;
- Assert.IsNotNull(description);
- Assert.IsTrue(description.EndsWith("Macro recorded 27-Sep-93 by ALLWOR"));
+ ClassicAssert.IsNotNull(description);
+ ClassicAssert.IsTrue(description.EndsWith("Macro recorded 27-Sep-93 by ALLWOR"));
}
[Test]
public void TestReSerialize()
@@ -61,7 +61,7 @@ public void TestReSerialize()
+ "20 00 00 01 0B 00 00 00 01 00 00 00 00 00 00 06 3B 00 00 00 00 02 00 00 00 09 00]");
RecordInputStream in1 = TestcaseRecordInputStream.Create(NameRecord.sid, data);
NameRecord nr = new NameRecord(in1);
- Assert.AreEqual(0x0020, nr.OptionFlag);
+ ClassicAssert.AreEqual(0x0020, nr.OptionFlag);
byte[] data2 = nr.Serialize();
TestcaseRecordInputStream.ConfirmRecordEncoding(NameRecord.sid, data, data2);
}
@@ -78,7 +78,7 @@ public void TestFormulaRelAbs_bug46174()
{
Assert.Fail("Identified bug 46174");
}
- Assert.AreEqual("Sheet1!$B$3", name.RefersToFormula);
+ ClassicAssert.AreEqual("Sheet1!$B$3", name.RefersToFormula);
wb.Close();
}
[Test]
@@ -90,9 +90,9 @@ public void TestFormulaGeneral()
wb.CreateSheet("Sheet1");
name.NameName = (/*setter*/"test");
name.RefersToFormula = (/*setter*/"Sheet1!A1+Sheet1!A2");
- Assert.AreEqual("Sheet1!A1+Sheet1!A2", name.RefersToFormula);
+ ClassicAssert.AreEqual("Sheet1!A1+Sheet1!A2", name.RefersToFormula);
name.RefersToFormula = (/*setter*/"5*6");
- Assert.AreEqual("5*6", name.RefersToFormula);
+ ClassicAssert.AreEqual("5*6", name.RefersToFormula);
wb.Close();
}
@@ -684,7 +684,7 @@ public void Test50244()
byte[] data2 = nr1.Serialize();
- Assert.AreEqual(data1.Length, data2.Length);
+ ClassicAssert.AreEqual(data1.Length, data2.Length);
RecordInputStream in2 = TestcaseRecordInputStream.Create(data2);
NameRecord nr2 = new NameRecord(in2);
assert_bug50244(nr2);
@@ -692,33 +692,33 @@ public void Test50244()
private void assert_bug50244(NameRecord nr)
{
- Assert.AreEqual("wDataGruppeSerie.", nr.NameText);
+ ClassicAssert.AreEqual("wDataGruppeSerie.", nr.NameText);
Ptg[] ptg = nr.NameDefinition;
- Assert.AreEqual(1, ptg.Length);
+ ClassicAssert.AreEqual(1, ptg.Length);
ArrayPtg arr = (ArrayPtg)ptg[0];
- Assert.AreEqual(696, arr.RowCount);
- Assert.AreEqual(1, arr.ColumnCount);
+ ClassicAssert.AreEqual(696, arr.RowCount);
+ ClassicAssert.AreEqual(1, arr.ColumnCount);
Object[,] vals = arr.GetTokenArrayValues();
- Assert.AreEqual("1.T20.001", vals[0,0]);
- Assert.AreEqual("1.T20.010", vals[vals.Length - 1,0]);
+ ClassicAssert.AreEqual("1.T20.001", vals[0,0]);
+ ClassicAssert.AreEqual("1.T20.010", vals[vals.Length - 1,0]);
}
[Test]
public void TestBug57923()
{
NameRecord record = new NameRecord();
- Assert.AreEqual(0, record.ExternSheetNumber);
+ ClassicAssert.AreEqual(0, record.ExternSheetNumber);
record.NameDefinition = (new Ptg[] { });
- Assert.AreEqual(0, record.ExternSheetNumber);
+ ClassicAssert.AreEqual(0, record.ExternSheetNumber);
record.NameDefinition = (new Ptg[] { new NamePtg(1) });
- Assert.AreEqual(0, record.ExternSheetNumber);
+ ClassicAssert.AreEqual(0, record.ExternSheetNumber);
record.NameDefinition = (new Ptg[] { new Area3DPtg("area", 1) });
- Assert.AreEqual(1, record.ExternSheetNumber);
+ ClassicAssert.AreEqual(1, record.ExternSheetNumber);
record.NameDefinition = (new Ptg[] { new Ref3DPtg("A1", 1) });
- Assert.AreEqual(1, record.ExternSheetNumber);
+ ClassicAssert.AreEqual(1, record.ExternSheetNumber);
}
}
diff --git a/testcases/main/HSSF/Record/TestNoteRecord.cs b/testcases/main/HSSF/Record/TestNoteRecord.cs
index 7b967df50..d3ddc65d7 100644
--- a/testcases/main/HSSF/Record/TestNoteRecord.cs
+++ b/testcases/main/HSSF/Record/TestNoteRecord.cs
@@ -20,7 +20,7 @@ namespace TestCases.HSSF.Record
using System;
using NPOI.HSSF.Record;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.Util;
/**
@@ -46,20 +46,20 @@ public void TestRead()
NoteRecord record = new NoteRecord(TestcaseRecordInputStream.Create(NoteRecord.sid, testData));
- Assert.AreEqual(NoteRecord.sid, record.Sid);
+ ClassicAssert.AreEqual(NoteRecord.sid, record.Sid);
- Assert.AreEqual(6, record.Row);
- Assert.AreEqual(1, record.Column);
- Assert.AreEqual(NoteRecord.NOTE_VISIBLE, record.Flags);
- Assert.AreEqual(1026, record.ShapeId);
- Assert.AreEqual("Apache Software Foundation", record.Author);
+ ClassicAssert.AreEqual(6, record.Row);
+ ClassicAssert.AreEqual(1, record.Column);
+ ClassicAssert.AreEqual(NoteRecord.NOTE_VISIBLE, record.Flags);
+ ClassicAssert.AreEqual(1026, record.ShapeId);
+ ClassicAssert.AreEqual("Apache Software Foundation", record.Author);
}
[Test]
public void TestWrite()
{
NoteRecord record = new NoteRecord();
- Assert.AreEqual(NoteRecord.sid, record.Sid);
+ ClassicAssert.AreEqual(NoteRecord.sid, record.Sid);
record.Row = ((short)6);
record.Column = ((short)1);
@@ -82,16 +82,16 @@ public void TestClone()
record.Author = ("Apache Software Foundation");
NoteRecord cloned = (NoteRecord)record.Clone();
- Assert.AreEqual(record.Row, cloned.Row);
- Assert.AreEqual(record.Column, cloned.Column);
- Assert.AreEqual(record.Flags, cloned.Flags);
- Assert.AreEqual(record.ShapeId, cloned.ShapeId);
- Assert.AreEqual(record.Author, cloned.Author);
+ ClassicAssert.AreEqual(record.Row, cloned.Row);
+ ClassicAssert.AreEqual(record.Column, cloned.Column);
+ ClassicAssert.AreEqual(record.Flags, cloned.Flags);
+ ClassicAssert.AreEqual(record.ShapeId, cloned.ShapeId);
+ ClassicAssert.AreEqual(record.Author, cloned.Author);
//finally check that the Serialized data is1 the same
byte[] src = record.Serialize();
byte[] cln = cloned.Serialize();
- Assert.IsTrue(NPOI.Util.Arrays.Equals(src, cln));
+ ClassicAssert.IsTrue(NPOI.Util.Arrays.Equals(src, cln));
}
[Test]
public void TestUnicodeAuthor()
@@ -110,8 +110,8 @@ public void TestUnicodeAuthor()
{
throw new AssertionException("Identified bug in reading note with unicode author");
}
- Assert.AreEqual("\u30A2\u30D1\u30C3\u30C1\u65CF", nr.Author);
- Assert.IsTrue(nr.AuthorIsMultibyte);
+ ClassicAssert.AreEqual("\u30A2\u30D1\u30C3\u30C1\u65CF", nr.Author);
+ ClassicAssert.IsTrue(nr.AuthorIsMultibyte);
byte[] ser = nr.Serialize();
TestcaseRecordInputStream.ConfirmRecordEncoding(NoteRecord.sid, data, ser);
@@ -119,8 +119,8 @@ public void TestUnicodeAuthor()
// Re-check
in1 = TestcaseRecordInputStream.Create(ser);
nr = new NoteRecord(in1);
- Assert.AreEqual("\u30A2\u30D1\u30C3\u30C1\u65CF", nr.Author);
- Assert.IsTrue(nr.AuthorIsMultibyte);
+ ClassicAssert.AreEqual("\u30A2\u30D1\u30C3\u30C1\u65CF", nr.Author);
+ ClassicAssert.IsTrue(nr.AuthorIsMultibyte);
// Change to a non unicode author, will stop being unicode
@@ -129,8 +129,8 @@ public void TestUnicodeAuthor()
in1 = TestcaseRecordInputStream.Create(ser);
nr = new NoteRecord(in1);
- Assert.AreEqual("Simple", nr.Author);
- Assert.IsFalse(nr.AuthorIsMultibyte);
+ ClassicAssert.AreEqual("Simple", nr.Author);
+ ClassicAssert.IsFalse(nr.AuthorIsMultibyte);
// Now set it back again
nr.Author = ("Unicode\u1234");
@@ -138,8 +138,8 @@ public void TestUnicodeAuthor()
in1 = TestcaseRecordInputStream.Create(ser);
nr = new NoteRecord(in1);
- Assert.AreEqual("Unicode\u1234", nr.Author);
- Assert.IsTrue(nr.AuthorIsMultibyte);
+ ClassicAssert.AreEqual("Unicode\u1234", nr.Author);
+ ClassicAssert.IsTrue(nr.AuthorIsMultibyte);
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/Record/TestNoteStructureSubRecord.cs b/testcases/main/HSSF/Record/TestNoteStructureSubRecord.cs
index 6d67d738f..08c3500c5 100644
--- a/testcases/main/HSSF/Record/TestNoteStructureSubRecord.cs
+++ b/testcases/main/HSSF/Record/TestNoteStructureSubRecord.cs
@@ -19,7 +19,7 @@ namespace TestCases.HSSF.Record
using System;
using NPOI.HSSF.Record;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
* Tests the serialization and deserialization of the NoteRecord
@@ -47,19 +47,19 @@ public void TestRead()
NoteStructureSubRecord record = new NoteStructureSubRecord(TestcaseRecordInputStream.Create(NoteStructureSubRecord.sid, data),data.Length);
- Assert.AreEqual(NoteStructureSubRecord.sid, record.Sid);
- Assert.AreEqual(data.Length , record.DataSize);
+ ClassicAssert.AreEqual(NoteStructureSubRecord.sid, record.Sid);
+ ClassicAssert.AreEqual(data.Length , record.DataSize);
}
[Test]
public void TestWrite()
{
NoteStructureSubRecord record = new NoteStructureSubRecord();
- Assert.AreEqual(NoteStructureSubRecord.sid, record.Sid);
- Assert.AreEqual(data.Length , record.DataSize);
+ ClassicAssert.AreEqual(NoteStructureSubRecord.sid, record.Sid);
+ ClassicAssert.AreEqual(data.Length , record.DataSize);
byte[] ser = record.Serialize();
- Assert.AreEqual(ser.Length - 4, data.Length);
+ ClassicAssert.AreEqual(ser.Length - 4, data.Length);
}
[Test]
@@ -71,8 +71,8 @@ public void TestClone()
NoteStructureSubRecord cloned = (NoteStructureSubRecord)record.Clone();
byte[] cln = cloned.Serialize();
- Assert.AreEqual(record.DataSize, cloned.DataSize);
- Assert.IsTrue(NPOI.Util.Arrays.Equals(src, cln));
+ ClassicAssert.AreEqual(record.DataSize, cloned.DataSize);
+ ClassicAssert.IsTrue(NPOI.Util.Arrays.Equals(src, cln));
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/Record/TestObjRecord.cs b/testcases/main/HSSF/Record/TestObjRecord.cs
index 499ddf39b..198cb6bd8 100644
--- a/testcases/main/HSSF/Record/TestObjRecord.cs
+++ b/testcases/main/HSSF/Record/TestObjRecord.cs
@@ -19,7 +19,7 @@ namespace TestCases.HSSF.Record
{
using System;
using System.Collections;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.Record;
using NPOI.Util;
@@ -56,12 +56,12 @@ public void TestLoad()
{
ObjRecord record = new ObjRecord(TestcaseRecordInputStream.Create(ObjRecord.sid, recdata));
- Assert.AreEqual(26, record.RecordSize - 4);
+ ClassicAssert.AreEqual(26, record.RecordSize - 4);
IList subrecords = record.SubRecords;
- Assert.AreEqual(2, subrecords.Count);
- Assert.IsTrue(subrecords[0] is CommonObjectDataSubRecord);
- Assert.IsTrue(subrecords[1] is EndSubRecord);
+ ClassicAssert.AreEqual(2, subrecords.Count);
+ ClassicAssert.IsTrue(subrecords[0] is CommonObjectDataSubRecord);
+ ClassicAssert.IsTrue(subrecords[1] is EndSubRecord);
}
[Test]
@@ -70,10 +70,10 @@ public void TestStore()
ObjRecord record = new ObjRecord(TestcaseRecordInputStream.Create(ObjRecord.sid, recdata));
byte[] recordBytes = record.Serialize();
- Assert.AreEqual(26, recordBytes.Length - 4);
+ ClassicAssert.AreEqual(26, recordBytes.Length - 4);
byte[] subData = new byte[recdata.Length];
System.Array.Copy(recordBytes, 4, subData, 0, subData.Length);
- Assert.IsTrue(NPOI.Util.Arrays.Equals(recdata, subData));
+ ClassicAssert.IsTrue(NPOI.Util.Arrays.Equals(recdata, subData));
}
[Test]
public void TestConstruct()
@@ -98,9 +98,9 @@ public void TestConstruct()
record = new ObjRecord(TestcaseRecordInputStream.Create(ObjRecord.sid, bytes));
IList subrecords = record.SubRecords;
- Assert.AreEqual(2, subrecords.Count);
- Assert.IsTrue(subrecords[0] is CommonObjectDataSubRecord);
- Assert.IsTrue(subrecords[1] is EndSubRecord);
+ ClassicAssert.AreEqual(2, subrecords.Count);
+ ClassicAssert.IsTrue(subrecords[0] is CommonObjectDataSubRecord);
+ ClassicAssert.IsTrue(subrecords[1] is EndSubRecord);
}
[Test]
public void TestReadWriteWithPadding_bug45133()
@@ -112,13 +112,13 @@ public void TestReadWriteWithPadding_bug45133()
throw new AssertionException("Identified bug 45133");
}
- Assert.AreEqual(36, record.RecordSize);
+ ClassicAssert.AreEqual(36, record.RecordSize);
IList subrecords = record.SubRecords;
- Assert.AreEqual(3, subrecords.Count);
- Assert.AreEqual(typeof(CommonObjectDataSubRecord), subrecords[0].GetType());
- Assert.AreEqual(typeof(GroupMarkerSubRecord), subrecords[1].GetType());
- Assert.AreEqual(typeof(EndSubRecord), subrecords[2].GetType());
+ ClassicAssert.AreEqual(3, subrecords.Count);
+ ClassicAssert.AreEqual(typeof(CommonObjectDataSubRecord), subrecords[0].GetType());
+ ClassicAssert.AreEqual(typeof(GroupMarkerSubRecord), subrecords[1].GetType());
+ ClassicAssert.AreEqual(typeof(EndSubRecord), subrecords[2].GetType());
}
/**
* Check that ObjRecord tolerates and preserves padding to a 4-byte boundary
diff --git a/testcases/main/HSSF/Record/TestPLVRecord.cs b/testcases/main/HSSF/Record/TestPLVRecord.cs
index 802661b21..91455fb34 100644
--- a/testcases/main/HSSF/Record/TestPLVRecord.cs
+++ b/testcases/main/HSSF/Record/TestPLVRecord.cs
@@ -20,7 +20,7 @@ limitations under the License.
using NPOI.HSSF.UserModel;
using NPOI.SS.Util;
using NPOI.SS.UserModel;
-using NUnit.Framework;
+using NUnit.Framework;using NUnit.Framework.Legacy;
namespace TestCases.HSSF.Record
{
/**
diff --git a/testcases/main/HSSF/Record/TestPaletteRecord.cs b/testcases/main/HSSF/Record/TestPaletteRecord.cs
index 4a80c5339..26f1ce1ac 100644
--- a/testcases/main/HSSF/Record/TestPaletteRecord.cs
+++ b/testcases/main/HSSF/Record/TestPaletteRecord.cs
@@ -20,7 +20,7 @@ namespace TestCases.HSSF.Record
{
using System;
using System.Collections;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.Util;
using NPOI.HSSF.Record;
using System.Collections.Generic;
@@ -52,9 +52,9 @@ public void TestDefaultPalette()
byte[] paletteTriplet = palette.GetColor((short)index);
String msg = "Expected HSSFColor constant to match PaletteRecord at index 0x"
+ NPOI.Util.StringUtil.ToHexString(c.Indexed);
- Assert.AreEqual(rgbTriplet[0], paletteTriplet[0] & 0xff,msg);
- Assert.AreEqual(rgbTriplet[1], paletteTriplet[1] & 0xff,msg);
- Assert.AreEqual(rgbTriplet[2], paletteTriplet[2] & 0xff,msg);
+ ClassicAssert.AreEqual(rgbTriplet[0], paletteTriplet[0] & 0xff,msg);
+ ClassicAssert.AreEqual(rgbTriplet[1], paletteTriplet[1] & 0xff,msg);
+ ClassicAssert.AreEqual(rgbTriplet[2], paletteTriplet[2] & 0xff,msg);
}
}
}
diff --git a/testcases/main/HSSF/Record/TestPaneRecord.cs b/testcases/main/HSSF/Record/TestPaneRecord.cs
index 1895410d3..802da34a1 100644
--- a/testcases/main/HSSF/Record/TestPaneRecord.cs
+++ b/testcases/main/HSSF/Record/TestPaneRecord.cs
@@ -23,7 +23,7 @@ namespace TestCases.HSSF.Record
using System;
using NPOI.HSSF.Record;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
* Tests the serialization and deserialization of the PaneRecord
@@ -53,13 +53,13 @@ public void TestLoad()
PaneRecord record = new PaneRecord(TestcaseRecordInputStream.Create((short)0x41, data));
- Assert.AreEqual((short)1, record.X);
- Assert.AreEqual((short)2, record.Y);
- Assert.AreEqual((short)3, record.TopRow);
- Assert.AreEqual((short)4, record.LeftColumn);
- Assert.AreEqual(PaneRecord.ACTIVE_PANE_LOWER_LEFT, record.ActivePane);
+ ClassicAssert.AreEqual((short)1, record.X);
+ ClassicAssert.AreEqual((short)2, record.Y);
+ ClassicAssert.AreEqual((short)3, record.TopRow);
+ ClassicAssert.AreEqual((short)4, record.LeftColumn);
+ ClassicAssert.AreEqual(PaneRecord.ACTIVE_PANE_LOWER_LEFT, record.ActivePane);
- Assert.AreEqual(14, record.RecordSize);
+ ClassicAssert.AreEqual(14, record.RecordSize);
}
[Test]
public void TestStore()
@@ -73,9 +73,9 @@ public void TestStore()
record.ActivePane=(PaneRecord.ACTIVE_PANE_LOWER_LEFT);
byte[] recordBytes = record.Serialize();
- Assert.AreEqual(recordBytes.Length - 4, data.Length);
+ ClassicAssert.AreEqual(recordBytes.Length - 4, data.Length);
for (int i = 0; i < data.Length; i++)
- Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
+ ClassicAssert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/Record/TestRecalcIdRecord.cs b/testcases/main/HSSF/Record/TestRecalcIdRecord.cs
index 609a0d188..a940e866d 100644
--- a/testcases/main/HSSF/Record/TestRecalcIdRecord.cs
+++ b/testcases/main/HSSF/Record/TestRecalcIdRecord.cs
@@ -17,7 +17,7 @@ limitations under the License.
namespace TestCases.HSSF.Record
{
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.Util;
using TestCases.HSSF.Record;
@@ -67,14 +67,14 @@ public void TestBadFirstField_bug48096()
}
throw e;
}
- Assert.AreEqual(0, in1.Remaining);
- Assert.IsTrue(Arrays.Equals(r.Serialize(), goodData));
+ ClassicAssert.AreEqual(0, in1.Remaining);
+ ClassicAssert.IsTrue(Arrays.Equals(r.Serialize(), goodData));
}
private static RecalcIdRecord Create(byte[] data)
{
RecordInputStream in1 = TestcaseRecordInputStream.Create(RecalcIdRecord.sid, data);
RecalcIdRecord result = new RecalcIdRecord(in1);
- Assert.AreEqual(0, in1.Remaining);
+ ClassicAssert.AreEqual(0, in1.Remaining);
return result;
}
}
diff --git a/testcases/main/HSSF/Record/TestRecordFactory.cs b/testcases/main/HSSF/Record/TestRecordFactory.cs
index 5adb892be..f12ccdbb7 100644
--- a/testcases/main/HSSF/Record/TestRecordFactory.cs
+++ b/testcases/main/HSSF/Record/TestRecordFactory.cs
@@ -21,7 +21,7 @@ namespace TestCases.HSSF.Record
using System.IO;
using System.Collections;
using NPOI.HSSF.Record;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.Util;
using NPOI.POIFS.FileSystem;
using System.Collections.Generic;
@@ -61,18 +61,18 @@ public void TestBasicRecordConstruction()
};
Record[] record = RecordFactory.CreateRecord(TestcaseRecordInputStream.Create(recType, data));
- Assert.AreEqual(typeof(BOFRecord).Name,
+ ClassicAssert.AreEqual(typeof(BOFRecord).Name,
record[0].GetType().Name);
BOFRecord bofRecord = (BOFRecord)record[0];
- Assert.AreEqual(7422, bofRecord.Build);
- Assert.AreEqual(1997, bofRecord.BuildYear);
- Assert.AreEqual(16585, bofRecord.HistoryBitMask);
- Assert.AreEqual(20, bofRecord.RecordSize);
- Assert.AreEqual(262, bofRecord.RequiredVersion);
- Assert.AreEqual(2057, bofRecord.Sid);
- Assert.AreEqual(BOFRecordType.Workbook, bofRecord.Type);
- Assert.AreEqual(1536, bofRecord.Version);
+ ClassicAssert.AreEqual(7422, bofRecord.Build);
+ ClassicAssert.AreEqual(1997, bofRecord.BuildYear);
+ ClassicAssert.AreEqual(16585, bofRecord.HistoryBitMask);
+ ClassicAssert.AreEqual(20, bofRecord.RecordSize);
+ ClassicAssert.AreEqual(262, bofRecord.RequiredVersion);
+ ClassicAssert.AreEqual(2057, bofRecord.Sid);
+ ClassicAssert.AreEqual(BOFRecordType.Workbook, bofRecord.Type);
+ ClassicAssert.AreEqual(1536, bofRecord.Version);
recType = MMSRecord.sid;
//size = 2;
data = new byte[]
@@ -80,14 +80,14 @@ public void TestBasicRecordConstruction()
0, 0
};
record = RecordFactory.CreateRecord(TestcaseRecordInputStream.Create(recType, data));
- Assert.AreEqual(typeof(MMSRecord).Name,
+ ClassicAssert.AreEqual(typeof(MMSRecord).Name,
record[0].GetType().Name);
MMSRecord mmsRecord = (MMSRecord)record[0];
- Assert.AreEqual(0, mmsRecord.AddMenuCount);
- Assert.AreEqual(0, mmsRecord.DelMenuCount);
- Assert.AreEqual(6, mmsRecord.RecordSize);
- Assert.AreEqual(193, mmsRecord.Sid);
+ ClassicAssert.AreEqual(0, mmsRecord.AddMenuCount);
+ ClassicAssert.AreEqual(0, mmsRecord.DelMenuCount);
+ ClassicAssert.AreEqual(6, mmsRecord.RecordSize);
+ ClassicAssert.AreEqual(193, mmsRecord.Sid);
}
/**
@@ -107,16 +107,16 @@ public void TestSpecial()
};
Record[] record = RecordFactory.CreateRecord(TestcaseRecordInputStream.Create(recType, data));
- Assert.AreEqual(typeof(NumberRecord).Name,
+ ClassicAssert.AreEqual(typeof(NumberRecord).Name,
record[0].GetType().Name);
NumberRecord numberRecord = (NumberRecord)record[0];
- Assert.AreEqual(0, numberRecord.Column);
- Assert.AreEqual(18, numberRecord.RecordSize);
- Assert.AreEqual(0, numberRecord.Row);
- Assert.AreEqual(515, numberRecord.Sid);
- Assert.AreEqual(0.0, numberRecord.Value, 0.001);
- Assert.AreEqual(21, numberRecord.XFIndex);
+ ClassicAssert.AreEqual(0, numberRecord.Column);
+ ClassicAssert.AreEqual(18, numberRecord.RecordSize);
+ ClassicAssert.AreEqual(0, numberRecord.Row);
+ ClassicAssert.AreEqual(515, numberRecord.Sid);
+ ClassicAssert.AreEqual(0.0, numberRecord.Value, 0.001);
+ ClassicAssert.AreEqual(21, numberRecord.XFIndex);
}
/**
@@ -139,24 +139,24 @@ public void TestContinuedUnknownRecord()
MemoryStream bois = new MemoryStream(data);
Record[] records = (Record[])
RecordFactory.CreateRecords(bois).ToArray();
- Assert.AreEqual(3, records.Length, "Created record count");
- Assert.AreEqual(
+ ClassicAssert.AreEqual(3, records.Length, "Created record count");
+ ClassicAssert.AreEqual(
typeof(UnknownRecord).Name,
records[0].GetType().Name, "1st record's type");
- Assert.AreEqual((short)-256, records[0].Sid, "1st record's sid");
- Assert.AreEqual(typeof(ContinueRecord).Name,
+ ClassicAssert.AreEqual((short)-256, records[0].Sid, "1st record's sid");
+ ClassicAssert.AreEqual(typeof(ContinueRecord).Name,
records[1].GetType().Name, "2nd record's type");
ContinueRecord record = (ContinueRecord)records[1];
- Assert.AreEqual(0x3C, record.Sid, "2nd record's sid");
- Assert.AreEqual(1, record.Data[0], "1st data byte");
- Assert.AreEqual(2, record.Data[1], "2nd data byte");
- Assert.AreEqual(3, record.Data[2], "3rd data byte");
- Assert.AreEqual(
+ ClassicAssert.AreEqual(0x3C, record.Sid, "2nd record's sid");
+ ClassicAssert.AreEqual(1, record.Data[0], "1st data byte");
+ ClassicAssert.AreEqual(2, record.Data[1], "2nd data byte");
+ ClassicAssert.AreEqual(3, record.Data[2], "3rd data byte");
+ ClassicAssert.AreEqual(
typeof(ContinueRecord).Name,
records[2].GetType().Name, "3rd record's type");
record = (ContinueRecord)records[2];
- Assert.AreEqual(0x3C, record.Sid, "3nd record's sid");
- Assert.AreEqual(4, record.Data[0], "4th data byte");
+ ClassicAssert.AreEqual(0x3C, record.Sid, "3nd record's sid");
+ ClassicAssert.AreEqual(4, record.Data[0], "4th data byte");
}
/**
@@ -202,12 +202,12 @@ public void TestMixedContinue()
byte[] data = HexRead.ReadFromString(dump);
IList records = RecordFactory.CreateRecords(new MemoryStream(data));
- Assert.AreEqual(5, records.Count);
- Assert.IsTrue(records[0] is ObjRecord);
- Assert.IsTrue(records[1] is DrawingRecord);
- Assert.IsTrue(records[2] is TextObjectRecord);
- Assert.IsTrue(records[3] is ContinueRecord);
- Assert.IsTrue(records[4] is ObjRecord);
+ ClassicAssert.AreEqual(5, records.Count);
+ ClassicAssert.IsTrue(records[0] is ObjRecord);
+ ClassicAssert.IsTrue(records[1] is DrawingRecord);
+ ClassicAssert.IsTrue(records[2] is TextObjectRecord);
+ ClassicAssert.IsTrue(records[3] is ContinueRecord);
+ ClassicAssert.IsTrue(records[4] is ObjRecord);
//Serialize and verify that the Serialized data is1 the same as the original
MemoryStream out1 = new MemoryStream();
@@ -218,8 +218,8 @@ public void TestMixedContinue()
}
byte[] ser = out1.ToArray();
- Assert.AreEqual(data.Length, ser.Length);
- Assert.IsTrue(Arrays.Equals(data, ser));
+ ClassicAssert.AreEqual(data.Length, ser.Length);
+ ClassicAssert.IsTrue(Arrays.Equals(data, ser));
}
[Test]
public void TestNonZeroPadding_bug46987()
@@ -254,7 +254,7 @@ public void TestNonZeroPadding_bug46987()
List outRecs = RecordFactory.CreateRecords(is1);
// Buffer underrun - requested 512 bytes but 192 was available
- Assert.AreEqual(5, outRecs.Count);
+ ClassicAssert.AreEqual(5, outRecs.Count);
fs.Close();
}
[Test]
diff --git a/testcases/main/HSSF/Record/TestRecordFactoryInputStream.cs b/testcases/main/HSSF/Record/TestRecordFactoryInputStream.cs
index 73562b592..c418dbd3d 100644
--- a/testcases/main/HSSF/Record/TestRecordFactoryInputStream.cs
+++ b/testcases/main/HSSF/Record/TestRecordFactoryInputStream.cs
@@ -19,7 +19,7 @@ namespace TestCases.HSSF.Record
{
using System;
using System.IO;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI;
using NPOI.HSSF.Record;
using NPOI.HSSF.Record.Crypto;
@@ -155,9 +155,9 @@ public void TestSuppliedPassword()
*/
private void ConfirmReadInitialRecords(RecordFactoryInputStream rfis)
{
- Assert.AreEqual(typeof(BOFRecord), rfis.NextRecord().GetType());
+ ClassicAssert.AreEqual(typeof(BOFRecord), rfis.NextRecord().GetType());
WindowOneRecord rec1 = (WindowOneRecord)rfis.NextRecord();
- Assert.IsTrue(Arrays.Equals(HexRead.ReadFromString(SAMPLE_WINDOW1), rec1.Serialize()));
+ ClassicAssert.IsTrue(Arrays.Equals(HexRead.ReadFromString(SAMPLE_WINDOW1), rec1.Serialize()));
}
private static RecordFactoryInputStream CreateRFIS(byte[] data)
diff --git a/testcases/main/HSSF/Record/TestRecordInputStream.cs b/testcases/main/HSSF/Record/TestRecordInputStream.cs
index 2f6dc10cc..4b219b374 100644
--- a/testcases/main/HSSF/Record/TestRecordInputStream.cs
+++ b/testcases/main/HSSF/Record/TestRecordInputStream.cs
@@ -18,7 +18,7 @@ limitations under the License.
namespace TestCases.HSSF.Record
{
using System;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.Record;
using NPOI.Util;
@@ -76,7 +76,7 @@ public void TestChangeOfCompressionFlag_bug25866()
throw e;
}
- Assert.AreEqual("\u591A\u8A00\u8A9E - Multilingual", actual);
+ ClassicAssert.AreEqual("\u591A\u8A00\u8A9E - Multilingual", actual);
}
[Test]
public void TestChangeFromUnCompressedToCompressed()
@@ -88,7 +88,7 @@ public void TestChangeFromUnCompressedToCompressed()
);
RecordInputStream in1 = TestcaseRecordInputStream.Create(changingFlagSimpleData);
String actual = in1.ReadCompressedUnicode(18);
- Assert.AreEqual("Multilingual - \u591A\u8A00\u8A9E", actual);
+ ClassicAssert.AreEqual("Multilingual - \u591A\u8A00\u8A9E", actual);
}
[Test]
public void TestReadString()
@@ -102,7 +102,7 @@ public void TestReadString()
);
RecordInputStream in1 = TestcaseRecordInputStream.Create(changingFlagFullData);
String actual = in1.ReadString();
- Assert.AreEqual("Multilingual - \u591A\u8A00\u8A9E", actual);
+ ClassicAssert.AreEqual("Multilingual - \u591A\u8A00\u8A9E", actual);
}
[Test]
diff --git a/testcases/main/HSSF/Record/TestSCLRecord.cs b/testcases/main/HSSF/Record/TestSCLRecord.cs
index 3b7861a8d..e5da1b6a5 100644
--- a/testcases/main/HSSF/Record/TestSCLRecord.cs
+++ b/testcases/main/HSSF/Record/TestSCLRecord.cs
@@ -23,7 +23,7 @@ namespace TestCases.HSSF.Record
using System;
using NPOI.HSSF.Record;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
* Tests the serialization and deserialization of the SCLRecord
@@ -44,11 +44,11 @@ public class TestSCLRecord
public void TestLoad()
{
SCLRecord record = new SCLRecord(TestcaseRecordInputStream.Create((short)0xa0, data));
- Assert.AreEqual(3, record.Numerator);
- Assert.AreEqual(4, record.Denominator);
+ ClassicAssert.AreEqual(3, record.Numerator);
+ ClassicAssert.AreEqual(4, record.Denominator);
- Assert.AreEqual(8, record.RecordSize);
+ ClassicAssert.AreEqual(8, record.RecordSize);
}
[Test]
public void TestStore()
@@ -59,9 +59,9 @@ public void TestStore()
byte[] recordBytes = record.Serialize();
- Assert.AreEqual(recordBytes.Length - 4, data.Length);
+ ClassicAssert.AreEqual(recordBytes.Length - 4, data.Length);
for (int i = 0; i < data.Length; i++)
- Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
+ ClassicAssert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/Record/TestSSTDeserializer.cs b/testcases/main/HSSF/Record/TestSSTDeserializer.cs
index 561bb640f..02d895103 100644
--- a/testcases/main/HSSF/Record/TestSSTDeserializer.cs
+++ b/testcases/main/HSSF/Record/TestSSTDeserializer.cs
@@ -19,7 +19,7 @@ namespace TestCases.HSSF.Record
{
using System;
using System.IO;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.Record;
using TestCases.HSSF;
using NPOI.Util;
@@ -68,7 +68,7 @@ public void TestSpanRichTextToPlainText()
SSTDeserializer deserializer = new SSTDeserializer(strings);
deserializer.ManufactureStrings(1, in1);
- Assert.AreEqual("At a dinner party orAt At At ", strings[0] + "");
+ ClassicAssert.AreEqual("At a dinner party orAt At At ", strings[0] + "");
}
[Test]
public void TestContinuationWithNoOverlap()
@@ -81,8 +81,8 @@ public void TestContinuationWithNoOverlap()
SSTDeserializer deserializer = new SSTDeserializer(strings);
deserializer.ManufactureStrings(2, in1);
- Assert.AreEqual("At a dinner party or", strings[0] + "");
- Assert.AreEqual("At a dinner party", strings[1] + "");
+ ClassicAssert.AreEqual("At a dinner party or", strings[0] + "");
+ ClassicAssert.AreEqual("At a dinner party", strings[1] + "");
}
/**
@@ -103,8 +103,8 @@ public void TestStringAcross2Continuations()
SSTDeserializer deserializer = new SSTDeserializer(strings);
deserializer.ManufactureStrings(2, in1);
- Assert.AreEqual("At a dinner party or", strings[0] + "");
- Assert.AreEqual("At a dinner partyAt a dinner party", strings[1] + "");
+ ClassicAssert.AreEqual("At a dinner party or", strings[0] + "");
+ ClassicAssert.AreEqual("At a dinner partyAt a dinner party", strings[1] + "");
}
[Test]
public void TestExtendedStrings()
@@ -117,7 +117,7 @@ public void TestExtendedStrings()
SSTDeserializer deserializer = new SSTDeserializer(strings);
deserializer.ManufactureStrings(1, in1);
- Assert.AreEqual("At a dinner party orAt At At ", strings[0].ToString());
+ ClassicAssert.AreEqual("At a dinner party orAt At At ", strings[0].ToString());
header = ReadSampleHexData("extendedtextstrings.txt", "norich-header", FAKE_SID);
@@ -128,7 +128,7 @@ public void TestExtendedStrings()
deserializer = new SSTDeserializer(strings);
deserializer.ManufactureStrings(1, in1);
- Assert.AreEqual("At a dinner party orAt At At ", strings[0] + "");
+ ClassicAssert.AreEqual("At a dinner party orAt At At ", strings[0] + "");
}
/**
@@ -147,8 +147,8 @@ public void TestInvalidSTTRecord()
// The record data in notenoughstrings.txt only contains 1 string, deliberately pass in a larger number.
deserializer.ManufactureStrings(2, in1);
- Assert.AreEqual("At a dinner party or", strings[0] + "");
- Assert.AreEqual("", strings[1] + "");
+ ClassicAssert.AreEqual("At a dinner party or", strings[0] + "");
+ ClassicAssert.AreEqual("", strings[1] + "");
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/Record/TestSSTRecord.cs b/testcases/main/HSSF/Record/TestSSTRecord.cs
index b578fcde3..ddb156e96 100644
--- a/testcases/main/HSSF/Record/TestSSTRecord.cs
+++ b/testcases/main/HSSF/Record/TestSSTRecord.cs
@@ -20,7 +20,7 @@ namespace TestCases.HSSF.Record
using System;
using System.Collections;
using System.IO;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.UserModel;
using NPOI.SS.UserModel;
using NPOI.Util;
@@ -80,8 +80,8 @@ private static SSTRecord CreateSSTFromRawData(byte[] rawData)
RecordInputStream in1 = new RecordInputStream(new MemoryStream(rawData));
in1.NextRecord();
SSTRecord result = new SSTRecord(in1);
- Assert.AreEqual(0, in1.Remaining);
- Assert.IsTrue(!in1.HasNextRecord);
+ ClassicAssert.AreEqual(0, in1.Remaining);
+ ClassicAssert.IsTrue(!in1.HasNextRecord);
return result;
}
@@ -97,11 +97,11 @@ public void TestContinuedRecord()
origData = concatHexDumps("BigSSTRecord", "BigSSTRecordCR");
record = CreateSSTFromRawData(origData);
- Assert.AreEqual(1464, record.NumStrings);
- Assert.AreEqual(688, record.NumUniqueStrings);
- Assert.AreEqual(688, record.CountStrings);
+ ClassicAssert.AreEqual(1464, record.NumStrings);
+ ClassicAssert.AreEqual(688, record.NumUniqueStrings);
+ ClassicAssert.AreEqual(688, record.CountStrings);
ser_output = record.Serialize();
- Assert.IsTrue(Arrays.Equals(origData, ser_output));
+ ClassicAssert.IsTrue(Arrays.Equals(origData, ser_output));
// Testing based on new bug report
origData = concatHexDumps("BigSSTRecord2", "BigSSTRecord2CR1", "BigSSTRecord2CR2", "BigSSTRecord2CR3",
@@ -109,9 +109,9 @@ record = CreateSSTFromRawData(origData);
record = CreateSSTFromRawData(origData);
- Assert.AreEqual(158642, record.NumStrings);
- Assert.AreEqual(5249, record.NumUniqueStrings);
- Assert.AreEqual(5249, record.CountStrings);
+ ClassicAssert.AreEqual(158642, record.NumStrings);
+ ClassicAssert.AreEqual(5249, record.NumUniqueStrings);
+ ClassicAssert.AreEqual(5249, record.CountStrings);
ser_output = record.Serialize();
#if !HIDE_UNREACHABLE_CODE
if (false)
@@ -131,7 +131,7 @@ record = CreateSSTFromRawData(origData);
// TODO - trivial differences in ContinueRecord break locations
// Sample data should be Checked against what most recent Excel version produces.
// maybe tweaks are required in ContinuableRecordOutput
- Assert.IsTrue(Arrays.Equals(origData, ser_output));
+ ClassicAssert.IsTrue(Arrays.Equals(origData, ser_output));
}
#endif
}
@@ -202,19 +202,19 @@ public void TestHugeStrings()
byte[] content = new byte[record.RecordSize];
record.Serialize(0, content);
- Assert.AreEqual(total_length, content.Length);
+ ClassicAssert.AreEqual(total_length, content.Length);
//Deserialize the record.
RecordInputStream recStream = new RecordInputStream(new MemoryStream(content));
recStream.NextRecord();
record = new SSTRecord(recStream);
- Assert.AreEqual(strings.Length, record.NumStrings);
- Assert.AreEqual(strings.Length, record.NumUniqueStrings);
- Assert.AreEqual(strings.Length, record.CountStrings);
+ ClassicAssert.AreEqual(strings.Length, record.NumStrings);
+ ClassicAssert.AreEqual(strings.Length, record.NumUniqueStrings);
+ ClassicAssert.AreEqual(strings.Length, record.CountStrings);
for (int k = 0; k < strings.Length; k++)
{
- Assert.AreEqual(strings[k], record.GetString(k));
+ ClassicAssert.AreEqual(strings[k], record.GetString(k));
}
record = new SSTRecord();
bstrings[1] = new byte[bstrings[1].Length - 1];
@@ -237,18 +237,18 @@ public void TestHugeStrings()
content = new byte[record.RecordSize];
record.Serialize(0, content);
total_length--;
- Assert.AreEqual(total_length, content.Length);
+ ClassicAssert.AreEqual(total_length, content.Length);
recStream = new RecordInputStream(new MemoryStream(content));
recStream.NextRecord();
record = new SSTRecord(recStream);
- Assert.AreEqual(strings.Length, record.NumStrings);
- Assert.AreEqual(strings.Length, record.NumUniqueStrings);
- Assert.AreEqual(strings.Length, record.CountStrings);
+ ClassicAssert.AreEqual(strings.Length, record.NumStrings);
+ ClassicAssert.AreEqual(strings.Length, record.NumUniqueStrings);
+ ClassicAssert.AreEqual(strings.Length, record.CountStrings);
for (int k = 0; k < strings.Length; k++)
{
- Assert.AreEqual(strings[k], record.GetString(k));
+ ClassicAssert.AreEqual(strings[k], record.GetString(k));
}
}
@@ -278,15 +278,15 @@ public void TestSSTRecordBug()
byte[] content = new byte[record.RecordSize];
record.Serialize(0, content);
- Assert.AreEqual(8224, LittleEndian.GetShort(content, 2));
- Assert.AreEqual(ContinueRecord.sid, LittleEndian.GetShort(content, 8228));
- Assert.AreEqual(8224, LittleEndian.GetShort(content, 8228 + 2));
- Assert.AreEqual((byte)13, content[4 + 8228]);
- Assert.AreEqual(ContinueRecord.sid, LittleEndian.GetShort(content, 2 * 8228));
- Assert.AreEqual(8224, LittleEndian.GetShort(content, 8228 * 2 + 2));
- Assert.AreEqual((byte)13, content[4 + 8228 * 2]);
- Assert.AreEqual(ContinueRecord.sid, LittleEndian.GetShort(content, 3 * 8228));
- Assert.AreEqual((byte)13, content[4 + 8228 * 3]);
+ ClassicAssert.AreEqual(8224, LittleEndian.GetShort(content, 2));
+ ClassicAssert.AreEqual(ContinueRecord.sid, LittleEndian.GetShort(content, 8228));
+ ClassicAssert.AreEqual(8224, LittleEndian.GetShort(content, 8228 + 2));
+ ClassicAssert.AreEqual((byte)13, content[4 + 8228]);
+ ClassicAssert.AreEqual(ContinueRecord.sid, LittleEndian.GetShort(content, 2 * 8228));
+ ClassicAssert.AreEqual(8224, LittleEndian.GetShort(content, 8228 * 2 + 2));
+ ClassicAssert.AreEqual((byte)13, content[4 + 8228 * 2]);
+ ClassicAssert.AreEqual(ContinueRecord.sid, LittleEndian.GetShort(content, 3 * 8228));
+ ClassicAssert.AreEqual((byte)13, content[4 + 8228 * 3]);
}
/**
@@ -301,21 +301,21 @@ public void TestSimpleAddString()
// \u2122 is the encoding of the trademark symbol ...
UnicodeString s2 = new UnicodeString("Hello world\u2122");
- Assert.AreEqual(0, record.AddString(s1));
- Assert.AreEqual(s1, record.GetString(0));
- Assert.AreEqual(1, record.CountStrings);
- Assert.AreEqual(1, record.NumStrings);
- Assert.AreEqual(1, record.NumUniqueStrings);
- Assert.AreEqual(0, record.AddString(s1));
- Assert.AreEqual(s1, record.GetString(0));
- Assert.AreEqual(1, record.CountStrings);
- Assert.AreEqual(2, record.NumStrings);
- Assert.AreEqual(1, record.NumUniqueStrings);
- Assert.AreEqual(1, record.AddString(s2));
- Assert.AreEqual(s2, record.GetString(1));
- Assert.AreEqual(2, record.CountStrings);
- Assert.AreEqual(3, record.NumStrings);
- Assert.AreEqual(2, record.NumUniqueStrings);
+ ClassicAssert.AreEqual(0, record.AddString(s1));
+ ClassicAssert.AreEqual(s1, record.GetString(0));
+ ClassicAssert.AreEqual(1, record.CountStrings);
+ ClassicAssert.AreEqual(1, record.NumStrings);
+ ClassicAssert.AreEqual(1, record.NumUniqueStrings);
+ ClassicAssert.AreEqual(0, record.AddString(s1));
+ ClassicAssert.AreEqual(s1, record.GetString(0));
+ ClassicAssert.AreEqual(1, record.CountStrings);
+ ClassicAssert.AreEqual(2, record.NumStrings);
+ ClassicAssert.AreEqual(1, record.NumUniqueStrings);
+ ClassicAssert.AreEqual(1, record.AddString(s2));
+ ClassicAssert.AreEqual(s2, record.GetString(1));
+ ClassicAssert.AreEqual(2, record.CountStrings);
+ ClassicAssert.AreEqual(3, record.NumStrings);
+ ClassicAssert.AreEqual(2, record.NumUniqueStrings);
IEnumerator iter = record.GetStrings();
while (iter.MoveNext())
@@ -324,11 +324,11 @@ public void TestSimpleAddString()
if (ucs.Equals(s1))
{
- Assert.AreEqual((byte)0, ucs.OptionFlags);
+ ClassicAssert.AreEqual((byte)0, ucs.OptionFlags);
}
else if (ucs.Equals(s2))
{
- Assert.AreEqual((byte)1, ucs.OptionFlags);
+ ClassicAssert.AreEqual((byte)1, ucs.OptionFlags);
}
else
{
@@ -345,9 +345,9 @@ public void TestSimpleConstructor()
{
SSTRecord record = new SSTRecord();
- Assert.AreEqual(0, record.NumStrings);
- Assert.AreEqual(0, record.NumUniqueStrings);
- Assert.AreEqual(0, record.CountStrings);
+ ClassicAssert.AreEqual(0, record.NumStrings);
+ ClassicAssert.AreEqual(0, record.NumUniqueStrings);
+ ClassicAssert.AreEqual(0, record.CountStrings);
byte[] output = record.Serialize();
byte[] expected =
{
@@ -356,10 +356,10 @@ public void TestSimpleConstructor()
(byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0
};
- Assert.AreEqual(expected.Length, output.Length);
+ ClassicAssert.AreEqual(expected.Length, output.Length);
for (int k = 0; k < expected.Length; k++)
{
- Assert.AreEqual(expected[k], output[k], k.ToString());
+ ClassicAssert.AreEqual(expected[k], output[k], k.ToString());
}
}
@@ -371,8 +371,8 @@ public void TestReadWriteDuplicatedRichText1()
{
IWorkbook wb = HSSFTestDataSamples.OpenSampleWorkbook("duprich1.xls");
ISheet sheet = wb.GetSheetAt(1);
- Assert.AreEqual("01/05 (Wed)", sheet.GetRow(0).GetCell(8).StringCellValue);
- Assert.AreEqual("01/05 (Wed)", sheet.GetRow(1).GetCell(8).StringCellValue);
+ ClassicAssert.AreEqual("01/05 (Wed)", sheet.GetRow(0).GetCell(8).StringCellValue);
+ ClassicAssert.AreEqual("01/05 (Wed)", sheet.GetRow(1).GetCell(8).StringCellValue);
HSSFTestDataSamples.WriteOutAndReadBack((HSSFWorkbook)wb).Close();
wb.Close();
@@ -380,12 +380,12 @@ public void TestReadWriteDuplicatedRichText1()
wb = HSSFTestDataSamples.OpenSampleWorkbook("duprich2.xls");
sheet = wb.GetSheetAt(0);
int row = 0;
- Assert.AreEqual("Testing", sheet.GetRow(row++).GetCell(0).StringCellValue);
- Assert.AreEqual("rich", sheet.GetRow(row++).GetCell(0).StringCellValue);
- Assert.AreEqual("text", sheet.GetRow(row++).GetCell(0).StringCellValue);
- Assert.AreEqual("strings", sheet.GetRow(row++).GetCell(0).StringCellValue);
- Assert.AreEqual("Testing", sheet.GetRow(row++).GetCell(0).StringCellValue);
- Assert.AreEqual("Testing", sheet.GetRow(row++).GetCell(0).StringCellValue);
+ ClassicAssert.AreEqual("Testing", sheet.GetRow(row++).GetCell(0).StringCellValue);
+ ClassicAssert.AreEqual("rich", sheet.GetRow(row++).GetCell(0).StringCellValue);
+ ClassicAssert.AreEqual("text", sheet.GetRow(row++).GetCell(0).StringCellValue);
+ ClassicAssert.AreEqual("strings", sheet.GetRow(row++).GetCell(0).StringCellValue);
+ ClassicAssert.AreEqual("Testing", sheet.GetRow(row++).GetCell(0).StringCellValue);
+ ClassicAssert.AreEqual("Testing", sheet.GetRow(row++).GetCell(0).StringCellValue);
HSSFTestDataSamples.WriteOutAndReadBack((HSSFWorkbook)wb).Close();
wb.Close();
@@ -1484,15 +1484,15 @@ public void TestReadWriteDuplicatedRichText1()
*/
private static void assertRecordEquals(SSTRecord expected, SSTRecord actual)
{
- Assert.AreEqual(expected.NumStrings, actual.NumStrings, "number of strings");
- Assert.AreEqual(expected.NumUniqueStrings, actual.NumUniqueStrings, "number of unique strings");
- Assert.AreEqual(expected.CountStrings, actual.CountStrings, "count of strings");
+ ClassicAssert.AreEqual(expected.NumStrings, actual.NumStrings, "number of strings");
+ ClassicAssert.AreEqual(expected.NumUniqueStrings, actual.NumUniqueStrings, "number of unique strings");
+ ClassicAssert.AreEqual(expected.CountStrings, actual.CountStrings, "count of strings");
for (int k = 0; k < expected.CountStrings; k++)
{
UnicodeString us1 = expected.GetString(k);
UnicodeString us2 = actual.GetString(k);
- Assert.IsTrue(us1.Equals(us2), "String at idx=" + k);
+ ClassicAssert.IsTrue(us1.Equals(us2), "String at idx=" + k);
}
}
@@ -1502,16 +1502,16 @@ public void Test50779_1()
byte[] bytes = HexRead.ReadFromString(data_50779_1);
RecordInputStream in1 = TestcaseRecordInputStream.Create(bytes);
- Assert.AreEqual(SSTRecord.sid, in1.Sid);
+ ClassicAssert.AreEqual(SSTRecord.sid, in1.Sid);
SSTRecord src = new SSTRecord(in1);
- Assert.AreEqual(81, src.NumStrings);
+ ClassicAssert.AreEqual(81, src.NumStrings);
byte[] Serialized = src.Serialize();
in1 = TestcaseRecordInputStream.Create(Serialized);
- Assert.AreEqual(SSTRecord.sid, in1.Sid);
+ ClassicAssert.AreEqual(SSTRecord.sid, in1.Sid);
SSTRecord dst = new SSTRecord(in1);
- Assert.AreEqual(81, dst.NumStrings);
+ ClassicAssert.AreEqual(81, dst.NumStrings);
assertRecordEquals(src, dst);
}
@@ -1521,16 +1521,16 @@ public void Test50779_2()
byte[] bytes = HexRead.ReadFromString(data_50779_2);
RecordInputStream in1 = TestcaseRecordInputStream.Create(bytes);
- Assert.AreEqual(SSTRecord.sid, in1.Sid);
+ ClassicAssert.AreEqual(SSTRecord.sid, in1.Sid);
SSTRecord src = new SSTRecord(in1);
- Assert.AreEqual(81, src.NumStrings);
+ ClassicAssert.AreEqual(81, src.NumStrings);
byte[] Serialized = src.Serialize();
in1 = TestcaseRecordInputStream.Create(Serialized);
- Assert.AreEqual(SSTRecord.sid, in1.Sid);
+ ClassicAssert.AreEqual(SSTRecord.sid, in1.Sid);
SSTRecord dst = new SSTRecord(in1);
- Assert.AreEqual(81, dst.NumStrings);
+ ClassicAssert.AreEqual(81, dst.NumStrings);
assertRecordEquals(src, dst);
}
diff --git a/testcases/main/HSSF/Record/TestSSTRecordSizeCalculator.cs b/testcases/main/HSSF/Record/TestSSTRecordSizeCalculator.cs
index b49b9938d..c789759d9 100644
--- a/testcases/main/HSSF/Record/TestSSTRecordSizeCalculator.cs
+++ b/testcases/main/HSSF/Record/TestSSTRecordSizeCalculator.cs
@@ -20,7 +20,7 @@ limitations under the License.
namespace TestCases.HSSF.Record
{
using System;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.Util.Collections;
using NPOI.HSSF.Record;
using NPOI.HSSF.Record.Cont;
@@ -134,7 +134,7 @@ private void ConfirmSize(int expectedSize)
ContinuableRecordOutput cro = ContinuableRecordOutput.CreateForCountingOnly();
SSTSerializer ss = new SSTSerializer(strings, 0, 0);
ss.Serialize(cro);
- Assert.AreEqual(expectedSize, cro.TotalSize);
+ ClassicAssert.AreEqual(expectedSize, cro.TotalSize);
}
}
diff --git a/testcases/main/HSSF/Record/TestSharedFormulaRecord.cs b/testcases/main/HSSF/Record/TestSharedFormulaRecord.cs
index d748795fb..812691a22 100644
--- a/testcases/main/HSSF/Record/TestSharedFormulaRecord.cs
+++ b/testcases/main/HSSF/Record/TestSharedFormulaRecord.cs
@@ -18,7 +18,7 @@ limitations under the License.
namespace TestCases.HSSF.Record
{
using System;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.Record;
using NPOI.HSSF.UserModel;
using NPOI.SS;
@@ -81,7 +81,7 @@ public void TestConvertSharedFormulasOperandClasses_bug45123()
Ptg[] ConvertedFormula = sf.ConvertSharedFormulas(sharedFormula, 100, 200);
RefPtg refPtg = (RefPtg)ConvertedFormula[1];
- Assert.AreEqual("$C101", refPtg.ToFormulaString());
+ ClassicAssert.AreEqual("$C101", refPtg.ToFormulaString());
if (refPtg.PtgClass == Ptg.CLASS_REF)
{
throw new AssertionException("Identified bug 45123");
@@ -92,7 +92,7 @@ public void TestConvertSharedFormulasOperandClasses_bug45123()
private static void ConfirmOperandClasses(Ptg[] originalPtgs, Ptg[] convertedPtg)
{
- Assert.AreEqual(originalPtgs.Length, convertedPtg.Length);
+ ClassicAssert.AreEqual(originalPtgs.Length, convertedPtg.Length);
for (int i = 0; i < convertedPtg.Length; i++)
{
Ptg originalPtg = originalPtgs[i];
@@ -117,30 +117,30 @@ public void TestConvertSharedFormulas()
ConvertedFormula = sf.ConvertSharedFormulas(sharedFormula, 0, 0);
ConfirmOperandClasses(sharedFormula, ConvertedFormula);
//conversion relative to [0,0] should return the original formula
- Assert.AreEqual(FormulaRenderer.ToFormulaString(fpb, ConvertedFormula), "A2");
+ ClassicAssert.AreEqual(FormulaRenderer.ToFormulaString(fpb, ConvertedFormula), "A2");
ConvertedFormula = sf.ConvertSharedFormulas(sharedFormula, 1, 0);
ConfirmOperandClasses(sharedFormula, ConvertedFormula);
//one row down
- Assert.AreEqual(FormulaRenderer.ToFormulaString(fpb, ConvertedFormula), "A3");
+ ClassicAssert.AreEqual(FormulaRenderer.ToFormulaString(fpb, ConvertedFormula), "A3");
ConvertedFormula = sf.ConvertSharedFormulas(sharedFormula, 1, 1);
ConfirmOperandClasses(sharedFormula, ConvertedFormula);
//one row down and one cell right
- Assert.AreEqual(FormulaRenderer.ToFormulaString(fpb, ConvertedFormula), "B3");
+ ClassicAssert.AreEqual(FormulaRenderer.ToFormulaString(fpb, ConvertedFormula), "B3");
sharedFormula = FormulaParser.Parse("SUM(A1:C1)", fpb, FormulaType.Cell, -1, -1);
ConvertedFormula = sf.ConvertSharedFormulas(sharedFormula, 0, 0);
ConfirmOperandClasses(sharedFormula, ConvertedFormula);
- Assert.AreEqual(FormulaRenderer.ToFormulaString(fpb, ConvertedFormula), "SUM(A1:C1)");
+ ClassicAssert.AreEqual(FormulaRenderer.ToFormulaString(fpb, ConvertedFormula), "SUM(A1:C1)");
ConvertedFormula = sf.ConvertSharedFormulas(sharedFormula, 1, 0);
ConfirmOperandClasses(sharedFormula, ConvertedFormula);
- Assert.AreEqual(FormulaRenderer.ToFormulaString(fpb, ConvertedFormula), "SUM(A2:C2)");
+ ClassicAssert.AreEqual(FormulaRenderer.ToFormulaString(fpb, ConvertedFormula), "SUM(A2:C2)");
ConvertedFormula = sf.ConvertSharedFormulas(sharedFormula, 1, 1);
ConfirmOperandClasses(sharedFormula, ConvertedFormula);
- Assert.AreEqual(FormulaRenderer.ToFormulaString(fpb, ConvertedFormula), "SUM(B2:D2)");
+ ClassicAssert.AreEqual(FormulaRenderer.ToFormulaString(fpb, ConvertedFormula), "SUM(B2:D2)");
}
/**
@@ -160,13 +160,13 @@ public void TestPreserveOnReSerialize()
cellB32769 = sheet.GetRow(32768).GetCell(1);
cellC32769 = sheet.GetRow(32768).GetCell(2);
// check Reading of formulas which are shared (two cells from a 1R x 8C range)
- Assert.AreEqual("B32770*2", cellB32769.CellFormula);
- Assert.AreEqual("C32770*2", cellC32769.CellFormula);
+ ClassicAssert.AreEqual("B32770*2", cellB32769.CellFormula);
+ ClassicAssert.AreEqual("C32770*2", cellC32769.CellFormula);
ConfirmCellEvaluation(wb, cellB32769, 4);
ConfirmCellEvaluation(wb, cellC32769, 6);
// Confirm this example really does have SharedFormulas.
// there are 3 others besides the one at A32769:H32769
- Assert.AreEqual(4, countSharedFormulas(sheet));
+ ClassicAssert.AreEqual(4, countSharedFormulas(sheet));
// Re-serialize and check again
@@ -174,9 +174,9 @@ public void TestPreserveOnReSerialize()
sheet = wb.GetSheetAt(0);
cellB32769 = sheet.GetRow(32768).GetCell(1);
cellC32769 = sheet.GetRow(32768).GetCell(2);
- Assert.AreEqual("B32770*2", cellB32769.CellFormula);
+ ClassicAssert.AreEqual("B32770*2", cellB32769.CellFormula);
ConfirmCellEvaluation(wb, cellB32769, 4);
- Assert.AreEqual(4, countSharedFormulas(sheet));
+ ClassicAssert.AreEqual(4, countSharedFormulas(sheet));
}
[Test]
public void TestUnshareFormulaDueToChangeFormula()
@@ -195,9 +195,9 @@ public void TestUnshareFormulaDueToChangeFormula()
cellB32769.CellFormula = (/*setter*/"1+1");
ConfirmCellEvaluation(wb, cellB32769, 2);
// currently (Oct 2008) POI handles this by exploding the whole shared formula group
- Assert.AreEqual(3, countSharedFormulas(sheet)); // one less now
+ ClassicAssert.AreEqual(3, countSharedFormulas(sheet)); // one less now
// check that nearby cell of the same group still has the same formula
- Assert.AreEqual("C32770*2", cellC32769.CellFormula);
+ ClassicAssert.AreEqual("C32770*2", cellC32769.CellFormula);
ConfirmCellEvaluation(wb, cellC32769, 6);
}
[Test]
@@ -212,35 +212,35 @@ public void TestUnshareFormulaDueToDelete()
wb = HSSFTestDataSamples.OpenSampleWorkbook(SHARED_FORMULA_TEST_XLS);
sheet = wb.GetSheetAt(0);
- Assert.AreEqual("A$1*2", sheet.GetRow(ROW_IX).GetCell(1).CellFormula);
+ ClassicAssert.AreEqual("A$1*2", sheet.GetRow(ROW_IX).GetCell(1).CellFormula);
cell = sheet.GetRow(ROW_IX).GetCell(1);
cell.SetCellType(CellType.Blank);
- Assert.AreEqual(3, countSharedFormulas(sheet));
+ ClassicAssert.AreEqual(3, countSharedFormulas(sheet));
wb = HSSFTestDataSamples.WriteOutAndReadBack(wb);
sheet = wb.GetSheetAt(0);
- Assert.AreEqual("A$1*2", sheet.GetRow(ROW_IX + 1).GetCell(1).CellFormula);
+ ClassicAssert.AreEqual("A$1*2", sheet.GetRow(ROW_IX + 1).GetCell(1).CellFormula);
// deleting shared formula cell
wb = HSSFTestDataSamples.OpenSampleWorkbook(SHARED_FORMULA_TEST_XLS);
sheet = wb.GetSheetAt(0);
- Assert.AreEqual("A$1*2", sheet.GetRow(ROW_IX).GetCell(1).CellFormula);
+ ClassicAssert.AreEqual("A$1*2", sheet.GetRow(ROW_IX).GetCell(1).CellFormula);
cell = sheet.GetRow(ROW_IX).GetCell(1);
sheet.GetRow(ROW_IX).RemoveCell(cell);
- Assert.AreEqual(3, countSharedFormulas(sheet));
+ ClassicAssert.AreEqual(3, countSharedFormulas(sheet));
wb = HSSFTestDataSamples.WriteOutAndReadBack(wb);
sheet = wb.GetSheetAt(0);
- Assert.AreEqual("A$1*2", sheet.GetRow(ROW_IX + 1).GetCell(1).CellFormula);
+ ClassicAssert.AreEqual("A$1*2", sheet.GetRow(ROW_IX + 1).GetCell(1).CellFormula);
}
private static void ConfirmCellEvaluation(IWorkbook wb, ICell cell, double expectedValue)
{
HSSFFormulaEvaluator fe = new HSSFFormulaEvaluator(wb);
CellValue cv = fe.Evaluate(cell);
- Assert.AreEqual(CellType.Numeric, cv.CellType);
- Assert.AreEqual(expectedValue, cv.NumberValue, 0.0);
+ ClassicAssert.AreEqual(CellType.Numeric, cv.CellType);
+ ClassicAssert.AreEqual(expectedValue, cv.NumberValue, 0.0);
}
/**
diff --git a/testcases/main/HSSF/Record/TestStringRecord.cs b/testcases/main/HSSF/Record/TestStringRecord.cs
index ad517e8f3..002bb7e55 100644
--- a/testcases/main/HSSF/Record/TestStringRecord.cs
+++ b/testcases/main/HSSF/Record/TestStringRecord.cs
@@ -19,7 +19,7 @@ namespace TestCases.HSSF.Record
{
using System;
using System.Text;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.Record;
using NPOI.Util;
@@ -42,9 +42,9 @@ public class TestStringRecord
public void TestLoad()
{
StringRecord record = new StringRecord(TestcaseRecordInputStream.Create(0x207, data));
- Assert.AreEqual("Fahrzeugtyp", record.String);
+ ClassicAssert.AreEqual("Fahrzeugtyp", record.String);
- Assert.AreEqual(18, record.RecordSize);
+ ClassicAssert.AreEqual(18, record.RecordSize);
}
[Test]
@@ -54,10 +54,10 @@ public void TestStore()
record.String = (/*setter*/"Fahrzeugtyp");
byte[] recordBytes = record.Serialize();
- Assert.AreEqual(recordBytes.Length - 4, data.Length);
+ ClassicAssert.AreEqual(recordBytes.Length - 4, data.Length);
for (int i = 0; i < data.Length; i++)
{
- Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
+ ClassicAssert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
}
}
@@ -77,30 +77,30 @@ public void TestContinue()
StringRecord sr = new StringRecord();
sr.String = (/*setter*/sb.ToString());
byte[] ser = sr.Serialize();
- Assert.AreEqual(StringRecord.sid, LittleEndian.GetUShort(ser, 0));
+ ClassicAssert.AreEqual(StringRecord.sid, LittleEndian.GetUShort(ser, 0));
if (LittleEndian.GetUShort(ser, 2) > MAX_BIFF_DATA)
{
Assert.Fail("StringRecord should have been split with a continue record");
}
// Confirm expected size of first record, and ushort strLen.
- Assert.AreEqual(MAX_BIFF_DATA, LittleEndian.GetUShort(ser, 2));
- Assert.AreEqual(TEXT_LEN, LittleEndian.GetUShort(ser, 4));
+ ClassicAssert.AreEqual(MAX_BIFF_DATA, LittleEndian.GetUShort(ser, 2));
+ ClassicAssert.AreEqual(TEXT_LEN, LittleEndian.GetUShort(ser, 4));
// Confirm first few bytes of ContinueRecord
LittleEndianByteArrayInputStream crIn = new LittleEndianByteArrayInputStream(ser, (MAX_BIFF_DATA + 4));
int nCharsInFirstRec = MAX_BIFF_DATA - (2 + 1); // strLen, optionFlags
int nCharsInSecondRec = TEXT_LEN - nCharsInFirstRec;
- Assert.AreEqual(ContinueRecord.sid, crIn.ReadUShort());
- Assert.AreEqual(1 + nCharsInSecondRec, crIn.ReadUShort());
- Assert.AreEqual(0, crIn.ReadUByte());
- Assert.AreEqual('N', crIn.ReadUByte());
- Assert.AreEqual('O', crIn.ReadUByte());
+ ClassicAssert.AreEqual(ContinueRecord.sid, crIn.ReadUShort());
+ ClassicAssert.AreEqual(1 + nCharsInSecondRec, crIn.ReadUShort());
+ ClassicAssert.AreEqual(0, crIn.ReadUByte());
+ ClassicAssert.AreEqual('N', crIn.ReadUByte());
+ ClassicAssert.AreEqual('O', crIn.ReadUByte());
// re-read and make sure string value is the same
RecordInputStream in1 = TestcaseRecordInputStream.Create(ser);
StringRecord sr2 = new StringRecord(in1);
- Assert.AreEqual(sb.ToString(), sr2.String);
+ ClassicAssert.AreEqual(sb.ToString(), sr2.String);
}
}
diff --git a/testcases/main/HSSF/Record/TestStyleRecord.cs b/testcases/main/HSSF/Record/TestStyleRecord.cs
index 3646952b8..9d11fa208 100644
--- a/testcases/main/HSSF/Record/TestStyleRecord.cs
+++ b/testcases/main/HSSF/Record/TestStyleRecord.cs
@@ -18,7 +18,7 @@ limitations under the License.
namespace TestCases.HSSF.Record
{
using System;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.Record;
using NPOI.Util;
@@ -35,7 +35,7 @@ public void TestUnicodeReadName()
"11 00 09 00 01 38 5E C4 89 5F 00 53 00 68 00 65 00 65 00 74 00 31 00");
RecordInputStream in1 = TestcaseRecordInputStream.Create(StyleRecord.sid, data);
StyleRecord sr = new StyleRecord(in1);
- Assert.AreEqual("\u5E38\u89C4_Sheet1", sr.Name); // "_Sheet1"
+ ClassicAssert.AreEqual("\u5E38\u89C4_Sheet1", sr.Name); // "_Sheet1"
byte[] ser;
try
{
diff --git a/testcases/main/HSSF/Record/TestSubRecord.cs b/testcases/main/HSSF/Record/TestSubRecord.cs
index fc8d934b2..5cdd206c1 100644
--- a/testcases/main/HSSF/Record/TestSubRecord.cs
+++ b/testcases/main/HSSF/Record/TestSubRecord.cs
@@ -19,7 +19,7 @@ limitations under the License.
namespace TestCases.HSSF.Record
{
using System;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.Util;
using TestCases.HSSF.Record;
@@ -83,8 +83,8 @@ public void TestReadAll_bug45778()
{
throw new AssertionException("Identified bug 45778");
}
- Assert.AreEqual(74, data2.Length);
- Assert.IsTrue(Arrays.Equals(dataAutoFilter, data2));
+ ClassicAssert.AreEqual(74, data2.Length);
+ ClassicAssert.IsTrue(Arrays.Equals(dataAutoFilter, data2));
}
[Test]
public void TestReadManualComboWithFormula()
@@ -107,7 +107,7 @@ public void TestReadManualComboWithFormula()
{
throw new AssertionException("Identified bug 45778");
}
- Assert.AreEqual(data.Length, data2.Length, "Encoded length");
+ ClassicAssert.AreEqual(data.Length, data2.Length, "Encoded length");
for (int i = 0; i < data.Length; i++)
{
if (data[i] != data2[i])
@@ -115,7 +115,7 @@ public void TestReadManualComboWithFormula()
throw new AssertionException("Encoded data differs at index " + i);
}
}
- Assert.IsTrue(Arrays.Equals(data, data2));
+ ClassicAssert.IsTrue(Arrays.Equals(data, data2));
}
/**
@@ -146,8 +146,8 @@ public void TestWayTooMuchPAdding_bug46545()
);
int LBS_START_POS = 0x002E;
int WRONG_LBS_SIZE = 0x1FEE;
- Assert.AreEqual(0x0013, LittleEndian.GetShort(data, LBS_START_POS + 0));
- Assert.AreEqual(WRONG_LBS_SIZE, LittleEndian.GetShort(data, LBS_START_POS + 2));
+ ClassicAssert.AreEqual(0x0013, LittleEndian.GetShort(data, LBS_START_POS + 0));
+ ClassicAssert.AreEqual(WRONG_LBS_SIZE, LittleEndian.GetShort(data, LBS_START_POS + 2));
int wrongTotalSize = LBS_START_POS + 4 + WRONG_LBS_SIZE;
byte[] wrongData = new byte[wrongTotalSize];
Array.Copy(data, 0, wrongData, 0, data.Length);
diff --git a/testcases/main/HSSF/Record/TestSupBookRecord.cs b/testcases/main/HSSF/Record/TestSupBookRecord.cs
index d9ed76eab..a157d488a 100644
--- a/testcases/main/HSSF/Record/TestSupBookRecord.cs
+++ b/testcases/main/HSSF/Record/TestSupBookRecord.cs
@@ -23,7 +23,7 @@ namespace TestCases.HSSF.Record
using System;
using NPOI.HSSF.Record;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
* Tests the serialization and deserialization of the SupBook record
@@ -66,10 +66,10 @@ public void TestLoadIR()
{
SupBookRecord record = new SupBookRecord(TestcaseRecordInputStream.Create(0x01AE, dataIR));
- Assert.IsTrue(record.IsInternalReferences); //expected flag
- Assert.AreEqual(0x4, record.NumberOfSheets); //expected # of sheets
+ ClassicAssert.IsTrue(record.IsInternalReferences); //expected flag
+ ClassicAssert.AreEqual(0x4, record.NumberOfSheets); //expected # of sheets
- Assert.AreEqual(8, record.RecordSize); //sid+size+data
+ ClassicAssert.AreEqual(8, record.RecordSize); //sid+size+data
}
/**
* tests that we can load the record
@@ -79,16 +79,16 @@ public void TestLoadER()
{
SupBookRecord record = new SupBookRecord(TestcaseRecordInputStream.Create(0x01AE, dataER));
- Assert.IsTrue(record.IsExternalReferences); //expected flag
- Assert.AreEqual(0x2, record.NumberOfSheets); //expected # of sheets
+ ClassicAssert.IsTrue(record.IsExternalReferences); //expected flag
+ ClassicAssert.AreEqual(0x2, record.NumberOfSheets); //expected # of sheets
- Assert.AreEqual(34, record.RecordSize); //sid+size+data
+ ClassicAssert.AreEqual(34, record.RecordSize); //sid+size+data
- Assert.AreEqual("testURL", record.URL);
+ ClassicAssert.AreEqual("testURL", record.URL);
String[] sheetNames = record.SheetNames;
- Assert.AreEqual(2, sheetNames.Length);
- Assert.AreEqual("Sheet1", sheetNames[0]);
- Assert.AreEqual("Sheet2", sheetNames[1]);
+ ClassicAssert.AreEqual(2, sheetNames.Length);
+ ClassicAssert.AreEqual("Sheet1", sheetNames[0]);
+ ClassicAssert.AreEqual("Sheet2", sheetNames[1]);
}
/**
@@ -99,9 +99,9 @@ public void TestLoadAIF()
{
SupBookRecord record = new SupBookRecord(TestcaseRecordInputStream.Create(0x01AE, dataAIF));
- Assert.IsTrue(record.IsAddInFunctions); //expected flag
- Assert.AreEqual(0x1, record.NumberOfSheets); //expected # of sheets
- Assert.AreEqual(8, record.RecordSize); //sid+size+data
+ ClassicAssert.IsTrue(record.IsAddInFunctions); //expected flag
+ ClassicAssert.AreEqual(0x1, record.NumberOfSheets); //expected # of sheets
+ ClassicAssert.AreEqual(8, record.RecordSize); //sid+size+data
}
/**
@@ -133,39 +133,39 @@ public void TestExternalReferenceUrl()
SupBookRecord record;
record = new SupBookRecord(startMarker + "test.xls", sheetNames);
- Assert.AreEqual("test.xls", record.URL);
+ ClassicAssert.AreEqual("test.xls", record.URL);
//UNC path notation
record = new SupBookRecord(startMarker + "" + SupBookRecord.CH_VOLUME + "@servername" + SupBookRecord.CH_DOWN_DIR + "test.xls", sheetNames);
- Assert.AreEqual("\\\\servername" + SupBookRecord.PATH_SEPERATOR + "test.xls", record.URL);
+ ClassicAssert.AreEqual("\\\\servername" + SupBookRecord.PATH_SEPERATOR + "test.xls", record.URL);
//Absolute path notation - different device
record = new SupBookRecord(startMarker + "" + SupBookRecord.CH_VOLUME + "D" + SupBookRecord.CH_DOWN_DIR + "test.xls", sheetNames);
- Assert.AreEqual("D:" + SupBookRecord.PATH_SEPERATOR + "test.xls", record.URL);
+ ClassicAssert.AreEqual("D:" + SupBookRecord.PATH_SEPERATOR + "test.xls", record.URL);
//Absolute path notation - same device
record = new SupBookRecord(startMarker + "" + SupBookRecord.CH_SAME_VOLUME + "folder" + SupBookRecord.CH_DOWN_DIR + "test.xls", sheetNames);
- Assert.AreEqual(SupBookRecord.PATH_SEPERATOR + "folder" + SupBookRecord.PATH_SEPERATOR + "test.xls", record.URL);
+ ClassicAssert.AreEqual(SupBookRecord.PATH_SEPERATOR + "folder" + SupBookRecord.PATH_SEPERATOR + "test.xls", record.URL);
//Relative path notation - down
record = new SupBookRecord(startMarker + "folder" + SupBookRecord.CH_DOWN_DIR + "test.xls", sheetNames);
- Assert.AreEqual("folder" + SupBookRecord.PATH_SEPERATOR + "test.xls", record.URL);
+ ClassicAssert.AreEqual("folder" + SupBookRecord.PATH_SEPERATOR + "test.xls", record.URL);
//Relative path notation - up
record = new SupBookRecord(startMarker + "" + SupBookRecord.CH_UP_DIR + "test.xls", sheetNames);
- Assert.AreEqual(".." + SupBookRecord.PATH_SEPERATOR + "test.xls", record.URL);
+ ClassicAssert.AreEqual(".." + SupBookRecord.PATH_SEPERATOR + "test.xls", record.URL);
//Relative path notation - for EXCEL.exe - fallback
record = new SupBookRecord(startMarker + "" + SupBookRecord.CH_STARTUP_DIR + "test.xls", sheetNames);
- Assert.AreEqual("." + SupBookRecord.PATH_SEPERATOR + "test.xls", record.URL);
+ ClassicAssert.AreEqual("." + SupBookRecord.PATH_SEPERATOR + "test.xls", record.URL);
//Relative path notation - for EXCEL lib folder - fallback
record = new SupBookRecord(startMarker + "" + SupBookRecord.CH_LIB_DIR + "test.xls", sheetNames);
- Assert.AreEqual("." + SupBookRecord.PATH_SEPERATOR + "test.xls", record.URL);
+ ClassicAssert.AreEqual("." + SupBookRecord.PATH_SEPERATOR + "test.xls", record.URL);
//Relative path notation - for alternative EXCEL.exe - fallback
record = new SupBookRecord(startMarker + "" + SupBookRecord.CH_ALT_STARTUP_DIR + "test.xls", sheetNames);
- Assert.AreEqual("." + SupBookRecord.PATH_SEPERATOR + "test.xls", record.URL);
+ ClassicAssert.AreEqual("." + SupBookRecord.PATH_SEPERATOR + "test.xls", record.URL);
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/Record/TestTableRecord.cs b/testcases/main/HSSF/Record/TestTableRecord.cs
index 7c11a9977..47252b28d 100644
--- a/testcases/main/HSSF/Record/TestTableRecord.cs
+++ b/testcases/main/HSSF/Record/TestTableRecord.cs
@@ -21,7 +21,7 @@ namespace TestCases.HSSF.Record
using NPOI.HSSF.Util;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.SS.Util;
using TestCases.HSSF.Record;
using NPOI.HSSF.Record;
@@ -55,17 +55,17 @@ public void TestLoad()
TableRecord record = new TableRecord(TestcaseRecordInputStream.Create(0x236, data));
CellRangeAddress8Bit range = record.Range;
- Assert.AreEqual(3, range.FirstRow);
- Assert.AreEqual(8, range.LastRow);
- Assert.AreEqual(4, range.FirstColumn);
- Assert.AreEqual(6, range.LastColumn);
- Assert.AreEqual(0, record.Flags);
- Assert.AreEqual(4, record.RowInputRow);
- Assert.AreEqual(1, record.ColInputRow);
- Assert.AreEqual(0x4076, record.RowInputCol);
- Assert.AreEqual(0, record.ColInputCol);
+ ClassicAssert.AreEqual(3, range.FirstRow);
+ ClassicAssert.AreEqual(8, range.LastRow);
+ ClassicAssert.AreEqual(4, range.FirstColumn);
+ ClassicAssert.AreEqual(6, range.LastColumn);
+ ClassicAssert.AreEqual(0, record.Flags);
+ ClassicAssert.AreEqual(4, record.RowInputRow);
+ ClassicAssert.AreEqual(1, record.ColInputRow);
+ ClassicAssert.AreEqual(0x4076, record.RowInputCol);
+ ClassicAssert.AreEqual(0, record.ColInputCol);
- Assert.AreEqual(16 + 4, record.RecordSize);
+ ClassicAssert.AreEqual(16 + 4, record.RecordSize);
}
[Test]
public void TestStore()
@@ -95,9 +95,9 @@ public void TestStore()
record.ColInputCol = (/*setter*/0);
byte[] recordBytes = record.Serialize();
- Assert.AreEqual(recordBytes.Length - 4, data.Length);
+ ClassicAssert.AreEqual(recordBytes.Length - 4, data.Length);
for (int i = 0; i < data.Length; i++)
- Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
+ ClassicAssert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
}
}
diff --git a/testcases/main/HSSF/Record/TestTextObjectBaseRecord.cs b/testcases/main/HSSF/Record/TestTextObjectBaseRecord.cs
index c961ece21..49895afcc 100644
--- a/testcases/main/HSSF/Record/TestTextObjectBaseRecord.cs
+++ b/testcases/main/HSSF/Record/TestTextObjectBaseRecord.cs
@@ -23,7 +23,7 @@ namespace TestCases.HSSF.Record
using System;
using NPOI.HSSF.Record;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.UserModel;
using NPOI.SS.UserModel;
using NPOI.Util;
@@ -63,13 +63,13 @@ public class TestTextObjectBaseRecord
public void TestLoad()
{
TextObjectRecord record = new TextObjectRecord(TestcaseRecordInputStream.Create(data));
- Assert.AreEqual(HorizontalTextAlignment.Center, record.HorizontalTextAlignment);
- Assert.AreEqual(VerticalTextAlignment.Justify, record.VerticalTextAlignment);
- Assert.AreEqual(true, record.IsTextLocked);
- Assert.AreEqual(TextOrientation.RotRight, record.TextOrientation);
+ ClassicAssert.AreEqual(HorizontalTextAlignment.Center, record.HorizontalTextAlignment);
+ ClassicAssert.AreEqual(VerticalTextAlignment.Justify, record.VerticalTextAlignment);
+ ClassicAssert.AreEqual(true, record.IsTextLocked);
+ ClassicAssert.AreEqual(TextOrientation.RotRight, record.TextOrientation);
- Assert.AreEqual(49, record.RecordSize);
+ ClassicAssert.AreEqual(49, record.RecordSize);
}
[Test]
@@ -87,9 +87,9 @@ public void TestStore()
record.Str = (str);
byte[] recordBytes = record.Serialize();
- Assert.AreEqual(recordBytes.Length, data.Length);
+ ClassicAssert.AreEqual(recordBytes.Length, data.Length);
for (int i = 0; i < data.Length; i++)
- Assert.AreEqual(data[i], recordBytes[i], "At offset " + i);
+ ClassicAssert.AreEqual(data[i], recordBytes[i], "At offset " + i);
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/Record/TestTextObjectRecord.cs b/testcases/main/HSSF/Record/TestTextObjectRecord.cs
index f4504cabb..c347b4821 100644
--- a/testcases/main/HSSF/Record/TestTextObjectRecord.cs
+++ b/testcases/main/HSSF/Record/TestTextObjectRecord.cs
@@ -20,7 +20,7 @@ namespace TestCases.HSSF.Record
using System;
using System.IO;
using System.Text;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.UserModel;
using NPOI.SS.Formula.PTG;
using NPOI.SS.UserModel;
@@ -56,12 +56,12 @@ public void TestRead()
RecordInputStream is1 = TestcaseRecordInputStream.Create(simpleData);
TextObjectRecord record = new TextObjectRecord(is1);
- Assert.AreEqual(TextObjectRecord.sid, record.Sid);
- Assert.AreEqual(HorizontalTextAlignment.Left, record.HorizontalTextAlignment);
- Assert.AreEqual(VerticalTextAlignment.Top, record.VerticalTextAlignment);
- Assert.IsTrue(record.IsTextLocked);
- Assert.AreEqual(TextOrientation.None, record.TextOrientation);
- Assert.AreEqual("Hello, World!", record.Str.String);
+ ClassicAssert.AreEqual(TextObjectRecord.sid, record.Sid);
+ ClassicAssert.AreEqual(HorizontalTextAlignment.Left, record.HorizontalTextAlignment);
+ ClassicAssert.AreEqual(VerticalTextAlignment.Top, record.VerticalTextAlignment);
+ ClassicAssert.IsTrue(record.IsTextLocked);
+ ClassicAssert.AreEqual(TextOrientation.None, record.TextOrientation);
+ ClassicAssert.AreEqual("Hello, World!", record.Str.String);
}
[Test]
public void TestWrite()
@@ -76,9 +76,9 @@ public void TestWrite()
record.TextOrientation = (/*setter*/ TextOrientation.None);
byte[] ser = record.Serialize();
- Assert.AreEqual(ser.Length, simpleData.Length);
+ ClassicAssert.AreEqual(ser.Length, simpleData.Length);
- Assert.IsTrue(Arrays.Equals(simpleData, ser));
+ ClassicAssert.IsTrue(Arrays.Equals(simpleData, ser));
//read again
RecordInputStream is1 = TestcaseRecordInputStream.Create(simpleData);
@@ -99,14 +99,14 @@ public void TestWriteEmpty()
byte[] ser = record.Serialize();
int formatDataLen = LittleEndian.GetUShort(ser, 16);
- Assert.AreEqual(0, formatDataLen, "formatDataLength");
+ ClassicAssert.AreEqual(0, formatDataLen, "formatDataLength");
- Assert.AreEqual(22, ser.Length); // just the TXO record
+ ClassicAssert.AreEqual(22, ser.Length); // just the TXO record
//read again
RecordInputStream is1 = TestcaseRecordInputStream.Create(ser);
record = new TextObjectRecord(is1);
- Assert.AreEqual(0, record.Str.Length);
+ ClassicAssert.AreEqual(0, record.Str.Length);
}
/**
@@ -134,8 +134,8 @@ public void TestLongRecords()
TextObjectRecord record = new TextObjectRecord(is1);
str = record.Str;
- Assert.AreEqual(buff.Length, str.Length);
- Assert.AreEqual(buff.ToString(), str.String);
+ ClassicAssert.AreEqual(buff.Length, str.Length);
+ ClassicAssert.AreEqual(buff.ToString(), str.String);
}
}
@@ -153,14 +153,14 @@ public void TestClone()
TextObjectRecord Cloned = (TextObjectRecord)obj.Clone();
- Assert.AreEqual(obj.RecordSize, Cloned.RecordSize);
- Assert.AreEqual(obj.HorizontalTextAlignment, Cloned.HorizontalTextAlignment);
- Assert.AreEqual(obj.Str.String, Cloned.Str.String);
+ ClassicAssert.AreEqual(obj.RecordSize, Cloned.RecordSize);
+ ClassicAssert.AreEqual(obj.HorizontalTextAlignment, Cloned.HorizontalTextAlignment);
+ ClassicAssert.AreEqual(obj.Str.String, Cloned.Str.String);
//finally check that the Serialized data is the same
byte[] src = obj.Serialize();
byte[] cln = Cloned.Serialize();
- Assert.IsTrue(Arrays.Equals(src, cln));
+ ClassicAssert.IsTrue(Arrays.Equals(src, cln));
}
/** similar to {@link #simpleData} but with link formula at end of TXO rec*/
@@ -196,14 +196,14 @@ public void TestLinkFormula()
TextObjectRecord rec = new TextObjectRecord(is1);
Ptg ptg = rec.LinkRefPtg;
- Assert.IsNotNull(ptg);
- Assert.AreEqual(typeof(RefPtg), ptg.GetType());
+ ClassicAssert.IsNotNull(ptg);
+ ClassicAssert.AreEqual(typeof(RefPtg), ptg.GetType());
RefPtg rptg = (RefPtg)ptg;
- Assert.AreEqual("T2", rptg.ToFormulaString());
+ ClassicAssert.AreEqual("T2", rptg.ToFormulaString());
byte[] data2 = rec.Serialize();
- Assert.AreEqual(linkData.Length, data2.Length);
- Assert.IsTrue(Arrays.Equals(linkData, data2));
+ ClassicAssert.AreEqual(linkData.Length, data2.Length);
+ ClassicAssert.IsTrue(Arrays.Equals(linkData, data2));
}
}
}
diff --git a/testcases/main/HSSF/Record/TestUnicodeNameRecord.cs b/testcases/main/HSSF/Record/TestUnicodeNameRecord.cs
index 70b87774e..a8690c33f 100644
--- a/testcases/main/HSSF/Record/TestUnicodeNameRecord.cs
+++ b/testcases/main/HSSF/Record/TestUnicodeNameRecord.cs
@@ -19,7 +19,7 @@ namespace TestCases.HSSF.Record
{
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using TestCases.HSSF;
using NPOI.HSSF.UserModel;
diff --git a/testcases/main/HSSF/Record/TestUnicodeString.cs b/testcases/main/HSSF/Record/TestUnicodeString.cs
index 903377f41..67f422ee8 100644
--- a/testcases/main/HSSF/Record/TestUnicodeString.cs
+++ b/testcases/main/HSSF/Record/TestUnicodeString.cs
@@ -21,7 +21,7 @@ namespace TestCases.HSSF.Record
{
using System;
using NPOI.HSSF.Record;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.Record.Cont;
using System.Text;
using System.IO;
@@ -150,8 +150,8 @@ public void TestPerfectContinuedStringSize()
public void TestFormatRun()
{
UnicodeString.FormatRun fr = new UnicodeString.FormatRun((short)4, (short)0x15c);
- Assert.AreEqual(4, fr.CharacterPos);
- Assert.AreEqual(0x15c, fr.FontIndex);
+ ClassicAssert.AreEqual(4, fr.CharacterPos);
+ ClassicAssert.AreEqual(0x15c, fr.FontIndex);
MemoryStream baos = new MemoryStream();
LittleEndianOutputStream out1 = new LittleEndianOutputStream(baos);
@@ -159,18 +159,18 @@ public void TestFormatRun()
fr.Serialize(out1);
byte[] b = baos.ToArray();
- Assert.AreEqual(4, b.Length);
- Assert.AreEqual(4, b[0]);
- Assert.AreEqual(0, b[1]);
- Assert.AreEqual(0x5c, b[2]);
- Assert.AreEqual(0x01, b[3]);
+ ClassicAssert.AreEqual(4, b.Length);
+ ClassicAssert.AreEqual(4, b[0]);
+ ClassicAssert.AreEqual(0, b[1]);
+ ClassicAssert.AreEqual(0x5c, b[2]);
+ ClassicAssert.AreEqual(0x01, b[3]);
LittleEndianInputStream inp = new LittleEndianInputStream(
new MemoryStream(b)
);
fr = new UnicodeString.FormatRun(inp);
- Assert.AreEqual(4, fr.CharacterPos);
- Assert.AreEqual(0x15c, fr.FontIndex);
+ ClassicAssert.AreEqual(4, fr.CharacterPos);
+ ClassicAssert.AreEqual(0x15c, fr.FontIndex);
}
[Test]
@@ -178,12 +178,12 @@ public void TestExtRstFromEmpty()
{
UnicodeString.ExtRst ext = new UnicodeString.ExtRst();
- Assert.AreEqual(0, ext.NumberOfRuns);
- Assert.AreEqual(0, ext.FormattingFontIndex);
- Assert.AreEqual(0, ext.FormattingOptions);
- Assert.AreEqual("", ext.PhoneticText);
- Assert.AreEqual(0, ext.PhRuns.Length);
- Assert.AreEqual(10, ext.DataSize); // Excludes 4 byte header
+ ClassicAssert.AreEqual(0, ext.NumberOfRuns);
+ ClassicAssert.AreEqual(0, ext.FormattingFontIndex);
+ ClassicAssert.AreEqual(0, ext.FormattingOptions);
+ ClassicAssert.AreEqual("", ext.PhoneticText);
+ ClassicAssert.AreEqual(0, ext.PhRuns.Length);
+ ClassicAssert.AreEqual(10, ext.DataSize); // Excludes 4 byte header
MemoryStream baos = new MemoryStream();
LittleEndianOutputStream out1 = new LittleEndianOutputStream(baos);
@@ -193,37 +193,37 @@ public void TestExtRstFromEmpty()
cout.WriteContinue();
byte[] b = baos.ToArray();
- Assert.AreEqual(20, b.Length);
+ ClassicAssert.AreEqual(20, b.Length);
// First 4 bytes from the outputstream
- Assert.AreEqual((sbyte)-1, (sbyte)b[0]);
- Assert.AreEqual((sbyte)-1, (sbyte)b[1]);
- Assert.AreEqual(14, b[2]);
- Assert.AreEqual(00, b[3]);
+ ClassicAssert.AreEqual((sbyte)-1, (sbyte)b[0]);
+ ClassicAssert.AreEqual((sbyte)-1, (sbyte)b[1]);
+ ClassicAssert.AreEqual(14, b[2]);
+ ClassicAssert.AreEqual(00, b[3]);
// Reserved
- Assert.AreEqual(1, b[4]);
- Assert.AreEqual(0, b[5]);
+ ClassicAssert.AreEqual(1, b[4]);
+ ClassicAssert.AreEqual(0, b[5]);
// Data size
- Assert.AreEqual(10, b[6]);
- Assert.AreEqual(00, b[7]);
+ ClassicAssert.AreEqual(10, b[6]);
+ ClassicAssert.AreEqual(00, b[7]);
// Font*2
- Assert.AreEqual(0, b[8]);
- Assert.AreEqual(0, b[9]);
- Assert.AreEqual(0, b[10]);
- Assert.AreEqual(0, b[11]);
+ ClassicAssert.AreEqual(0, b[8]);
+ ClassicAssert.AreEqual(0, b[9]);
+ ClassicAssert.AreEqual(0, b[10]);
+ ClassicAssert.AreEqual(0, b[11]);
// 0 Runs
- Assert.AreEqual(0, b[12]);
- Assert.AreEqual(0, b[13]);
+ ClassicAssert.AreEqual(0, b[12]);
+ ClassicAssert.AreEqual(0, b[13]);
// Size=0, *2
- Assert.AreEqual(0, b[14]);
- Assert.AreEqual(0, b[15]);
- Assert.AreEqual(0, b[16]);
- Assert.AreEqual(0, b[17]);
+ ClassicAssert.AreEqual(0, b[14]);
+ ClassicAssert.AreEqual(0, b[15]);
+ ClassicAssert.AreEqual(0, b[16]);
+ ClassicAssert.AreEqual(0, b[17]);
// Last 2 bytes from the outputstream
- Assert.AreEqual(ContinueRecord.sid, b[18]);
- Assert.AreEqual(0, b[19]);
+ ClassicAssert.AreEqual(ContinueRecord.sid, b[18]);
+ ClassicAssert.AreEqual(0, b[19]);
// Load in again and re-test
@@ -234,11 +234,11 @@ public void TestExtRstFromEmpty()
);
ext = new UnicodeString.ExtRst(inp, data.Length);
- Assert.AreEqual(0, ext.NumberOfRuns);
- Assert.AreEqual(0, ext.FormattingFontIndex);
- Assert.AreEqual(0, ext.FormattingOptions);
- Assert.AreEqual("", ext.PhoneticText);
- Assert.AreEqual(0, ext.PhRuns.Length);
+ ClassicAssert.AreEqual(0, ext.NumberOfRuns);
+ ClassicAssert.AreEqual(0, ext.FormattingFontIndex);
+ ClassicAssert.AreEqual(0, ext.FormattingOptions);
+ ClassicAssert.AreEqual("", ext.PhoneticText);
+ ClassicAssert.AreEqual(0, ext.PhRuns.Length);
}
[Test]
@@ -251,19 +251,19 @@ public void TestExtRstFromData()
00, 00, 00, 00,
00, 00 // Cruft at the end, as found from real files
};
- Assert.AreEqual(16, data.Length);
+ ClassicAssert.AreEqual(16, data.Length);
LittleEndianInputStream inp = new LittleEndianInputStream(
new MemoryStream(data)
);
UnicodeString.ExtRst ext = new UnicodeString.ExtRst(inp, data.Length);
- Assert.AreEqual(0x0c, ext.DataSize); // Excludes 4 byte header
+ ClassicAssert.AreEqual(0x0c, ext.DataSize); // Excludes 4 byte header
- Assert.AreEqual(0, ext.NumberOfRuns);
- Assert.AreEqual(0x37, ext.FormattingOptions);
- Assert.AreEqual(0, ext.FormattingFontIndex);
- Assert.AreEqual("", ext.PhoneticText);
- Assert.AreEqual(0, ext.PhRuns.Length);
+ ClassicAssert.AreEqual(0, ext.NumberOfRuns);
+ ClassicAssert.AreEqual(0x37, ext.FormattingOptions);
+ ClassicAssert.AreEqual(0, ext.FormattingFontIndex);
+ ClassicAssert.AreEqual("", ext.PhoneticText);
+ ClassicAssert.AreEqual(0, ext.PhRuns.Length);
}
[Test]
@@ -273,7 +273,7 @@ public void TestCorruptExtRstDetection()
0x79, 0x79, 0x11, 0x11,
0x22, 0x22, 0x33, 0x33,
};
- Assert.AreEqual(8, data.Length);
+ ClassicAssert.AreEqual(8, data.Length);
LittleEndianInputStream inp = new LittleEndianInputStream(
new MemoryStream(data)
@@ -281,17 +281,17 @@ public void TestCorruptExtRstDetection()
UnicodeString.ExtRst ext = new UnicodeString.ExtRst(inp, data.Length);
// Will be empty
- Assert.AreEqual(ext, new UnicodeString.ExtRst());
+ ClassicAssert.AreEqual(ext, new UnicodeString.ExtRst());
// If written, will be the usual size
- Assert.AreEqual(10, ext.DataSize); // Excludes 4 byte header
+ ClassicAssert.AreEqual(10, ext.DataSize); // Excludes 4 byte header
// Is empty
- Assert.AreEqual(0, ext.NumberOfRuns);
- Assert.AreEqual(0, ext.FormattingOptions);
- Assert.AreEqual(0, ext.FormattingFontIndex);
- Assert.AreEqual("", ext.PhoneticText);
- Assert.AreEqual(0, ext.PhRuns.Length);
+ ClassicAssert.AreEqual(0, ext.NumberOfRuns);
+ ClassicAssert.AreEqual(0, ext.FormattingOptions);
+ ClassicAssert.AreEqual(0, ext.FormattingFontIndex);
+ ClassicAssert.AreEqual("", ext.PhoneticText);
+ ClassicAssert.AreEqual(0, ext.PhRuns.Length);
}
[Test]
public void TestExtRstEqualsAndHashCode()
@@ -317,8 +317,8 @@ public void TestExtRstEqualsAndHashCode()
in1 = new LittleEndianByteArrayInputStream(buf, 0, bos.WriteIndex);
UnicodeString.ExtRst extRst2 = new UnicodeString.ExtRst(in1, bos.WriteIndex);
- Assert.AreEqual(extRst1, extRst2);
- Assert.AreEqual(extRst1.GetHashCode(), extRst2.GetHashCode());
+ ClassicAssert.AreEqual(extRst1, extRst2);
+ ClassicAssert.AreEqual(extRst1.GetHashCode(), extRst2.GetHashCode());
}
private static void ConfirmSize(int expectedSize, UnicodeString s)
@@ -343,7 +343,7 @@ private static void ConfirmSize(int expectedSize, UnicodeString s, int amountUse
s.Serialize(out1);
int size1 = out1.TotalSize;
int actualSize = size1 - size0;
- Assert.AreEqual(expectedSize, actualSize);
+ ClassicAssert.AreEqual(expectedSize, actualSize);
}
private static UnicodeString MakeUnicodeString(String s)
diff --git a/testcases/main/HSSF/Record/TestWriteAccessRecord.cs b/testcases/main/HSSF/Record/TestWriteAccessRecord.cs
index f63d9f028..c917c5f9c 100644
--- a/testcases/main/HSSF/Record/TestWriteAccessRecord.cs
+++ b/testcases/main/HSSF/Record/TestWriteAccessRecord.cs
@@ -20,7 +20,7 @@ namespace TestCases.HSSF.Record
using System;
using NPOI.Util;
using TestCases.HSSF.Record;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.Record;
@@ -69,7 +69,7 @@ public void TestMissingStringHeader_bug47001a()
}
throw e;
}
- Assert.AreEqual("Java Excel API v2.6.4", rec.Username);
+ ClassicAssert.AreEqual("Java Excel API v2.6.4", rec.Username);
byte[] expectedEncoding = HexRead.ReadFromString(""
@@ -100,7 +100,7 @@ public void TestshortRecordWrittenByMSAccess()
RecordInputStream in1 = TestcaseRecordInputStream.Create(data);
WriteAccessRecord rec = new WriteAccessRecord(in1);
- Assert.AreEqual("A satisfied Microsoft Office9 User", rec.Username);
+ ClassicAssert.AreEqual("A satisfied Microsoft Office9 User", rec.Username);
byte[] expectedEncoding = HexRead.ReadFromString(""
+ "22 00 00 41 20 73 61 74 69 73 66 69 65 64 20 4D "
+ "69 63 72 6F 73 6F 66 74 20 4F 66 66 69 63 65 39 "
diff --git a/testcases/main/HSSF/Record/TestcaseRecordInputStream.cs b/testcases/main/HSSF/Record/TestcaseRecordInputStream.cs
index 3ec70073c..65b94c845 100644
--- a/testcases/main/HSSF/Record/TestcaseRecordInputStream.cs
+++ b/testcases/main/HSSF/Record/TestcaseRecordInputStream.cs
@@ -19,7 +19,7 @@ namespace TestCases.HSSF.Record
{
using System;
using System.IO;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.Record;
using NPOI.Util;
using System.Text;
@@ -82,9 +82,9 @@ public static byte[] MergeDataAndSid(int sid, int length, byte[] data)
public static void ConfirmRecordEncoding(String msgPrefix, int expectedSid, byte[] expectedData, byte[] actualRecordBytes)
{
int expectedDataSize = expectedData.Length;
- Assert.AreEqual(actualRecordBytes.Length - 4, expectedDataSize,"Size of encode data mismatch");
- Assert.AreEqual(expectedSid, LittleEndian.GetShort(actualRecordBytes, 0));
- Assert.AreEqual(expectedDataSize, LittleEndian.GetShort(actualRecordBytes, 2));
+ ClassicAssert.AreEqual(actualRecordBytes.Length - 4, expectedDataSize,"Size of encode data mismatch");
+ ClassicAssert.AreEqual(expectedSid, LittleEndian.GetShort(actualRecordBytes, 0));
+ ClassicAssert.AreEqual(expectedDataSize, LittleEndian.GetShort(actualRecordBytes, 2));
for (int i = 0; i < expectedDataSize; i++)
if (expectedData[i] != actualRecordBytes[i + 4])
{
diff --git a/testcases/main/HSSF/UserModel/SanityChecker.cs b/testcases/main/HSSF/UserModel/SanityChecker.cs
index 2ce59281b..686bbba48 100644
--- a/testcases/main/HSSF/UserModel/SanityChecker.cs
+++ b/testcases/main/HSSF/UserModel/SanityChecker.cs
@@ -26,7 +26,7 @@ namespace TestCases.HSSF.UserModel
using NPOI.HSSF.Record.Aggregates;
using NPOI.HSSF.UserModel;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
* Designed to Check wither the records written actually make sense.
@@ -215,8 +215,8 @@ private bool IsZeroOrOne()
private void CheckWorkbookRecords(InternalWorkbook workbook)
{
IList records = workbook.Records;
- Assert.IsTrue(records[0] is BOFRecord);
- Assert.IsTrue(records[records.Count - 1] is EOFRecord);
+ ClassicAssert.IsTrue(records[0] is BOFRecord);
+ ClassicAssert.IsTrue(records[records.Count - 1] is EOFRecord);
CheckRecordOrder(records, workbookRecords);
// CheckRecordstogether(records, workbookRecords);
@@ -225,8 +225,8 @@ private void CheckWorkbookRecords(InternalWorkbook workbook)
private void CheckSheetRecords(InternalSheet sheet)
{
IList records = sheet.Records;
- Assert.IsTrue(records[0] is BOFRecord);
- Assert.IsTrue(records[records.Count - 1] is EOFRecord);
+ ClassicAssert.IsTrue(records[0] is BOFRecord);
+ ClassicAssert.IsTrue(records[records.Count - 1] is EOFRecord);
CheckRecordOrder(records, sheetRecords);
// CheckRecordstogether(records, sheetRecords);
diff --git a/testcases/main/HSSF/UserModel/TestBug42464.cs b/testcases/main/HSSF/UserModel/TestBug42464.cs
index b6b319a16..6d1114802 100644
--- a/testcases/main/HSSF/UserModel/TestBug42464.cs
+++ b/testcases/main/HSSF/UserModel/TestBug42464.cs
@@ -25,7 +25,7 @@ namespace TestCases.HSSF.UserModel
using NPOI.SS.Formula;
using NPOI.HSSF.UserModel;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using TestCases.HSSF;
using NPOI.SS.UserModel;
@@ -97,7 +97,7 @@ private static void Process(IRow row, HSSFFormulaEvaluator eval)
#endif
NPOI.SS.UserModel.CellValue evalResult = eval.Evaluate(cell);
- Assert.IsNotNull(evalResult);
+ ClassicAssert.IsNotNull(evalResult);
}
}
}
diff --git a/testcases/main/HSSF/UserModel/TestBug43093.cs b/testcases/main/HSSF/UserModel/TestBug43093.cs
index 3e130b07f..ac9db15b0 100644
--- a/testcases/main/HSSF/UserModel/TestBug43093.cs
+++ b/testcases/main/HSSF/UserModel/TestBug43093.cs
@@ -19,7 +19,7 @@ namespace TestCases.HSSF.UserModel
{
using System;
using NPOI.HSSF.UserModel;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.SS.UserModel;
/**
*
@@ -63,7 +63,7 @@ public void TestBug43093()
double d = eva.Evaluate(s2E4).NumberValue;
// internalEvaluate(...) Area3DEval.: 311+312+321+322 expected
- Assert.AreEqual(d, (311 + 312 + 321 + 322), 0.0000001);
+ ClassicAssert.AreEqual(d, (311 + 312 + 321 + 322), 0.0000001);
// System.out.println("Area3DEval ok.: 311+312+321+322=" + d);
}
}
diff --git a/testcases/main/HSSF/UserModel/TestBugs.cs b/testcases/main/HSSF/UserModel/TestBugs.cs
index 08074f0e5..0830bf6ff 100644
--- a/testcases/main/HSSF/UserModel/TestBugs.cs
+++ b/testcases/main/HSSF/UserModel/TestBugs.cs
@@ -25,7 +25,7 @@ namespace TestCases.HSSF.UserModel
using System.Text;
using System.Collections;
using System.Linq;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using TestCases.HSSF;
@@ -265,7 +265,7 @@ public void Test15556()
HSSFWorkbook wb = OpenSample("15556.xls");
ISheet sheet = wb.GetSheetAt(0);
IRow row = sheet.GetRow(45);
- Assert.IsNotNull(row, "Read row fine!");
+ ClassicAssert.IsNotNull(row, "Read row fine!");
}
/**Double byte strings */
[Test]
@@ -351,7 +351,7 @@ public void Test18800()
sheet = book.GetSheet("CLONE");
IRow row = sheet.GetRow(0);
ICell cell = row.GetCell(0);
- Assert.AreEqual("Test", cell.RichStringCellValue.String);
+ ClassicAssert.AreEqual("Test", cell.RichStringCellValue.String);
}
/**
@@ -370,7 +370,7 @@ public void Test22720()
ISheet clone = workBook.CloneSheet(0);
int originalMerged = template.NumMergedRegions;
- Assert.AreEqual(2, originalMerged, "2 merged regions");
+ ClassicAssert.AreEqual(2, originalMerged, "2 merged regions");
// Remove merged regions from clone
for (int i = template.NumMergedRegions - 1; i >= 0; i--)
@@ -378,7 +378,7 @@ public void Test22720()
clone.RemoveMergedRegion(i);
}
- Assert.AreEqual(originalMerged, template.NumMergedRegions, "Original Sheet's Merged Regions were Removed");
+ ClassicAssert.AreEqual(originalMerged, template.NumMergedRegions, "Original Sheet's Merged Regions were Removed");
// Check if template's merged regions are OK
if (template.NumMergedRegions > 0)
{
@@ -454,7 +454,7 @@ public void TestUnicodeStringFormulaRead()
private static void ConfirmSameCellText(ICell a, ICell b)
{
- Assert.AreEqual(a.RichStringCellValue.String, b.RichStringCellValue.String);
+ ClassicAssert.AreEqual(a.RichStringCellValue.String, b.RichStringCellValue.String);
}
private static String unicodeString(ICell cell)
{
@@ -512,7 +512,7 @@ public void Test28031()
"IF(ROUND(A2*B2*C2,2)>ROUND(B2*D2,2),ROUND(A2*B2*C2,2),ROUND(B2*D2,2))";
cell.CellFormula = (formulaText);
- Assert.AreEqual(formulaText, cell.CellFormula);
+ ClassicAssert.AreEqual(formulaText, cell.CellFormula);
WriteTestOutputFileForViewing(wb, "output28031.xls");
}
[Test]
@@ -629,11 +629,11 @@ public void Test29942()
if (row != null)
{
ICell cell = row.GetCell(0);
- Assert.AreEqual(CellType.String, cell.CellType);
+ ClassicAssert.AreEqual(CellType.String, cell.CellType);
count++;
}
}
- Assert.AreEqual(85, count); //should read 85 rows
+ ClassicAssert.AreEqual(85, count); //should read 85 rows
WriteOutAndReadBack(wb);
}
@@ -691,8 +691,8 @@ public void Test35564()
HSSFWorkbook wb = OpenSample("35564.xls");
ISheet sheet = wb.GetSheetAt(0);
- Assert.AreEqual(false, sheet.IsPrintGridlines);
- Assert.AreEqual(false, sheet.Protect);
+ ClassicAssert.AreEqual(false, sheet.IsPrintGridlines);
+ ClassicAssert.AreEqual(false, sheet.Protect);
WriteOutAndReadBack(wb);
}
@@ -706,7 +706,7 @@ public void Test35565()
HSSFWorkbook wb = OpenSample("35565.xls");
ISheet sheet = wb.GetSheetAt(0);
- Assert.IsNotNull(sheet);
+ ClassicAssert.IsNotNull(sheet);
WriteOutAndReadBack(wb);
}
@@ -733,12 +733,12 @@ public void Test40285()
for (IEnumerator it = sheet.GetRowEnumerator(); it.MoveNext(); rownum++)
{
IRow row = (IRow)it.Current;
- Assert.AreEqual(rownum, row.RowNum);
+ ClassicAssert.AreEqual(rownum, row.RowNum);
int cellNum = 0;
for (IEnumerator it2 = row.GetEnumerator(); it2.MoveNext(); cellNum++)
{
ICell cell = (ICell)it2.Current;
- Assert.AreEqual(cellNum, cell.ColumnIndex);
+ ClassicAssert.AreEqual(cellNum, cell.ColumnIndex);
}
}
}
@@ -786,7 +786,7 @@ public void Test38266()
ISheet sheet = wb.GetSheetAt(0);
int[] breaks = sheet.RowBreaks;
- Assert.AreEqual(0, breaks.Length);
+ ClassicAssert.AreEqual(0, breaks.Length);
//Add 3 row breaks
for (int j = 1; j <= 3; j++)
@@ -856,9 +856,9 @@ public void Test41139()
public void Test41546()
{
HSSFWorkbook wb = OpenSample("41546.xls");
- Assert.AreEqual(1, wb.NumberOfSheets);
+ ClassicAssert.AreEqual(1, wb.NumberOfSheets);
wb = WriteOutAndReadBack(wb);
- Assert.AreEqual(1, wb.NumberOfSheets);
+ ClassicAssert.AreEqual(1, wb.NumberOfSheets);
}
/**
@@ -899,16 +899,16 @@ public void Test42618()
// Textual value
IRow r1 = s.GetRow(0);
ICell c1 = r1.GetCell(1);
- Assert.AreEqual("=CHOOSE(2,A2,A3,A4)", c1.RichStringCellValue.ToString());
+ ClassicAssert.AreEqual("=CHOOSE(2,A2,A3,A4)", c1.RichStringCellValue.ToString());
// Formula Value
IRow r2 = s.GetRow(1);
ICell c2 = r2.GetCell(1);
- Assert.AreEqual(25, (int)c2.NumericCellValue);
+ ClassicAssert.AreEqual(25, (int)c2.NumericCellValue);
try
{
- Assert.AreEqual("CHOOSE(2,A2,A3,A4)", c2.CellFormula);
+ ClassicAssert.AreEqual("CHOOSE(2,A2,A3,A4)", c2.CellFormula);
}
catch (InvalidOperationException e)
{
@@ -939,7 +939,7 @@ public void Test43251()
throw new AssertionException("identified bug 43251");
}
- Assert.AreEqual(1, wb.NumberOfSheets);
+ ClassicAssert.AreEqual(1, wb.NumberOfSheets);
}
/**
@@ -962,7 +962,7 @@ public void Test44471()
throw new AssertionException("Identified bug 44471");
}
- Assert.AreEqual(1, wb.NumberOfSheets);
+ ClassicAssert.AreEqual(1, wb.NumberOfSheets);
}
/**
@@ -978,12 +978,12 @@ public void Test44536()
HSSFWorkbook wb = OpenSample("ReadOnlyRecommended.xls");
// Check read only advised
- Assert.AreEqual(3, wb.NumberOfSheets);
- Assert.IsTrue(wb.IsWriteProtected);
+ ClassicAssert.AreEqual(3, wb.NumberOfSheets);
+ ClassicAssert.IsTrue(wb.IsWriteProtected);
// But also Check that another wb isn't
wb = OpenSample("SimpleWithChoose.xls");
- Assert.IsFalse(wb.IsWriteProtected);
+ ClassicAssert.IsFalse(wb.IsWriteProtected);
}
/**
@@ -1008,7 +1008,7 @@ public void Test44593()
throw new AssertionException("Identified bug 44593");
}
- Assert.AreEqual(2, wb.NumberOfSheets);
+ ClassicAssert.AreEqual(2, wb.NumberOfSheets);
}
/**
@@ -1030,7 +1030,7 @@ public void Test44643()
throw new AssertionException("identified bug 44643");
}
- Assert.AreEqual(1, wb.NumberOfSheets);
+ ClassicAssert.AreEqual(1, wb.NumberOfSheets);
}
/**
@@ -1045,19 +1045,19 @@ public void Test44693()
ISheet s = wb.GetSheetAt(0);
// Rows are 1 to 713
- Assert.AreEqual(0, s.FirstRowNum);
- Assert.AreEqual(712, s.LastRowNum);
- Assert.AreEqual(713, s.PhysicalNumberOfRows);
+ ClassicAssert.AreEqual(0, s.FirstRowNum);
+ ClassicAssert.AreEqual(712, s.LastRowNum);
+ ClassicAssert.AreEqual(713, s.PhysicalNumberOfRows);
// Now Check the iterator
int rowsSeen = 0;
for (IEnumerator i = s.GetRowEnumerator(); i.MoveNext();)
{
IRow r = (IRow)i.Current;
- Assert.IsNotNull(r);
+ ClassicAssert.IsNotNull(r);
rowsSeen++;
}
- Assert.AreEqual(713, rowsSeen);
+ ClassicAssert.AreEqual(713, rowsSeen);
}
/**
@@ -1067,9 +1067,9 @@ public void Test44693()
public void Test28774()
{
HSSFWorkbook wb = OpenSample("28774.xls");
- Assert.IsTrue(true, "no errors reading sample xls");
+ ClassicAssert.IsTrue(true, "no errors reading sample xls");
WriteOutAndReadBack(wb);
- Assert.IsTrue(true, "no errors writing sample xls");
+ ClassicAssert.IsTrue(true, "no errors writing sample xls");
}
/**
@@ -1080,9 +1080,9 @@ public void Test28774()
public void Test44891()
{
HSSFWorkbook wb = OpenSample("44891.xls");
- Assert.IsTrue(true, "no errors reading sample xls");
+ ClassicAssert.IsTrue(true, "no errors reading sample xls");
WriteOutAndReadBack(wb);
- Assert.IsTrue(true, "no errors writing sample xls");
+ ClassicAssert.IsTrue(true, "no errors writing sample xls");
}
/**
@@ -1094,9 +1094,9 @@ public void Test44891()
public void Test44235()
{
HSSFWorkbook wb = OpenSample("44235.xls");
- Assert.IsTrue(true, "no errors reading sample xls");
+ ClassicAssert.IsTrue(true, "no errors reading sample xls");
WriteOutAndReadBack(wb);
- Assert.IsTrue(true, "no errors writing sample xls");
+ ClassicAssert.IsTrue(true, "no errors writing sample xls");
}
@@ -1104,18 +1104,18 @@ public void Test44235()
public void Test36947()
{
HSSFWorkbook wb = OpenSample("36947.xls");
- Assert.IsTrue(true, "no errors reading sample xls");
+ ClassicAssert.IsTrue(true, "no errors reading sample xls");
WriteOutAndReadBack(wb);
- Assert.IsTrue(true, "no errors writing sample xls");
+ ClassicAssert.IsTrue(true, "no errors writing sample xls");
}
[Test]
public void Test39634()
{
HSSFWorkbook wb = OpenSample("39634.xls");
- Assert.IsTrue(true, "no errors reading sample xls");
+ ClassicAssert.IsTrue(true, "no errors reading sample xls");
WriteOutAndReadBack(wb);
- Assert.IsTrue(true, "no errors writing sample xls");
+ ClassicAssert.IsTrue(true, "no errors writing sample xls");
}
/**
@@ -1130,25 +1130,25 @@ public void Test44840()
// Take a look at the embedded objects
IList objects = wb.GetAllEmbeddedObjects();
- Assert.AreEqual(1, objects.Count);
+ ClassicAssert.AreEqual(1, objects.Count);
HSSFObjectData obj = (HSSFObjectData)objects[0];
- Assert.IsNotNull(obj);
+ ClassicAssert.IsNotNull(obj);
// Peek inside the underlying record
EmbeddedObjectRefSubRecord rec = obj.FindObjectRecord();
- Assert.IsNotNull(rec);
+ ClassicAssert.IsNotNull(rec);
- // Assert.AreEqual(32, rec.field_1_stream_id_offset);
- Assert.AreEqual(0, rec.StreamId); // WRONG!
- Assert.AreEqual("Forms.CheckBox.1", rec.OLEClassName);
- Assert.AreEqual(12, rec.ObjectData.Length);
+ // ClassicAssert.AreEqual(32, rec.field_1_stream_id_offset);
+ ClassicAssert.AreEqual(0, rec.StreamId); // WRONG!
+ ClassicAssert.AreEqual("Forms.CheckBox.1", rec.OLEClassName);
+ ClassicAssert.AreEqual(12, rec.ObjectData.Length);
// Doesn't have a directory
- Assert.IsFalse(obj.HasDirectoryEntry());
- Assert.IsNotNull(obj.GetObjectData());
- Assert.AreEqual(12, obj.GetObjectData().Length);
- Assert.AreEqual("Forms.CheckBox.1", obj.OLE2ClassName);
+ ClassicAssert.IsFalse(obj.HasDirectoryEntry());
+ ClassicAssert.IsNotNull(obj.GetObjectData());
+ ClassicAssert.AreEqual(12, obj.GetObjectData().Length);
+ ClassicAssert.AreEqual("Forms.CheckBox.1", obj.OLE2ClassName);
try
{
@@ -1170,8 +1170,8 @@ public void Test44840()
public void Test30978()
{
HSSFWorkbook wb = OpenSample("30978-alt.xls");
- Assert.AreEqual(1, wb.NumberOfNames);
- Assert.AreEqual(3, wb.NumberOfSheets);
+ ClassicAssert.AreEqual(1, wb.NumberOfNames);
+ ClassicAssert.AreEqual(3, wb.NumberOfSheets);
// Check all names fit within range, and use
// DeletedArea3DPtg
@@ -1179,11 +1179,11 @@ public void Test30978()
for (int i = 0; i < w.NumNames; i++)
{
NameRecord r = w.GetNameRecord(i);
- Assert.IsTrue(r.SheetNumber <= wb.NumberOfSheets);
+ ClassicAssert.IsTrue(r.SheetNumber <= wb.NumberOfSheets);
Ptg[] nd = r.NameDefinition;
- Assert.AreEqual(1, nd.Length);
- Assert.IsTrue(nd[0] is DeletedArea3DPtg);
+ ClassicAssert.AreEqual(1, nd.Length);
+ ClassicAssert.IsTrue(nd[0] is DeletedArea3DPtg);
}
@@ -1192,17 +1192,17 @@ public void Test30978()
// Re-Check
- Assert.AreEqual(1, wb.NumberOfNames);
- Assert.AreEqual(2, wb.NumberOfSheets);
+ ClassicAssert.AreEqual(1, wb.NumberOfNames);
+ ClassicAssert.AreEqual(2, wb.NumberOfSheets);
for (int i = 0; i < w.NumNames; i++)
{
NameRecord r = w.GetNameRecord(i);
- Assert.IsTrue(r.SheetNumber <= wb.NumberOfSheets);
+ ClassicAssert.IsTrue(r.SheetNumber <= wb.NumberOfSheets);
Ptg[] nd = r.NameDefinition;
- Assert.AreEqual(1, nd.Length);
- Assert.IsTrue(nd[0] is DeletedArea3DPtg);
+ ClassicAssert.AreEqual(1, nd.Length);
+ ClassicAssert.IsTrue(nd[0] is DeletedArea3DPtg);
}
@@ -1210,17 +1210,17 @@ public void Test30978()
wb = WriteOutAndReadBack(wb);
w = wb.Workbook;
- Assert.AreEqual(1, wb.NumberOfNames);
- Assert.AreEqual(2, wb.NumberOfSheets);
+ ClassicAssert.AreEqual(1, wb.NumberOfNames);
+ ClassicAssert.AreEqual(2, wb.NumberOfSheets);
for (int i = 0; i < w.NumNames; i++)
{
NameRecord r = w.GetNameRecord(i);
- Assert.IsTrue(r.SheetNumber <= wb.NumberOfSheets);
+ ClassicAssert.IsTrue(r.SheetNumber <= wb.NumberOfSheets);
Ptg[] nd = r.NameDefinition;
- Assert.AreEqual(1, nd.Length);
- Assert.IsTrue(nd[0] is DeletedArea3DPtg);
+ ClassicAssert.AreEqual(1, nd.Length);
+ ClassicAssert.IsTrue(nd[0] is DeletedArea3DPtg);
}
}
@@ -1231,7 +1231,7 @@ public void Test30978()
public void Test45338()
{
HSSFWorkbook wb = new HSSFWorkbook();
- Assert.AreEqual(4, wb.NumberOfFonts);
+ ClassicAssert.AreEqual(4, wb.NumberOfFonts);
ISheet s = wb.CreateSheet();
s.CreateRow(0);
@@ -1239,23 +1239,23 @@ public void Test45338()
ICell c1 = s.GetRow(0).CreateCell(0);
ICell c2 = s.GetRow(1).CreateCell(0);
- Assert.AreEqual(4, wb.NumberOfFonts);
+ ClassicAssert.AreEqual(4, wb.NumberOfFonts);
IFont f1 = wb.GetFontAt((short)0);
- Assert.IsFalse(f1.IsBold);
+ ClassicAssert.IsFalse(f1.IsBold);
// Check that asking for the same font
// multiple times gives you the same thing.
// Otherwise, our Tests wouldn't work!
- Assert.AreEqual(
+ ClassicAssert.AreEqual(
wb.GetFontAt((short)0),
wb.GetFontAt((short)0)
);
- Assert.AreEqual(
+ ClassicAssert.AreEqual(
wb.GetFontAt((short)2),
wb.GetFontAt((short)2)
);
- Assert.IsTrue(
+ ClassicAssert.IsTrue(
wb.GetFontAt((short)0)
!=
wb.GetFontAt((short)2)
@@ -1263,7 +1263,7 @@ public void Test45338()
// Look for a new font we have
// yet to Add
- Assert.IsNull(
+ ClassicAssert.IsNull(
wb.FindFont(
true, (short)123, (short)22,
"Thingy", false, true, FontSuperScript.Sub, FontUnderlineType.Double
@@ -1271,10 +1271,10 @@ public void Test45338()
);
IFont nf = wb.CreateFont();
- Assert.AreEqual(5, wb.NumberOfFonts);
+ ClassicAssert.AreEqual(5, wb.NumberOfFonts);
- Assert.AreEqual(5, nf.Index);
- Assert.AreEqual(nf, wb.GetFontAt((short)5));
+ ClassicAssert.AreEqual(5, nf.Index);
+ ClassicAssert.AreEqual(nf, wb.GetFontAt((short)5));
nf.IsBold = true;
nf.Color = ((short)123);
@@ -1285,24 +1285,24 @@ public void Test45338()
nf.TypeOffset = FontSuperScript.Sub;
nf.Underline = FontUnderlineType.Double;
- Assert.AreEqual(5, wb.NumberOfFonts);
- Assert.AreEqual(nf, wb.GetFontAt((short)5));
+ ClassicAssert.AreEqual(5, wb.NumberOfFonts);
+ ClassicAssert.AreEqual(nf, wb.GetFontAt((short)5));
// Find it now
- Assert.IsNotNull(
+ ClassicAssert.IsNotNull(
wb.FindFont(
true, (short)123, (short)22,
"Thingy", false, true, FontSuperScript.Sub, FontUnderlineType.Double
)
);
- Assert.AreEqual(
+ ClassicAssert.AreEqual(
5,
wb.FindFont(
true, (short)123, (short)22,
"Thingy", false, true, FontSuperScript.Sub, FontUnderlineType.Double
).Index
);
- Assert.AreEqual(nf,
+ ClassicAssert.AreEqual(nf,
wb.FindFont(
true, (short)123, (short)22,
"Thingy", false, true, FontSuperScript.Sub, FontUnderlineType.Double
@@ -1332,8 +1332,8 @@ public void TestZipCodeFormulas()
c3.CellFormula = ("\"90210\"");
// Check the formulas
- Assert.AreEqual("70164", c1.CellFormula);
- Assert.AreEqual("\"70164\"", c2.CellFormula);
+ ClassicAssert.AreEqual("70164", c1.CellFormula);
+ ClassicAssert.AreEqual("\"70164\"", c2.CellFormula);
// And Check the values - blank
ConfirmCachedValue(0.0, c1);
@@ -1351,7 +1351,7 @@ public void TestZipCodeFormulas()
}
catch (InvalidOperationException e)
{
- Assert.AreEqual("Cannot get a numeric value from a text formula cell", e.Message);
+ ClassicAssert.AreEqual("Cannot get a numeric value from a text formula cell", e.Message);
}
@@ -1390,37 +1390,37 @@ public void TestZipCodeFormulas()
if (i == 0)
{
- Assert.AreEqual(70164.0, fr.FormulaRecord.Value, 0.0001);
- Assert.IsNull(fr.StringRecord);
+ ClassicAssert.AreEqual(70164.0, fr.FormulaRecord.Value, 0.0001);
+ ClassicAssert.IsNull(fr.StringRecord);
}
else if (i == 1)
{
- Assert.AreEqual(0.0, fr.FormulaRecord.Value, 0.0001);
- Assert.IsNotNull(fr.StringRecord);
- Assert.AreEqual("70164", fr.StringRecord.String);
+ ClassicAssert.AreEqual(0.0, fr.FormulaRecord.Value, 0.0001);
+ ClassicAssert.IsNotNull(fr.StringRecord);
+ ClassicAssert.AreEqual("70164", fr.StringRecord.String);
}
else
{
- Assert.AreEqual(0.0, fr.FormulaRecord.Value, 0.0001);
- Assert.IsNotNull(fr.StringRecord);
- Assert.AreEqual("90210", fr.StringRecord.String);
+ ClassicAssert.AreEqual(0.0, fr.FormulaRecord.Value, 0.0001);
+ ClassicAssert.IsNotNull(fr.StringRecord);
+ ClassicAssert.AreEqual("90210", fr.StringRecord.String);
}
}
}
- Assert.AreEqual(3, i);
+ ClassicAssert.AreEqual(3, i);
}
private static void ConfirmCachedValue(double expectedValue, ICell cell)
{
- Assert.AreEqual(CellType.Formula, cell.CellType);
- Assert.AreEqual(CellType.Numeric, cell.CachedFormulaResultType);
- Assert.AreEqual(expectedValue, cell.NumericCellValue, 0.0);
+ ClassicAssert.AreEqual(CellType.Formula, cell.CellType);
+ ClassicAssert.AreEqual(CellType.Numeric, cell.CachedFormulaResultType);
+ ClassicAssert.AreEqual(expectedValue, cell.NumericCellValue, 0.0);
}
private static void ConfirmCachedValue(String expectedValue, ICell cell)
{
- Assert.AreEqual(CellType.Formula, cell.CellType);
- Assert.AreEqual(CellType.String, cell.CachedFormulaResultType);
- Assert.AreEqual(expectedValue, cell.RichStringCellValue.String);
+ ClassicAssert.AreEqual(CellType.Formula, cell.CellType);
+ ClassicAssert.AreEqual(CellType.String, cell.CachedFormulaResultType);
+ ClassicAssert.AreEqual(expectedValue, cell.RichStringCellValue.String);
}
/**
@@ -1440,7 +1440,7 @@ private static void ConfirmCachedValue(String expectedValue, ICell cell)
public void DISABLED_Test43623()
{
HSSFWorkbook wb = OpenSample("43623.xls");
- Assert.AreEqual(1, wb.NumberOfSheets);
+ ClassicAssert.AreEqual(1, wb.NumberOfSheets);
ISheet s1 = wb.GetSheetAt(0);
@@ -1449,9 +1449,9 @@ public void DISABLED_Test43623()
ICell c3 = s1.GetRow(2).GetCell(2);
// These formula contents are a guess...
- Assert.AreEqual("{=sin(B1:B9){9,1)[0][0]", c1.CellFormula);
- Assert.AreEqual("{=sin(B1:B9){9,1)[1][0]", c2.CellFormula);
- Assert.AreEqual("{=sin(B1:B9){9,1)[2][0]", c3.CellFormula);
+ ClassicAssert.AreEqual("{=sin(B1:B9){9,1)[0][0]", c1.CellFormula);
+ ClassicAssert.AreEqual("{=sin(B1:B9){9,1)[1][0]", c2.CellFormula);
+ ClassicAssert.AreEqual("{=sin(B1:B9){9,1)[2][0]", c3.CellFormula);
// Save and re-Open, ensure it still works
HSSFWorkbook nwb = WriteOutAndReadBack(wb);
@@ -1460,9 +1460,9 @@ public void DISABLED_Test43623()
ICell nc2 = ns1.GetRow(1).GetCell(2);
ICell nc3 = ns1.GetRow(2).GetCell(2);
- Assert.AreEqual("{=sin(B1:B9){9,1)[0][0]", nc1.CellFormula);
- Assert.AreEqual("{=sin(B1:B9){9,1)[1][0]", nc2.CellFormula);
- Assert.AreEqual("{=sin(B1:B9){9,1)[2][0]", nc3.CellFormula);
+ ClassicAssert.AreEqual("{=sin(B1:B9){9,1)[0][0]", nc1.CellFormula);
+ ClassicAssert.AreEqual("{=sin(B1:B9){9,1)[1][0]", nc2.CellFormula);
+ ClassicAssert.AreEqual("{=sin(B1:B9){9,1)[2][0]", nc3.CellFormula);
}
/**
@@ -1476,44 +1476,44 @@ public void Test30635()
ISheet s = wb.CreateSheet();
// No rows, everything is 0
- Assert.AreEqual(0, s.FirstRowNum);
- Assert.AreEqual(0, s.LastRowNum);
- Assert.AreEqual(0, s.PhysicalNumberOfRows);
+ ClassicAssert.AreEqual(0, s.FirstRowNum);
+ ClassicAssert.AreEqual(0, s.LastRowNum);
+ ClassicAssert.AreEqual(0, s.PhysicalNumberOfRows);
// One row, most things are 0, physical is 1
s.CreateRow(0);
- Assert.AreEqual(0, s.FirstRowNum);
- Assert.AreEqual(0, s.LastRowNum);
- Assert.AreEqual(1, s.PhysicalNumberOfRows);
+ ClassicAssert.AreEqual(0, s.FirstRowNum);
+ ClassicAssert.AreEqual(0, s.LastRowNum);
+ ClassicAssert.AreEqual(1, s.PhysicalNumberOfRows);
// And another, things change
s.CreateRow(4);
- Assert.AreEqual(0, s.FirstRowNum);
- Assert.AreEqual(4, s.LastRowNum);
- Assert.AreEqual(2, s.PhysicalNumberOfRows);
+ ClassicAssert.AreEqual(0, s.FirstRowNum);
+ ClassicAssert.AreEqual(4, s.LastRowNum);
+ ClassicAssert.AreEqual(2, s.PhysicalNumberOfRows);
// Now start on cells
IRow r = s.GetRow(0);
- Assert.AreEqual(-1, r.FirstCellNum);
- Assert.AreEqual(-1, r.LastCellNum);
- Assert.AreEqual(0, r.PhysicalNumberOfCells);
+ ClassicAssert.AreEqual(-1, r.FirstCellNum);
+ ClassicAssert.AreEqual(-1, r.LastCellNum);
+ ClassicAssert.AreEqual(0, r.PhysicalNumberOfCells);
// Add a cell, things move off -1
r.CreateCell(0);
- Assert.AreEqual(0, r.FirstCellNum);
- Assert.AreEqual(1, r.LastCellNum); // last cell # + 1
- Assert.AreEqual(1, r.PhysicalNumberOfCells);
+ ClassicAssert.AreEqual(0, r.FirstCellNum);
+ ClassicAssert.AreEqual(1, r.LastCellNum); // last cell # + 1
+ ClassicAssert.AreEqual(1, r.PhysicalNumberOfCells);
r.CreateCell(1);
- Assert.AreEqual(0, r.FirstCellNum);
- Assert.AreEqual(2, r.LastCellNum); // last cell # + 1
- Assert.AreEqual(2, r.PhysicalNumberOfCells);
+ ClassicAssert.AreEqual(0, r.FirstCellNum);
+ ClassicAssert.AreEqual(2, r.LastCellNum); // last cell # + 1
+ ClassicAssert.AreEqual(2, r.PhysicalNumberOfCells);
r.CreateCell(4);
- Assert.AreEqual(0, r.FirstCellNum);
- Assert.AreEqual(5, r.LastCellNum); // last cell # + 1
- Assert.AreEqual(3, r.PhysicalNumberOfCells);
+ ClassicAssert.AreEqual(0, r.FirstCellNum);
+ ClassicAssert.AreEqual(5, r.LastCellNum); // last cell # + 1
+ ClassicAssert.AreEqual(3, r.PhysicalNumberOfCells);
wb.Close();
}
@@ -1535,7 +1535,7 @@ public void Test44958()
s = wb.GetSheet("OneVariable Table Completed");
r = s.GetRow(3);
c = r.GetCell(4);
- Assert.AreEqual(CellType.Formula, c.CellType);
+ ClassicAssert.AreEqual(CellType.Formula, c.CellType);
// TODO - Check the formula once tables and
// arrays are properly supported
@@ -1545,7 +1545,7 @@ public void Test44958()
s = wb.GetSheet("TwoVariable Table Example");
r = s.GetRow(3);
c = r.GetCell(4);
- Assert.AreEqual(CellType.Formula, c.CellType);
+ ClassicAssert.AreEqual(CellType.Formula, c.CellType);
// TODO - Check the formula once tables and
// arrays are properly supported
@@ -1580,9 +1580,9 @@ public void Test45414()
HSSFWorkbook nwb = WriteOutAndReadBack(wb);
// Check now set as it should be
- Assert.IsTrue(nwb.GetSheetAt(0).ForceFormulaRecalculation);
- Assert.IsFalse(nwb.GetSheetAt(1).ForceFormulaRecalculation);
- Assert.IsTrue(nwb.GetSheetAt(2).ForceFormulaRecalculation);
+ ClassicAssert.IsTrue(nwb.GetSheetAt(0).ForceFormulaRecalculation);
+ ClassicAssert.IsFalse(nwb.GetSheetAt(1).ForceFormulaRecalculation);
+ ClassicAssert.IsTrue(nwb.GetSheetAt(2).ForceFormulaRecalculation);
}
/**
@@ -1592,26 +1592,26 @@ public void Test45414()
public void Test45761()
{
HSSFWorkbook wb = OpenSample("45761.xls");
- Assert.AreEqual(3, wb.NumberOfSheets);
+ ClassicAssert.AreEqual(3, wb.NumberOfSheets);
- Assert.IsFalse(wb.IsSheetHidden(0));
- Assert.IsFalse(wb.IsSheetVeryHidden(0));
- Assert.IsTrue(wb.IsSheetHidden(1));
- Assert.IsFalse(wb.IsSheetVeryHidden(1));
- Assert.IsFalse(wb.IsSheetHidden(2));
- Assert.IsTrue(wb.IsSheetVeryHidden(2));
+ ClassicAssert.IsFalse(wb.IsSheetHidden(0));
+ ClassicAssert.IsFalse(wb.IsSheetVeryHidden(0));
+ ClassicAssert.IsTrue(wb.IsSheetHidden(1));
+ ClassicAssert.IsFalse(wb.IsSheetVeryHidden(1));
+ ClassicAssert.IsFalse(wb.IsSheetHidden(2));
+ ClassicAssert.IsTrue(wb.IsSheetVeryHidden(2));
// Change sheet 0 to be very hidden, and re-load
wb.SetSheetVisibility(0, SheetVisibility.VeryHidden);
HSSFWorkbook nwb = WriteOutAndReadBack(wb);
- Assert.IsFalse(nwb.IsSheetHidden(0));
- Assert.IsTrue(nwb.IsSheetVeryHidden(0));
- Assert.IsTrue(nwb.IsSheetHidden(1));
- Assert.IsFalse(nwb.IsSheetVeryHidden(1));
- Assert.IsFalse(nwb.IsSheetHidden(2));
- Assert.IsTrue(nwb.IsSheetVeryHidden(2));
+ ClassicAssert.IsFalse(nwb.IsSheetHidden(0));
+ ClassicAssert.IsTrue(nwb.IsSheetVeryHidden(0));
+ ClassicAssert.IsTrue(nwb.IsSheetHidden(1));
+ ClassicAssert.IsFalse(nwb.IsSheetVeryHidden(1));
+ ClassicAssert.IsFalse(nwb.IsSheetHidden(2));
+ ClassicAssert.IsTrue(nwb.IsSheetVeryHidden(2));
}
///
@@ -1633,19 +1633,19 @@ public void Bug45777()
String s249 = s248 + "1";
String s250 = s248 + "12";
String s251 = s248 + "123";
- Assert.AreEqual(248, s248.Length);
- Assert.AreEqual(249, s249.Length);
- Assert.AreEqual(250, s250.Length);
- Assert.AreEqual(251, s251.Length);
+ ClassicAssert.AreEqual(248, s248.Length);
+ ClassicAssert.AreEqual(249, s249.Length);
+ ClassicAssert.AreEqual(250, s250.Length);
+ ClassicAssert.AreEqual(251, s251.Length);
// Try on headers
s.Header.Center = (s248);
- Assert.AreEqual(254, (s.Header as HSSFHeader).RawText.Length);
+ ClassicAssert.AreEqual(254, (s.Header as HSSFHeader).RawText.Length);
WriteOutAndReadBack(wb).Close();
s.Header.Center = (s251);
- Assert.AreEqual(257, (s.Header as HSSFHeader).RawText.Length);
+ ClassicAssert.AreEqual(257, (s.Header as HSSFHeader).RawText.Length);
WriteOutAndReadBack(wb).Close();
// header can be more than 256 bytes
@@ -1654,11 +1654,11 @@ public void Bug45777()
// Now try on footers
s.Footer.Center = (s248);
- Assert.AreEqual(254, (s.Footer as HSSFFooter).RawText.Length);
+ ClassicAssert.AreEqual(254, (s.Footer as HSSFFooter).RawText.Length);
WriteOutAndReadBack(wb).Close();
s.Footer.Center = (s251);
- Assert.AreEqual(257, (s.Footer as HSSFFooter).RawText.Length);
+ ClassicAssert.AreEqual(257, (s.Footer as HSSFFooter).RawText.Length);
WriteOutAndReadBack(wb).Close();
// footer can be more than 256 bytes
@@ -1676,7 +1676,7 @@ public void Test45784()
{
// This used to break
HSSFWorkbook wb = OpenSample("45784.xls");
- Assert.AreEqual(1, wb.NumberOfSheets);
+ ClassicAssert.AreEqual(1, wb.NumberOfSheets);
}
/**
@@ -1696,25 +1696,25 @@ public void Test45492()
ICell blue = r.GetCell(3);
ICell green = r.GetCell(4);
- Assert.AreEqual(64, auto.CellStyle.FillForegroundColor);
- Assert.AreEqual(64, auto.CellStyle.FillBackgroundColor);
- Assert.AreEqual("0:0:0", p.GetColor(64).GetHexString());
+ ClassicAssert.AreEqual(64, auto.CellStyle.FillForegroundColor);
+ ClassicAssert.AreEqual(64, auto.CellStyle.FillBackgroundColor);
+ ClassicAssert.AreEqual("0:0:0", p.GetColor(64).GetHexString());
- Assert.AreEqual(22, grey.CellStyle.FillForegroundColor);
- Assert.AreEqual(64, grey.CellStyle.FillBackgroundColor);
- Assert.AreEqual("C0C0:C0C0:C0C0", p.GetColor(22).GetHexString());
+ ClassicAssert.AreEqual(22, grey.CellStyle.FillForegroundColor);
+ ClassicAssert.AreEqual(64, grey.CellStyle.FillBackgroundColor);
+ ClassicAssert.AreEqual("C0C0:C0C0:C0C0", p.GetColor(22).GetHexString());
- Assert.AreEqual(10, red.CellStyle.FillForegroundColor);
- Assert.AreEqual(64, red.CellStyle.FillBackgroundColor);
- Assert.AreEqual("FFFF:0:0", p.GetColor(10).GetHexString());
+ ClassicAssert.AreEqual(10, red.CellStyle.FillForegroundColor);
+ ClassicAssert.AreEqual(64, red.CellStyle.FillBackgroundColor);
+ ClassicAssert.AreEqual("FFFF:0:0", p.GetColor(10).GetHexString());
- Assert.AreEqual(12, blue.CellStyle.FillForegroundColor);
- Assert.AreEqual(64, blue.CellStyle.FillBackgroundColor);
- Assert.AreEqual("0:0:FFFF", p.GetColor(12).GetHexString());
+ ClassicAssert.AreEqual(12, blue.CellStyle.FillForegroundColor);
+ ClassicAssert.AreEqual(64, blue.CellStyle.FillBackgroundColor);
+ ClassicAssert.AreEqual("0:0:FFFF", p.GetColor(12).GetHexString());
- Assert.AreEqual(11, green.CellStyle.FillForegroundColor);
- Assert.AreEqual(64, green.CellStyle.FillBackgroundColor);
- Assert.AreEqual("0:FFFF:0", p.GetColor(11).GetHexString());
+ ClassicAssert.AreEqual(11, green.CellStyle.FillForegroundColor);
+ ClassicAssert.AreEqual(64, green.CellStyle.FillBackgroundColor);
+ ClassicAssert.AreEqual("0:FFFF:0", p.GetColor(11).GetHexString());
}
/**
* ContinueRecord after EOF
@@ -1724,7 +1724,7 @@ public void Test46137()
{
// This used to break
HSSFWorkbook wb = OpenSample("46137.xls");
- Assert.AreEqual(7, wb.NumberOfSheets);
+ ClassicAssert.AreEqual(7, wb.NumberOfSheets);
wb = HSSFTestDataSamples.WriteOutAndReadBack(wb);
}
/**
@@ -1768,26 +1768,26 @@ public void Test46664()
tr = (TabIdRecord)r;
}
}
- Assert.IsNotNull(tr);
- Assert.AreEqual(1, tr._tabids.Length);
- Assert.AreEqual(0, tr._tabids[0]);
+ ClassicAssert.IsNotNull(tr);
+ ClassicAssert.AreEqual(1, tr._tabids.Length);
+ ClassicAssert.AreEqual(0, tr._tabids[0]);
// Ensure the print setup
- Assert.AreEqual("new_sheet!$A$1:$C$1", wb2.GetPrintArea(0));
- Assert.AreEqual("new_sheet!$A$1:$C$1", wb2.GetName("Print_Area").RefersToFormula);
+ ClassicAssert.AreEqual("new_sheet!$A$1:$C$1", wb2.GetPrintArea(0));
+ ClassicAssert.AreEqual("new_sheet!$A$1:$C$1", wb2.GetName("Print_Area").RefersToFormula);
// Needs reference not value
NameRecord nr = wb2.Workbook.GetNameRecord(
wb2.GetNameIndex("Print_Area")
);
- Assert.AreEqual("Print_Area", nr.NameText);
- Assert.AreEqual(1, nr.NameDefinition.Length);
- Assert.AreEqual(
+ ClassicAssert.AreEqual("Print_Area", nr.NameText);
+ ClassicAssert.AreEqual(1, nr.NameDefinition.Length);
+ ClassicAssert.AreEqual(
"new_sheet!$A$1:$C$1",
((Area3DPtg)nr.NameDefinition[0]).ToFormulaString(HSSFEvaluationWorkbook.Create(wb2))
);
- Assert.AreEqual('R', nr.NameDefinition[0].RVAType);
+ ClassicAssert.AreEqual('R', nr.NameDefinition[0].RVAType);
wb2.Close();
}
@@ -1799,7 +1799,7 @@ public void Test46664()
public void Test45290()
{
HSSFWorkbook wb = OpenSample("45290.xls");
- Assert.AreEqual(1, wb.NumberOfSheets);
+ ClassicAssert.AreEqual(1, wb.NumberOfSheets);
}
/**
* In POI-2.5 user reported exception when parsing a name with a custom VBA function:
@@ -1813,14 +1813,14 @@ public void Test30070()
HSSFCell cell = (HSSFCell)sh.GetRow(0).GetCell(1);
//B1 uses VBA in the formula
- Assert.AreEqual("Commission(A1)", cell.CellFormula);
+ ClassicAssert.AreEqual("Commission(A1)", cell.CellFormula);
//name sales_1 refers to Commission(Sheet0!$A$1)
int idx = wb.GetNameIndex("sales_1");
- Assert.IsTrue(idx != -1);
+ ClassicAssert.IsTrue(idx != -1);
HSSFName name = (HSSFName)wb.GetNameAt(idx);
- Assert.AreEqual("Commission(Sheet0!$A$1)", name.RefersToFormula);
+ ClassicAssert.AreEqual("Commission(Sheet0!$A$1)", name.RefersToFormula);
}
@@ -1845,9 +1845,9 @@ public void Test27364()
HSSFWorkbook wb = OpenSample("27364.xls");
ISheet sheet = wb.GetSheetAt(0);
- Assert.AreEqual("[link_sub.xls]Sheet1!$A$1", sheet.GetRow(0).GetCell(0).CellFormula);
- Assert.AreEqual("[link_sub.xls]Sheet1!$A$2", sheet.GetRow(1).GetCell(0).CellFormula);
- Assert.AreEqual("[link_sub.xls]Sheet1!$A$3", sheet.GetRow(2).GetCell(0).CellFormula);
+ ClassicAssert.AreEqual("[link_sub.xls]Sheet1!$A$1", sheet.GetRow(0).GetCell(0).CellFormula);
+ ClassicAssert.AreEqual("[link_sub.xls]Sheet1!$A$2", sheet.GetRow(1).GetCell(0).CellFormula);
+ ClassicAssert.AreEqual("[link_sub.xls]Sheet1!$A$3", sheet.GetRow(2).GetCell(0).CellFormula);
}
/**
@@ -1860,7 +1860,7 @@ public void Test31661()
HSSFWorkbook wb = OpenSample("31661.xls");
ISheet sheet = wb.GetSheetAt(0);
ICell cell = sheet.GetRow(11).GetCell(10); //K11
- Assert.AreEqual("+'[GM Budget.xls]8085.4450'!$B$2", cell.CellFormula);
+ ClassicAssert.AreEqual("+'[GM Budget.xls]8085.4450'!$B$2", cell.CellFormula);
}
/**
@@ -1870,12 +1870,12 @@ public void Test31661()
public void Test27394()
{
HSSFWorkbook wb = OpenSample("27394.xls");
- Assert.AreEqual("\u0161\u017E", wb.GetSheetName(0));
- Assert.AreEqual("\u0161\u017E\u010D\u0148\u0159", wb.GetSheetName(1));
+ ClassicAssert.AreEqual("\u0161\u017E", wb.GetSheetName(0));
+ ClassicAssert.AreEqual("\u0161\u017E\u010D\u0148\u0159", wb.GetSheetName(1));
ISheet sheet = wb.GetSheetAt(0);
- Assert.AreEqual("\u0161\u017E", sheet.GetRow(0).GetCell(0).StringCellValue);
- Assert.AreEqual("\u0161\u017E\u010D\u0148\u0159", sheet.GetRow(1).GetCell(0).StringCellValue);
+ ClassicAssert.AreEqual("\u0161\u017E", sheet.GetRow(0).GetCell(0).StringCellValue);
+ ClassicAssert.AreEqual("\u0161\u017E\u010D\u0148\u0159", sheet.GetRow(1).GetCell(0).StringCellValue);
}
/**
@@ -1896,12 +1896,12 @@ public void Test32191()
long size2 = out1.Length;
out1.Close();
- Assert.AreEqual(size1, size2);
+ ClassicAssert.AreEqual(size1, size2);
out1 = new MemoryStream();
wb.Write(out1);
long size3 = out1.Length;
out1.Close();
- Assert.AreEqual(size2, size3);
+ ClassicAssert.AreEqual(size2, size3);
}
@@ -1922,7 +1922,7 @@ public void Test46904()
}
catch (OldExcelFormatException e)
{
- Assert.IsTrue(e.Message.StartsWith(
+ ClassicAssert.IsTrue(e.Message.StartsWith(
"The supplied spreadsheet seems to be Excel"
));
}
@@ -1943,7 +1943,7 @@ public void Test46904()
}
catch (OldExcelFormatException e)
{
- Assert.IsTrue(e.Message.StartsWith(
+ ClassicAssert.IsTrue(e.Message.StartsWith(
"The supplied spreadsheet seems to be Excel"
));
}
@@ -1958,8 +1958,8 @@ public void Test46904()
public void Test47034()
{
HSSFWorkbook wb = OpenSample("47034.xls");
- Assert.AreEqual(893, wb.NumberOfNames);
- Assert.AreEqual("Matthew\\Matthew11_1\\Matthew2331_1\\Matthew2351_1\\Matthew2361_1___lab", wb.GetNameName(300));
+ ClassicAssert.AreEqual(893, wb.NumberOfNames);
+ ClassicAssert.AreEqual("Matthew\\Matthew11_1\\Matthew2331_1\\Matthew2351_1\\Matthew2361_1___lab", wb.GetNameName(300));
}
/**
@@ -1972,10 +1972,10 @@ public void Test46368()
HSSFWorkbook wb = OpenSample("46368.xls");
ISheet s = wb.GetSheetAt(0);
ICell cell1 = s.GetRow(0).GetCell(0);
- Assert.AreEqual(32770, cell1.StringCellValue.Length);
+ ClassicAssert.AreEqual(32770, cell1.StringCellValue.Length);
ICell cell2 = s.GetRow(2).GetCell(0);
- Assert.AreEqual(32766, cell2.StringCellValue.Length);
+ ClassicAssert.AreEqual(32766, cell2.StringCellValue.Length);
}
/**
@@ -1988,10 +1988,10 @@ public void Test48180()
ISheet s = wb.GetSheetAt(0);
ICell cell1 = s.GetRow(0).GetCell(0);
- Assert.AreEqual("test ", cell1.StringCellValue);
+ ClassicAssert.AreEqual("test ", cell1.StringCellValue);
ICell cell2 = s.GetRow(0).GetCell(1);
- Assert.AreEqual(1.0, cell2.NumericCellValue);
+ ClassicAssert.AreEqual(1.0, cell2.NumericCellValue);
}
/**
@@ -2009,25 +2009,25 @@ public void Test49185()
{
HSSFWorkbook wb = OpenSample("49185.xls");
IName name = wb.GetName("foobarName");
- Assert.AreEqual("This is a comment", name.Comment);
+ ClassicAssert.AreEqual("This is a comment", name.Comment);
// Rename the name, comment comes with it
name.NameName = ("ChangedName");
- Assert.AreEqual("This is a comment", name.Comment);
+ ClassicAssert.AreEqual("This is a comment", name.Comment);
// Save and re-check
wb = WriteOutAndReadBack(wb);
name = wb.GetName("ChangedName");
- Assert.AreEqual("This is a comment", name.Comment);
+ ClassicAssert.AreEqual("This is a comment", name.Comment);
// Now try to change it
name.Comment = ("Changed Comment");
- Assert.AreEqual("Changed Comment", name.Comment);
+ ClassicAssert.AreEqual("Changed Comment", name.Comment);
// Save and re-check
wb = WriteOutAndReadBack(wb);
name = wb.GetName("ChangedName");
- Assert.AreEqual("Changed Comment", name.Comment);
+ ClassicAssert.AreEqual("Changed Comment", name.Comment);
}
///
/// http://npoi.codeplex.com/WorkItem/View.aspx?WorkItemId=5010
@@ -2078,8 +2078,8 @@ public void Test49524()
ICell normal = r.GetCell(1);
// Check the current ones
- Assert.AreEqual(0, normal.CellStyle.Rotation);
- Assert.AreEqual(0xff, rotated.CellStyle.Rotation);
+ ClassicAssert.AreEqual(0, normal.CellStyle.Rotation);
+ ClassicAssert.AreEqual(0xff, rotated.CellStyle.Rotation);
// Add a new style, also rotated
ICellStyle cs = wb.CreateCellStyle();
@@ -2087,7 +2087,7 @@ public void Test49524()
ICell nc = r.CreateCell(2);
nc.SetCellValue("New Rotated Text");
nc.CellStyle = (cs);
- Assert.AreEqual(0xff, nc.CellStyle.Rotation);
+ ClassicAssert.AreEqual(0xff, nc.CellStyle.Rotation);
// Write out and read back
wb = WriteOutAndReadBack(wb);
@@ -2099,9 +2099,9 @@ public void Test49524()
normal = r.GetCell(1);
nc = r.GetCell(2);
- Assert.AreEqual(0, normal.CellStyle.Rotation);
- Assert.AreEqual(0xff, rotated.CellStyle.Rotation);
- Assert.AreEqual(0xff, nc.CellStyle.Rotation);
+ ClassicAssert.AreEqual(0, normal.CellStyle.Rotation);
+ ClassicAssert.AreEqual(0xff, rotated.CellStyle.Rotation);
+ ClassicAssert.AreEqual(0xff, nc.CellStyle.Rotation);
}
/**
@@ -2112,8 +2112,8 @@ public void Test49931()
{
HSSFWorkbook wb = OpenSample("49931.xls");
- Assert.AreEqual(1, wb.NumberOfSheets);
- Assert.AreEqual("Foo", wb.GetSheetAt(0).GetRow(0).GetCell(0).RichStringCellValue.String);
+ ClassicAssert.AreEqual(1, wb.NumberOfSheets);
+ ClassicAssert.AreEqual("Foo", wb.GetSheetAt(0).GetRow(0).GetCell(0).RichStringCellValue.String);
}
/**
@@ -2128,9 +2128,9 @@ public void Test48325()
// Will show as the centre, as that is what excel does
// with an invalid footer lacking left/right/centre details
- Assert.AreEqual("", f.Left, "Left text should be empty");
- Assert.AreEqual("", f.Right, "Right text should be empty");
- Assert.AreEqual(
+ ClassicAssert.AreEqual("", f.Left, "Left text should be empty");
+ ClassicAssert.AreEqual("", f.Right, "Right text should be empty");
+ ClassicAssert.AreEqual(
"BlahBlah blah blah ", f.Center, "Center text should contain the illegal value"
);
}
@@ -2162,7 +2162,7 @@ public void TestAutoSize_bug50681()
cell0.SetCellValue(longValue);
sheet.AutoSizeColumn(0);
- Assert.AreEqual(255 * 256, sheet.GetColumnWidth(0)); // maximum column width is 255 characters
+ ClassicAssert.AreEqual(255 * 256, sheet.GetColumnWidth(0)); // maximum column width is 255 characters
sheet.SetColumnWidth(0, sheet.GetColumnWidth(0)); // Bug 506819 reports exception at this point
}
/**
@@ -2173,9 +2173,9 @@ public void TestAutoSize_bug50681()
public void Test51143()
{
HSSFWorkbook wb = OpenSample("51143.xls");
- Assert.AreEqual(1, wb.NumberOfSheets);
+ ClassicAssert.AreEqual(1, wb.NumberOfSheets);
wb = WriteOutAndReadBack(wb);
- Assert.AreEqual(1, wb.NumberOfSheets);
+ ClassicAssert.AreEqual(1, wb.NumberOfSheets);
}
/**
@@ -2196,19 +2196,19 @@ public void Test45777()
String s249 = s248 + "1";
String s250 = s248 + "12";
String s251 = s248 + "123";
- Assert.AreEqual(248, s248.Length);
- Assert.AreEqual(249, s249.Length);
- Assert.AreEqual(250, s250.Length);
- Assert.AreEqual(251, s251.Length);
+ ClassicAssert.AreEqual(248, s248.Length);
+ ClassicAssert.AreEqual(249, s249.Length);
+ ClassicAssert.AreEqual(250, s250.Length);
+ ClassicAssert.AreEqual(251, s251.Length);
// Try on headers
s.Header.Center = (s248);
- Assert.AreEqual(254, ((HSSFHeader)s.Header).RawText.Length);
+ ClassicAssert.AreEqual(254, ((HSSFHeader)s.Header).RawText.Length);
WriteOutAndReadBack(wb);
s.Header.Center = (s251);
- Assert.AreEqual(257, ((HSSFHeader)s.Header).RawText.Length);
+ ClassicAssert.AreEqual(257, ((HSSFHeader)s.Header).RawText.Length);
WriteOutAndReadBack(wb);
try
@@ -2231,11 +2231,11 @@ public void Test45777()
// Now try on footers
s.Footer.Center = (s248);
- Assert.AreEqual(254, ((HSSFFooter)s.Footer).RawText.Length);
+ ClassicAssert.AreEqual(254, ((HSSFFooter)s.Footer).RawText.Length);
WriteOutAndReadBack(wb);
s.Footer.Center = (s251);
- Assert.AreEqual(257, ((HSSFFooter)s.Footer).RawText.Length);
+ ClassicAssert.AreEqual(257, ((HSSFFooter)s.Footer).RawText.Length);
WriteOutAndReadBack(wb);
try
@@ -2264,34 +2264,34 @@ public void Test45777()
public void Bug45970()
{
HSSFWorkbook wb1 = OpenSample("FormulaRefs.xls");
- Assert.AreEqual(3, wb1.NumberOfSheets);
+ ClassicAssert.AreEqual(3, wb1.NumberOfSheets);
ISheet s = wb1.GetSheetAt(0);
IRow row;
row = s.GetRow(0);
- Assert.AreEqual(CellType.Numeric, row.GetCell(1).CellType);
- Assert.AreEqual(112.0, row.GetCell(1).NumericCellValue);
+ ClassicAssert.AreEqual(CellType.Numeric, row.GetCell(1).CellType);
+ ClassicAssert.AreEqual(112.0, row.GetCell(1).NumericCellValue);
row = s.GetRow(1);
- Assert.AreEqual(CellType.Formula, row.GetCell(1).CellType);
- Assert.AreEqual("B1", row.GetCell(1).CellFormula);
- Assert.AreEqual(112.0, row.GetCell(1).NumericCellValue);
+ ClassicAssert.AreEqual(CellType.Formula, row.GetCell(1).CellType);
+ ClassicAssert.AreEqual("B1", row.GetCell(1).CellFormula);
+ ClassicAssert.AreEqual(112.0, row.GetCell(1).NumericCellValue);
row = s.GetRow(2);
- Assert.AreEqual(CellType.Formula, row.GetCell(1).CellType);
- Assert.AreEqual("Sheet1!B1", row.GetCell(1).CellFormula);
- Assert.AreEqual(112.0, row.GetCell(1).NumericCellValue);
+ ClassicAssert.AreEqual(CellType.Formula, row.GetCell(1).CellType);
+ ClassicAssert.AreEqual("Sheet1!B1", row.GetCell(1).CellFormula);
+ ClassicAssert.AreEqual(112.0, row.GetCell(1).NumericCellValue);
row = s.GetRow(3);
- Assert.AreEqual(CellType.Formula, row.GetCell(1).CellType);
- Assert.AreEqual("[Formulas2.xls]Sheet1!B2", row.GetCell(1).CellFormula);
- Assert.AreEqual(112.0, row.GetCell(1).NumericCellValue);
+ ClassicAssert.AreEqual(CellType.Formula, row.GetCell(1).CellType);
+ ClassicAssert.AreEqual("[Formulas2.xls]Sheet1!B2", row.GetCell(1).CellFormula);
+ ClassicAssert.AreEqual(112.0, row.GetCell(1).NumericCellValue);
row = s.GetRow(4);
- Assert.AreEqual(CellType.Formula, row.GetCell(1).CellType);
- Assert.AreEqual("'[$http://gagravarr.org/FormulaRefs.xls]Sheet1'!B1", row.GetCell(1).CellFormula);
- Assert.AreEqual(112.0, row.GetCell(1).NumericCellValue);
+ ClassicAssert.AreEqual(CellType.Formula, row.GetCell(1).CellType);
+ ClassicAssert.AreEqual("'[$http://gagravarr.org/FormulaRefs.xls]Sheet1'!B1", row.GetCell(1).CellFormula);
+ ClassicAssert.AreEqual(112.0, row.GetCell(1).NumericCellValue);
// Link our new workbook
IWorkbook externalWb1 = new HSSFWorkbook();
@@ -2320,33 +2320,33 @@ public void Bug45970()
s = wb2.GetSheetAt(0);
row = s.GetRow(0);
- Assert.AreEqual(CellType.Numeric, row.GetCell(1).CellType);
- Assert.AreEqual(112.0, row.GetCell(1).NumericCellValue);
+ ClassicAssert.AreEqual(CellType.Numeric, row.GetCell(1).CellType);
+ ClassicAssert.AreEqual(112.0, row.GetCell(1).NumericCellValue);
row = s.GetRow(1);
- Assert.AreEqual(CellType.Formula, row.GetCell(1).CellType);
- Assert.AreEqual("B1", row.GetCell(1).CellFormula);
- Assert.AreEqual(112.0, row.GetCell(1).NumericCellValue);
+ ClassicAssert.AreEqual(CellType.Formula, row.GetCell(1).CellType);
+ ClassicAssert.AreEqual("B1", row.GetCell(1).CellFormula);
+ ClassicAssert.AreEqual(112.0, row.GetCell(1).NumericCellValue);
row = s.GetRow(2);
- Assert.AreEqual(CellType.Formula, row.GetCell(1).CellType);
- Assert.AreEqual("Sheet1!B1", row.GetCell(1).CellFormula);
- Assert.AreEqual(112.0, row.GetCell(1).NumericCellValue);
+ ClassicAssert.AreEqual(CellType.Formula, row.GetCell(1).CellType);
+ ClassicAssert.AreEqual("Sheet1!B1", row.GetCell(1).CellFormula);
+ ClassicAssert.AreEqual(112.0, row.GetCell(1).NumericCellValue);
row = s.GetRow(3);
- Assert.AreEqual(CellType.Formula, row.GetCell(1).CellType);
- Assert.AreEqual("[Formulas2.xls]Sheet1!B2", row.GetCell(1).CellFormula);
- Assert.AreEqual(112.0, row.GetCell(1).NumericCellValue);
+ ClassicAssert.AreEqual(CellType.Formula, row.GetCell(1).CellType);
+ ClassicAssert.AreEqual("[Formulas2.xls]Sheet1!B2", row.GetCell(1).CellFormula);
+ ClassicAssert.AreEqual(112.0, row.GetCell(1).NumericCellValue);
row = s.GetRow(4);
- Assert.AreEqual(CellType.Formula, row.GetCell(1).CellType);
- Assert.AreEqual("'[$http://gagravarr.org/FormulaRefs2.xls]Sheet1'!B2", row.GetCell(1).CellFormula);
- Assert.AreEqual(123.0, row.GetCell(1).NumericCellValue);
+ ClassicAssert.AreEqual(CellType.Formula, row.GetCell(1).CellType);
+ ClassicAssert.AreEqual("'[$http://gagravarr.org/FormulaRefs2.xls]Sheet1'!B2", row.GetCell(1).CellFormula);
+ ClassicAssert.AreEqual(123.0, row.GetCell(1).NumericCellValue);
row = s.GetRow(5);
- Assert.AreEqual(CellType.Formula, row.GetCell(1).CellType);
- Assert.AreEqual("'[$http://example.com/FormulaRefs.xls]Sheet1'!B1", row.GetCell(1).CellFormula);
- Assert.AreEqual(234.0, row.GetCell(1).NumericCellValue);
+ ClassicAssert.AreEqual(CellType.Formula, row.GetCell(1).CellType);
+ ClassicAssert.AreEqual("'[$http://example.com/FormulaRefs.xls]Sheet1'!B1", row.GetCell(1).CellFormula);
+ ClassicAssert.AreEqual(234.0, row.GetCell(1).NumericCellValue);
wb2.Close();
}
@@ -2365,34 +2365,34 @@ public void Test47251() {
public void Test47847()
{
HSSFWorkbook wb = OpenSample("47847.xls");
- Assert.AreEqual(3, wb.NumberOfSheets);
+ ClassicAssert.AreEqual(3, wb.NumberOfSheets);
// Find the SST record
UnicodeString withExt = wb.Workbook.GetSSTString(0);
UnicodeString withoutExt = wb.Workbook.GetSSTString(31);
- Assert.AreEqual("O:Alloc:Qty", withExt.String);
- Assert.IsTrue((withExt.OptionFlags & 0x0004) == 0x0004);
+ ClassicAssert.AreEqual("O:Alloc:Qty", withExt.String);
+ ClassicAssert.IsTrue((withExt.OptionFlags & 0x0004) == 0x0004);
- Assert.AreEqual("RT", withoutExt.String);
- Assert.IsTrue((withoutExt.OptionFlags & 0x0004) == 0x0000);
+ ClassicAssert.AreEqual("RT", withoutExt.String);
+ ClassicAssert.IsTrue((withoutExt.OptionFlags & 0x0004) == 0x0000);
// Something about continues...
// Write out and re-read
wb = WriteOutAndReadBack(wb);
- Assert.AreEqual(3, wb.NumberOfSheets);
+ ClassicAssert.AreEqual(3, wb.NumberOfSheets);
// Check it's the same now
withExt = wb.Workbook.GetSSTString(0);
withoutExt = wb.Workbook.GetSSTString(31);
- Assert.AreEqual("O:Alloc:Qty", withExt.String);
- Assert.IsTrue((withExt.OptionFlags & 0x0004) == 0x0004);
+ ClassicAssert.AreEqual("O:Alloc:Qty", withExt.String);
+ ClassicAssert.IsTrue((withExt.OptionFlags & 0x0004) == 0x0004);
- Assert.AreEqual("RT", withoutExt.String);
- Assert.IsTrue((withoutExt.OptionFlags & 0x0004) == 0x0000);
+ ClassicAssert.AreEqual("RT", withoutExt.String);
+ ClassicAssert.IsTrue((withoutExt.OptionFlags & 0x0004) == 0x0000);
}
[Test]
public void Test48026()
@@ -2403,7 +2403,7 @@ public void Test48026()
public void Test48968()
{
HSSFWorkbook wb = OpenSample("48968.xls");
- Assert.AreEqual(1, wb.NumberOfSheets);
+ ClassicAssert.AreEqual(1, wb.NumberOfSheets);
DataFormatter fmt = new DataFormatter();
@@ -2412,40 +2412,40 @@ public void Test48968()
ICell cell_d20110325 = s.GetRow(0).GetCell(0);
ICell cell_d19000102 = s.GetRow(11).GetCell(0);
ICell cell_d19000100 = s.GetRow(21).GetCell(0);
- Assert.AreEqual(s.GetRow(0).GetCell(3).StringCellValue, fmt.FormatCellValue(cell_d20110325));
- Assert.AreEqual(s.GetRow(11).GetCell(3).StringCellValue, fmt.FormatCellValue(cell_d19000102));
+ ClassicAssert.AreEqual(s.GetRow(0).GetCell(3).StringCellValue, fmt.FormatCellValue(cell_d20110325));
+ ClassicAssert.AreEqual(s.GetRow(11).GetCell(3).StringCellValue, fmt.FormatCellValue(cell_d19000102));
// There is no such thing as 00/01/1900...
- Assert.AreEqual("00/01/1900 06:14:24", s.GetRow(21).GetCell(3).StringCellValue);
- Assert.AreEqual("31/12/1899 06:14:24", fmt.FormatCellValue(cell_d19000100));
+ ClassicAssert.AreEqual("00/01/1900 06:14:24", s.GetRow(21).GetCell(3).StringCellValue);
+ ClassicAssert.AreEqual("31/12/1899 06:14:24", fmt.FormatCellValue(cell_d19000100));
// Check the cached values
- Assert.AreEqual("HOUR(A1)", s.GetRow(5).GetCell(0).CellFormula);
- Assert.AreEqual(11.0, s.GetRow(5).GetCell(0).NumericCellValue);
- Assert.AreEqual("MINUTE(A1)", s.GetRow(6).GetCell(0).CellFormula);
- Assert.AreEqual(39.0, s.GetRow(6).GetCell(0).NumericCellValue);
- Assert.AreEqual("SECOND(A1)", s.GetRow(7).GetCell(0).CellFormula);
- Assert.AreEqual(54.0, s.GetRow(7).GetCell(0).NumericCellValue);
+ ClassicAssert.AreEqual("HOUR(A1)", s.GetRow(5).GetCell(0).CellFormula);
+ ClassicAssert.AreEqual(11.0, s.GetRow(5).GetCell(0).NumericCellValue);
+ ClassicAssert.AreEqual("MINUTE(A1)", s.GetRow(6).GetCell(0).CellFormula);
+ ClassicAssert.AreEqual(39.0, s.GetRow(6).GetCell(0).NumericCellValue);
+ ClassicAssert.AreEqual("SECOND(A1)", s.GetRow(7).GetCell(0).CellFormula);
+ ClassicAssert.AreEqual(54.0, s.GetRow(7).GetCell(0).NumericCellValue);
// Re-evaulate and check
HSSFFormulaEvaluator.EvaluateAllFormulaCells(wb);
- Assert.AreEqual("HOUR(A1)", s.GetRow(5).GetCell(0).CellFormula);
- Assert.AreEqual(11.0, s.GetRow(5).GetCell(0).NumericCellValue);
- Assert.AreEqual("MINUTE(A1)", s.GetRow(6).GetCell(0).CellFormula);
- Assert.AreEqual(39.0, s.GetRow(6).GetCell(0).NumericCellValue);
- Assert.AreEqual("SECOND(A1)", s.GetRow(7).GetCell(0).CellFormula);
- Assert.AreEqual(54.0, s.GetRow(7).GetCell(0).NumericCellValue);
+ ClassicAssert.AreEqual("HOUR(A1)", s.GetRow(5).GetCell(0).CellFormula);
+ ClassicAssert.AreEqual(11.0, s.GetRow(5).GetCell(0).NumericCellValue);
+ ClassicAssert.AreEqual("MINUTE(A1)", s.GetRow(6).GetCell(0).CellFormula);
+ ClassicAssert.AreEqual(39.0, s.GetRow(6).GetCell(0).NumericCellValue);
+ ClassicAssert.AreEqual("SECOND(A1)", s.GetRow(7).GetCell(0).CellFormula);
+ ClassicAssert.AreEqual(54.0, s.GetRow(7).GetCell(0).NumericCellValue);
// Push the time forward a bit and check
double date = s.GetRow(0).GetCell(0).NumericCellValue;
s.GetRow(0).GetCell(0).SetCellValue(date + 1.26);
HSSFFormulaEvaluator.EvaluateAllFormulaCells(wb);
- Assert.AreEqual("HOUR(A1)", s.GetRow(5).GetCell(0).CellFormula);
- Assert.AreEqual(11.0 + 6.0, s.GetRow(5).GetCell(0).NumericCellValue);
- Assert.AreEqual("MINUTE(A1)", s.GetRow(6).GetCell(0).CellFormula);
- Assert.AreEqual(39.0 + 14.0 + 1, s.GetRow(6).GetCell(0).NumericCellValue);
- Assert.AreEqual("SECOND(A1)", s.GetRow(7).GetCell(0).CellFormula);
- Assert.AreEqual(54.0 + 24.0 - 60, s.GetRow(7).GetCell(0).NumericCellValue);
+ ClassicAssert.AreEqual("HOUR(A1)", s.GetRow(5).GetCell(0).CellFormula);
+ ClassicAssert.AreEqual(11.0 + 6.0, s.GetRow(5).GetCell(0).NumericCellValue);
+ ClassicAssert.AreEqual("MINUTE(A1)", s.GetRow(6).GetCell(0).CellFormula);
+ ClassicAssert.AreEqual(39.0 + 14.0 + 1, s.GetRow(6).GetCell(0).NumericCellValue);
+ ClassicAssert.AreEqual("SECOND(A1)", s.GetRow(7).GetCell(0).CellFormula);
+ ClassicAssert.AreEqual(54.0 + 24.0 - 60, s.GetRow(7).GetCell(0).NumericCellValue);
}
/**
* Problem with cloning a sheet with a chart
@@ -2455,22 +2455,22 @@ public void Test48968()
public void Test49096()
{
HSSFWorkbook wb = OpenSample("49096.xls");
- Assert.AreEqual(1, wb.NumberOfSheets);
+ ClassicAssert.AreEqual(1, wb.NumberOfSheets);
- Assert.IsNotNull(wb.GetSheetAt(0));
+ ClassicAssert.IsNotNull(wb.GetSheetAt(0));
wb.CloneSheet(0);
- Assert.AreEqual(2, wb.NumberOfSheets);
+ ClassicAssert.AreEqual(2, wb.NumberOfSheets);
wb = WriteOutAndReadBack(wb);
- Assert.AreEqual(2, wb.NumberOfSheets);
+ ClassicAssert.AreEqual(2, wb.NumberOfSheets);
}
[Test]
public void Test49219()
{
HSSFWorkbook wb = OpenSample("49219.xls");
- Assert.AreEqual(1, wb.NumberOfSheets);
- Assert.AreEqual("DGATE", wb.GetSheetAt(0).GetRow(1).GetCell(0).StringCellValue);
+ ClassicAssert.AreEqual(1, wb.NumberOfSheets);
+ ClassicAssert.AreEqual("DGATE", wb.GetSheetAt(0).GetRow(1).GetCell(0).StringCellValue);
}
/**
* Setting the user style name on custom styles
@@ -2487,13 +2487,13 @@ public void Test49689()
HSSFCellStyle cs2 = (HSSFCellStyle)wb1.CreateCellStyle();
HSSFCellStyle cs3 = (HSSFCellStyle)wb1.CreateCellStyle();
- Assert.AreEqual(21, cs1.Index);
+ ClassicAssert.AreEqual(21, cs1.Index);
cs1.UserStyleName = ("Testing");
- Assert.AreEqual(22, cs2.Index);
+ ClassicAssert.AreEqual(22, cs2.Index);
cs2.UserStyleName = ("Testing 2");
- Assert.AreEqual(23, cs3.Index);
+ ClassicAssert.AreEqual(23, cs3.Index);
cs3.UserStyleName = ("Testing 3");
// Set one
@@ -2503,9 +2503,9 @@ public void Test49689()
HSSFWorkbook wb2 = WriteOutAndReadBack(wb1);
// Re-check
- Assert.AreEqual("Testing", ((HSSFCellStyle)wb2.GetCellStyleAt((short)21)).UserStyleName);
- Assert.AreEqual("Testing 2", ((HSSFCellStyle)wb2.GetCellStyleAt((short)22)).UserStyleName);
- Assert.AreEqual("Testing 3", ((HSSFCellStyle)wb2.GetCellStyleAt((short)23)).UserStyleName);
+ ClassicAssert.AreEqual("Testing", ((HSSFCellStyle)wb2.GetCellStyleAt((short)21)).UserStyleName);
+ ClassicAssert.AreEqual("Testing 2", ((HSSFCellStyle)wb2.GetCellStyleAt((short)22)).UserStyleName);
+ ClassicAssert.AreEqual("Testing 3", ((HSSFCellStyle)wb2.GetCellStyleAt((short)23)).UserStyleName);
wb2.Close();
}
@@ -2533,7 +2533,7 @@ public void Test49751()
if (styleName != null)
{
collecteddStyles.Add(styleName);
- Assert.IsTrue(namedStylesList.Contains(styleName));
+ ClassicAssert.IsTrue(namedStylesList.Contains(styleName));
}
}
}
@@ -2557,40 +2557,40 @@ public void Test50416LastRowNumber()
cellA_3.SetCellValue("Cell A,3");
// Test the last Row number it currently correct
- Assert.AreEqual(2, sheet.LastRowNum);
+ ClassicAssert.AreEqual(2, sheet.LastRowNum);
// Shift the first row to the end
sheet.ShiftRows(0, 0, 3);
- Assert.AreEqual(3, sheet.LastRowNum);
- Assert.AreEqual(-1, sheet.GetRow(0).LastCellNum);
- Assert.AreEqual("Cell A,2", sheet.GetRow(1).GetCell(0).StringCellValue);
- Assert.AreEqual("Cell A,3", sheet.GetRow(2).GetCell(0).StringCellValue);
- Assert.AreEqual("Cell A,1", sheet.GetRow(3).GetCell(0).StringCellValue);
+ ClassicAssert.AreEqual(3, sheet.LastRowNum);
+ ClassicAssert.AreEqual(-1, sheet.GetRow(0).LastCellNum);
+ ClassicAssert.AreEqual("Cell A,2", sheet.GetRow(1).GetCell(0).StringCellValue);
+ ClassicAssert.AreEqual("Cell A,3", sheet.GetRow(2).GetCell(0).StringCellValue);
+ ClassicAssert.AreEqual("Cell A,1", sheet.GetRow(3).GetCell(0).StringCellValue);
// Shift the 2nd row up to the first one
sheet.ShiftRows(1, 1, -1);
- Assert.AreEqual(3, sheet.LastRowNum);
- Assert.AreEqual("Cell A,2", sheet.GetRow(0).GetCell(0).StringCellValue);
- Assert.AreEqual(-1, sheet.GetRow(1).LastCellNum);
- Assert.AreEqual("Cell A,3", sheet.GetRow(2).GetCell(0).StringCellValue);
- Assert.AreEqual("Cell A,1", sheet.GetRow(3).GetCell(0).StringCellValue);
+ ClassicAssert.AreEqual(3, sheet.LastRowNum);
+ ClassicAssert.AreEqual("Cell A,2", sheet.GetRow(0).GetCell(0).StringCellValue);
+ ClassicAssert.AreEqual(-1, sheet.GetRow(1).LastCellNum);
+ ClassicAssert.AreEqual("Cell A,3", sheet.GetRow(2).GetCell(0).StringCellValue);
+ ClassicAssert.AreEqual("Cell A,1", sheet.GetRow(3).GetCell(0).StringCellValue);
// Shift the 4th row up into the gap in the 3rd row
sheet.ShiftRows(3, 3, -2);
- Assert.AreEqual(2, sheet.LastRowNum);
- Assert.AreEqual("Cell A,2", sheet.GetRow(0).GetCell(0).StringCellValue);
- Assert.AreEqual("Cell A,1", sheet.GetRow(1).GetCell(0).StringCellValue);
- Assert.AreEqual("Cell A,3", sheet.GetRow(2).GetCell(0).StringCellValue);
- Assert.AreEqual(-1, sheet.GetRow(3).LastCellNum);
+ ClassicAssert.AreEqual(2, sheet.LastRowNum);
+ ClassicAssert.AreEqual("Cell A,2", sheet.GetRow(0).GetCell(0).StringCellValue);
+ ClassicAssert.AreEqual("Cell A,1", sheet.GetRow(1).GetCell(0).StringCellValue);
+ ClassicAssert.AreEqual("Cell A,3", sheet.GetRow(2).GetCell(0).StringCellValue);
+ ClassicAssert.AreEqual(-1, sheet.GetRow(3).LastCellNum);
// Now zap the empty 4th row - won't do anything
sheet.RemoveRow(sheet.GetRow(3));
// Test again the last row number which should be 2
- Assert.AreEqual(2, sheet.LastRowNum);
- Assert.AreEqual("Cell A,2", sheet.GetRow(0).GetCell(0).StringCellValue);
- Assert.AreEqual("Cell A,1", sheet.GetRow(1).GetCell(0).StringCellValue);
- Assert.AreEqual("Cell A,3", sheet.GetRow(2).GetCell(0).StringCellValue);
+ ClassicAssert.AreEqual(2, sheet.LastRowNum);
+ ClassicAssert.AreEqual("Cell A,2", sheet.GetRow(0).GetCell(0).StringCellValue);
+ ClassicAssert.AreEqual("Cell A,1", sheet.GetRow(1).GetCell(0).StringCellValue);
+ ClassicAssert.AreEqual("Cell A,3", sheet.GetRow(2).GetCell(0).StringCellValue);
workbook.Close();
}
@@ -2613,25 +2613,25 @@ public void Test50756()
IRow r18 = s.GetRow(17);
DataFormatter df = new DataFormatter();
- Assert.AreEqual(10.0, r17.GetCell(1).NumericCellValue);
- Assert.AreEqual(20.0, r17.GetCell(2).NumericCellValue);
- Assert.AreEqual(20.0, r17.GetCell(3).NumericCellValue);
- Assert.AreEqual("GENERAL", r17.GetCell(1).CellStyle.GetDataFormatString());
- Assert.AreEqual("GENERAL", r17.GetCell(2).CellStyle.GetDataFormatString());
- Assert.AreEqual("GENERAL", r17.GetCell(3).CellStyle.GetDataFormatString());
- Assert.AreEqual("10", df.FormatCellValue(r17.GetCell(1)));
- Assert.AreEqual("20", df.FormatCellValue(r17.GetCell(2)));
- Assert.AreEqual("20", df.FormatCellValue(r17.GetCell(3)));
-
- Assert.AreEqual(16.0, r18.GetCell(1).NumericCellValue);
- Assert.AreEqual(35.0, r18.GetCell(2).NumericCellValue);
- Assert.AreEqual(123.0, r18.GetCell(3).NumericCellValue);
- Assert.AreEqual("GENERAL", r18.GetCell(1).CellStyle.GetDataFormatString());
- Assert.AreEqual("GENERAL", r18.GetCell(2).CellStyle.GetDataFormatString());
- Assert.AreEqual("GENERAL", r18.GetCell(3).CellStyle.GetDataFormatString());
- Assert.AreEqual("16", df.FormatCellValue(r18.GetCell(1)));
- Assert.AreEqual("35", df.FormatCellValue(r18.GetCell(2)));
- Assert.AreEqual("123", df.FormatCellValue(r18.GetCell(3)));
+ ClassicAssert.AreEqual(10.0, r17.GetCell(1).NumericCellValue);
+ ClassicAssert.AreEqual(20.0, r17.GetCell(2).NumericCellValue);
+ ClassicAssert.AreEqual(20.0, r17.GetCell(3).NumericCellValue);
+ ClassicAssert.AreEqual("GENERAL", r17.GetCell(1).CellStyle.GetDataFormatString());
+ ClassicAssert.AreEqual("GENERAL", r17.GetCell(2).CellStyle.GetDataFormatString());
+ ClassicAssert.AreEqual("GENERAL", r17.GetCell(3).CellStyle.GetDataFormatString());
+ ClassicAssert.AreEqual("10", df.FormatCellValue(r17.GetCell(1)));
+ ClassicAssert.AreEqual("20", df.FormatCellValue(r17.GetCell(2)));
+ ClassicAssert.AreEqual("20", df.FormatCellValue(r17.GetCell(3)));
+
+ ClassicAssert.AreEqual(16.0, r18.GetCell(1).NumericCellValue);
+ ClassicAssert.AreEqual(35.0, r18.GetCell(2).NumericCellValue);
+ ClassicAssert.AreEqual(123.0, r18.GetCell(3).NumericCellValue);
+ ClassicAssert.AreEqual("GENERAL", r18.GetCell(1).CellStyle.GetDataFormatString());
+ ClassicAssert.AreEqual("GENERAL", r18.GetCell(2).CellStyle.GetDataFormatString());
+ ClassicAssert.AreEqual("GENERAL", r18.GetCell(3).CellStyle.GetDataFormatString());
+ ClassicAssert.AreEqual("16", df.FormatCellValue(r18.GetCell(1)));
+ ClassicAssert.AreEqual("35", df.FormatCellValue(r18.GetCell(2)));
+ ClassicAssert.AreEqual("123", df.FormatCellValue(r18.GetCell(3)));
}
public void Test50779()
{
@@ -2653,16 +2653,16 @@ public void Test50833()
{
HSSFWorkbook wb = OpenSample("50833.xls");
ISheet s = wb.GetSheetAt(0);
- Assert.AreEqual("Sheet1", s.SheetName);
- Assert.AreEqual(false, s.Protect);
+ ClassicAssert.AreEqual("Sheet1", s.SheetName);
+ ClassicAssert.AreEqual(false, s.Protect);
ICell c = s.GetRow(0).GetCell(0);
- Assert.AreEqual("test cell value", c.RichStringCellValue.String);
+ ClassicAssert.AreEqual("test cell value", c.RichStringCellValue.String);
IComment cmt = c.CellComment;
- Assert.IsNotNull(cmt);
- Assert.AreEqual("Robert Lawrence", cmt.Author);
- Assert.AreEqual("Robert Lawrence:\ntest comment", cmt.String.String);
+ ClassicAssert.IsNotNull(cmt);
+ ClassicAssert.AreEqual("Robert Lawrence", cmt.Author);
+ ClassicAssert.AreEqual("Robert Lawrence:\ntest comment", cmt.String.String);
// Reload
wb = WriteOutAndReadBack(wb);
@@ -2671,9 +2671,9 @@ public void Test50833()
// Re-check the comment
cmt = c.CellComment;
- Assert.IsNotNull(cmt);
- Assert.AreEqual("Robert Lawrence", cmt.Author);
- Assert.AreEqual("Robert Lawrence:\ntest comment", cmt.String.String);
+ ClassicAssert.IsNotNull(cmt);
+ ClassicAssert.AreEqual("Robert Lawrence", cmt.Author);
+ ClassicAssert.AreEqual("Robert Lawrence:\ntest comment", cmt.String.String);
// TODO Identify what excel doesn't like, and check for that
}
@@ -2685,7 +2685,7 @@ public void Test50833()
public void Test50939()
{
HSSFWorkbook wb = OpenSample("50939.xls");
- Assert.AreEqual(2, wb.NumberOfSheets);
+ ClassicAssert.AreEqual(2, wb.NumberOfSheets);
}
/**
@@ -2702,8 +2702,8 @@ public void Test51461()
HSSFWorkbook wbNPOIFS = new HSSFWorkbook(new NPOIFSFileSystem(
new MemoryStream(data)).Root, false);
- Assert.AreEqual(2, wbPOIFS.NumberOfSheets);
- Assert.AreEqual(2, wbNPOIFS.NumberOfSheets);
+ ClassicAssert.AreEqual(2, wbPOIFS.NumberOfSheets);
+ ClassicAssert.AreEqual(2, wbNPOIFS.NumberOfSheets);
}
/**
* Large row numbers and NPOIFS vs POIFS
@@ -2720,22 +2720,22 @@ public void Test51535()
foreach (HSSFWorkbook wb in new HSSFWorkbook[] { wbPOIFS, wbNPOIFS })
{
- Assert.AreEqual(3, wb.NumberOfSheets);
+ ClassicAssert.AreEqual(3, wb.NumberOfSheets);
// Check directly
ISheet s = wb.GetSheetAt(0);
- Assert.AreEqual("Top Left Cell", s.GetRow(0).GetCell(0).StringCellValue);
- Assert.AreEqual("Top Right Cell", s.GetRow(0).GetCell(255).StringCellValue);
- Assert.AreEqual("Bottom Left Cell", s.GetRow(65535).GetCell(0).StringCellValue);
- Assert.AreEqual("Bottom Right Cell", s.GetRow(65535).GetCell(255).StringCellValue);
+ ClassicAssert.AreEqual("Top Left Cell", s.GetRow(0).GetCell(0).StringCellValue);
+ ClassicAssert.AreEqual("Top Right Cell", s.GetRow(0).GetCell(255).StringCellValue);
+ ClassicAssert.AreEqual("Bottom Left Cell", s.GetRow(65535).GetCell(0).StringCellValue);
+ ClassicAssert.AreEqual("Bottom Right Cell", s.GetRow(65535).GetCell(255).StringCellValue);
// Extract and check
ExcelExtractor ex = new ExcelExtractor(wb);
String text = ex.Text;
- Assert.IsTrue(text.Contains("Top Left Cell"));
- Assert.IsTrue(text.Contains("Top Right Cell"));
- Assert.IsTrue(text.Contains("Bottom Left Cell"));
- Assert.IsTrue(text.Contains("Bottom Right Cell"));
+ ClassicAssert.IsTrue(text.Contains("Top Left Cell"));
+ ClassicAssert.IsTrue(text.Contains("Top Right Cell"));
+ ClassicAssert.IsTrue(text.Contains("Bottom Left Cell"));
+ ClassicAssert.IsTrue(text.Contains("Bottom Right Cell"));
}
}
@@ -2747,20 +2747,20 @@ public void Test51535()
public void Test48703()
{
HSSFWorkbook wb = OpenSample("48703.xls");
- Assert.AreEqual(3, wb.NumberOfSheets);
+ ClassicAssert.AreEqual(3, wb.NumberOfSheets);
// Check reading the formula
ISheet sheet = wb.GetSheetAt(0);
IRow r = sheet.GetRow(0);
ICell c = r.GetCell(0);
- Assert.AreEqual("SUM(Sheet2:Sheet3!A1)", c.CellFormula);
- Assert.AreEqual(4.0, c.NumericCellValue);
+ ClassicAssert.AreEqual("SUM(Sheet2:Sheet3!A1)", c.CellFormula);
+ ClassicAssert.AreEqual(4.0, c.NumericCellValue);
// Check the evaluated result
HSSFFormulaEvaluator eval = new HSSFFormulaEvaluator(wb);
eval.EvaluateFormulaCell(c);
- Assert.AreEqual(4.0, c.NumericCellValue);
+ ClassicAssert.AreEqual(4.0, c.NumericCellValue);
}
/**
* Normally encrypted files have BOF then FILEPASS, but
@@ -2786,7 +2786,7 @@ public void Test49896()
HSSFWorkbook wb = OpenSample("49896.xls");
HSSFCell cell = (HSSFCell)wb.GetSheetAt(0).GetRow(1).GetCell(1);
char separator = Path.DirectorySeparatorChar;
- Assert.AreEqual("VLOOKUP(A2,'[C:Documents and Settings" + separator + "Yegor" + separator
+ ClassicAssert.AreEqual("VLOOKUP(A2,'[C:Documents and Settings" + separator + "Yegor" + separator
+ "My Documents" + separator + "csco.xls]Sheet1'!$A$2:$B$3,2,FALSE)",
cell.CellFormula);
}
@@ -2824,16 +2824,16 @@ public void bug49612_part()
HSSFCell d1 = row.GetCell(3) as HSSFCell;
HSSFCell e1 = row.GetCell(2) as HSSFCell;
- Assert.AreEqual("SUM(BOB+JIM)", c1.CellFormula);
+ ClassicAssert.AreEqual("SUM(BOB+JIM)", c1.CellFormula);
// Problem 1: See TestUnfixedBugs#test49612()
// Problem 2: TestUnfixedBugs#test49612()
// Problem 3: These used to fail, now pass
HSSFFormulaEvaluator eval = new HSSFFormulaEvaluator(wb);
- Assert.AreEqual(30.0, eval.Evaluate(c1).NumberValue, 0.001, "Evaluating c1");
- Assert.AreEqual(30.0, eval.Evaluate(d1).NumberValue, 0.001, "Evaluating d1");
- Assert.AreEqual(30.0, eval.Evaluate(e1).NumberValue, 0.001, "Evaluating e1");
+ ClassicAssert.AreEqual(30.0, eval.Evaluate(c1).NumberValue, 0.001, "Evaluating c1");
+ ClassicAssert.AreEqual(30.0, eval.Evaluate(d1).NumberValue, 0.001, "Evaluating d1");
+ ClassicAssert.AreEqual(30.0, eval.Evaluate(e1).NumberValue, 0.001, "Evaluating e1");
}
[Test]
@@ -2845,8 +2845,8 @@ public void bug51675()
InternalSheet ish = HSSFTestHelper.GetSheetForTest(sh);
PageSettingsBlock psb = (PageSettingsBlock)ish.Records[(13)];
psb.VisitContainedRecords(new RecordVisitor1(list));
- Assert.IsTrue(list[(list.Count - 1)] == UnknownRecord.BITMAP_00E9);
- Assert.IsTrue(list[(list.Count - 2)] == UnknownRecord.HEADER_FOOTER_089C);
+ ClassicAssert.IsTrue(list[(list.Count - 1)] == UnknownRecord.BITMAP_00E9);
+ ClassicAssert.IsTrue(list[(list.Count - 2)] == UnknownRecord.HEADER_FOOTER_089C);
}
public class RecordVisitor1 : RecordVisitor
{
@@ -2873,7 +2873,7 @@ public void Test52272()
s.ShapeType = (HSSFSimpleShape.OBJECT_TYPE_LINE);
HSSFSheet sh2 = wb.CloneSheet(0) as HSSFSheet;
- Assert.IsNotNull(sh2.DrawingPatriarch);
+ ClassicAssert.IsNotNull(sh2.DrawingPatriarch);
wb.Close();
}
@@ -2883,20 +2883,20 @@ public void Test53432()
{
IWorkbook wb1 = new HSSFWorkbook(); //or new HSSFWorkbook();
wb1.AddPicture(new byte[] { 123, 22 }, PictureType.JPEG);
- Assert.AreEqual(wb1.GetAllPictures().Count, 1);
+ ClassicAssert.AreEqual(wb1.GetAllPictures().Count, 1);
wb1.Close();
wb1.Close();
wb1 = new HSSFWorkbook();
IWorkbook wb2 = WriteOutAndReadBack((HSSFWorkbook)wb1);
wb1.Close();
- Assert.AreEqual(wb2.GetAllPictures().Count, 0);
+ ClassicAssert.AreEqual(wb2.GetAllPictures().Count, 0);
wb2.AddPicture(new byte[] { 123, 22 }, PictureType.JPEG);
- Assert.AreEqual(wb2.GetAllPictures().Count, 1);
+ ClassicAssert.AreEqual(wb2.GetAllPictures().Count, 1);
IWorkbook wb3 = WriteOutAndReadBack((HSSFWorkbook)wb2);
wb2.Close();
- Assert.AreEqual(wb3.GetAllPictures().Count, 1);
+ ClassicAssert.AreEqual(wb3.GetAllPictures().Count, 1);
wb3.Close();
}
@@ -2952,7 +2952,7 @@ public void TestBug49237()
ISheet sheet = wb.GetSheetAt(0);
IRow row = sheet.GetRow(0);
ICellStyle rstyle = row.RowStyle;
- Assert.AreEqual(rstyle.BorderBottom, BorderStyle.Double);
+ ClassicAssert.AreEqual(rstyle.BorderBottom, BorderStyle.Double);
}
[Test]
@@ -2992,24 +2992,24 @@ public void Bug56450()
{
if (c.CellComment != null)
{
- Assert.IsNotNull(c.CellComment.String.String);
+ ClassicAssert.IsNotNull(c.CellComment.String.String);
comments++;
}
}
}
- Assert.AreEqual(0, comments);
+ ClassicAssert.AreEqual(0, comments);
}
[Test]
public void Bug56482()
{
HSSFWorkbook wb = OpenSample("56482.xls");
- Assert.AreEqual(1, wb.NumberOfSheets);
+ ClassicAssert.AreEqual(1, wb.NumberOfSheets);
HSSFSheet sheet = wb.GetSheetAt(0) as HSSFSheet;
HSSFSheetConditionalFormatting cf = sheet.SheetConditionalFormatting as HSSFSheetConditionalFormatting;
- Assert.AreEqual(5, cf.NumConditionalFormattings);
+ ClassicAssert.AreEqual(5, cf.NumConditionalFormattings);
}
[Test]
@@ -3029,23 +3029,23 @@ public void Bug56325()
stream.Close();
}
- Assert.AreEqual(3, wb1.NumberOfSheets);
+ ClassicAssert.AreEqual(3, wb1.NumberOfSheets);
wb1.RemoveSheetAt(0);
- Assert.AreEqual(2, wb1.NumberOfSheets);
+ ClassicAssert.AreEqual(2, wb1.NumberOfSheets);
HSSFWorkbook wb2 = HSSFTestDataSamples.WriteOutAndReadBack(wb1);
wb1.Close();
- Assert.AreEqual(2, wb2.NumberOfSheets);
+ ClassicAssert.AreEqual(2, wb2.NumberOfSheets);
wb2.RemoveSheetAt(0);
- Assert.AreEqual(1, wb2.NumberOfSheets);
+ ClassicAssert.AreEqual(1, wb2.NumberOfSheets);
wb2.RemoveSheetAt(0);
- Assert.AreEqual(0, wb2.NumberOfSheets);
+ ClassicAssert.AreEqual(0, wb2.NumberOfSheets);
HSSFWorkbook wb3 = HSSFTestDataSamples.WriteOutAndReadBack(wb2);
wb2.Close();
- Assert.AreEqual(0, wb3.NumberOfSheets);
+ ClassicAssert.AreEqual(0, wb3.NumberOfSheets);
wb3.Close();
}
@@ -3067,7 +3067,7 @@ public void Bug56325a()
wb1.RemoveSheetAt(2);
IWorkbook wb2 = HSSFTestDataSamples.WriteOutAndReadBack(wb1);
- Assert.AreEqual(4, wb2.NumberOfSheets);
+ ClassicAssert.AreEqual(4, wb2.NumberOfSheets);
wb2.Close();
wb1.Close();
@@ -3089,29 +3089,29 @@ public void Bug56737()
IName nSheetScope = wb.GetName("NR_To_A1");
IName nWBScope = wb.GetName("NR_Global_B2");
- Assert.IsNotNull(nSheetScope);
- Assert.IsNotNull(nWBScope);
+ ClassicAssert.IsNotNull(nSheetScope);
+ ClassicAssert.IsNotNull(nWBScope);
- Assert.AreEqual("Defines!$A$1", nSheetScope.RefersToFormula);
- Assert.AreEqual("Defines!$B$2", nWBScope.RefersToFormula);
+ ClassicAssert.AreEqual("Defines!$A$1", nSheetScope.RefersToFormula);
+ ClassicAssert.AreEqual("Defines!$B$2", nWBScope.RefersToFormula);
// Check the different kinds of formulas
ISheet s = wb.GetSheetAt(0);
ICell cRefSName = s.GetRow(1).GetCell(3);
ICell cRefWName = s.GetRow(2).GetCell(3);
- Assert.AreEqual("Defines!NR_To_A1", cRefSName.CellFormula);
+ ClassicAssert.AreEqual("Defines!NR_To_A1", cRefSName.CellFormula);
// TODO How does Excel know to prefix this with the filename?
// This is what Excel itself shows
//assertEquals("'56737.xls'!NR_Global_B2", cRefWName.getCellFormula());
// TODO This isn't right, but it's what we currently generate....
- Assert.AreEqual("NR_Global_B2", cRefWName.CellFormula);
+ ClassicAssert.AreEqual("NR_Global_B2", cRefWName.CellFormula);
// Try to Evaluate them
IFormulaEvaluator eval = wb.GetCreationHelper().CreateFormulaEvaluator();
- Assert.AreEqual("Test A1", eval.Evaluate(cRefSName).StringValue);
- Assert.AreEqual(142, (int)eval.Evaluate(cRefWName).NumberValue);
+ ClassicAssert.AreEqual("Test A1", eval.Evaluate(cRefSName).StringValue);
+ ClassicAssert.AreEqual(142, (int)eval.Evaluate(cRefWName).NumberValue);
// Try to Evaluate everything
eval.EvaluateAll();
@@ -3157,22 +3157,22 @@ public void Bug52111()
private void assertFormula(IWorkbook wb, ICell intF, String expectedFormula, String expectedResultOrNull)
{
- Assert.AreEqual(CellType.Formula, intF.CellType);
+ ClassicAssert.AreEqual(CellType.Formula, intF.CellType);
if (null == expectedResultOrNull)
{
- Assert.AreEqual(CellType.Error, intF.CachedFormulaResultType);
+ ClassicAssert.AreEqual(CellType.Error, intF.CachedFormulaResultType);
expectedResultOrNull = "#VALUE!";
}
else
{
- Assert.AreEqual(CellType.Numeric, intF.CachedFormulaResultType);
+ ClassicAssert.AreEqual(CellType.Numeric, intF.CachedFormulaResultType);
}
- Assert.AreEqual(expectedFormula, intF.CellFormula);
+ ClassicAssert.AreEqual(expectedFormula, intF.CellFormula);
// Check we can evaluate it correctly
IFormulaEvaluator eval = wb.GetCreationHelper().CreateFormulaEvaluator();
- Assert.AreEqual(expectedResultOrNull, eval.Evaluate(intF).FormatAsString());
+ ClassicAssert.AreEqual(expectedResultOrNull, eval.Evaluate(intF).FormatAsString());
}
[Test]
public void Bug42016()
@@ -3181,7 +3181,7 @@ public void Bug42016()
ISheet s = wb.GetSheetAt(0);
for (int row = 0; row < 7; row++)
{
- Assert.AreEqual("A$1+B$1", s.GetRow(row).GetCell(2).CellFormula);
+ ClassicAssert.AreEqual("A$1+B$1", s.GetRow(row).GetCell(2).CellFormula);
}
}
@@ -3193,8 +3193,8 @@ public void Bug53984()
{
IWorkbook wb = OpenSample("53984.xls");
ISheet s = wb.GetSheetAt(0);
- Assert.AreEqual("International Communication Services SA", s.GetRow(2).GetCell(0).StringCellValue);
- Assert.AreEqual("Saudi Arabia-Riyadh", s.GetRow(210).GetCell(0).StringCellValue);
+ ClassicAssert.AreEqual("International Communication Services SA", s.GetRow(2).GetCell(0).StringCellValue);
+ ClassicAssert.AreEqual("Saudi Arabia-Riyadh", s.GetRow(210).GetCell(0).StringCellValue);
}
/**
@@ -3218,11 +3218,11 @@ public void bug46670_existing()
// Check we can read them correctly
wb = OpenSample("46670_local.xls");
s = wb.GetSheetAt(0);
- Assert.AreEqual(refLocal, s.GetRow(0).GetCell(0).CellFormula);
+ ClassicAssert.AreEqual(refLocal, s.GetRow(0).GetCell(0).CellFormula);
wb = OpenSample("46670_http.xls");
s = wb.GetSheetAt(0);
- Assert.AreEqual(refHttp, s.GetRow(0).GetCell(0).CellFormula);
+ ClassicAssert.AreEqual(refHttp, s.GetRow(0).GetCell(0).CellFormula);
// Now try to Set them to the same values, and ensure that
// they end up as they did before, even with a save and re-load
@@ -3230,22 +3230,22 @@ public void bug46670_existing()
s = wb.GetSheetAt(0);
c = s.GetRow(0).GetCell(0);
c.CellFormula = (/*setter*/refLocal);
- Assert.AreEqual(refLocal, c.CellFormula);
+ ClassicAssert.AreEqual(refLocal, c.CellFormula);
wb = HSSFTestDataSamples.WriteOutAndReadBack(wb);
s = wb.GetSheetAt(0);
- Assert.AreEqual(refLocal, s.GetRow(0).GetCell(0).CellFormula);
+ ClassicAssert.AreEqual(refLocal, s.GetRow(0).GetCell(0).CellFormula);
wb = OpenSample("46670_http.xls");
s = wb.GetSheetAt(0);
c = s.GetRow(0).GetCell(0);
c.CellFormula = (/*setter*/refHttp);
- Assert.AreEqual(refHttp, c.CellFormula);
+ ClassicAssert.AreEqual(refHttp, c.CellFormula);
wb = HSSFTestDataSamples.WriteOutAndReadBack(wb);
s = wb.GetSheetAt(0);
- Assert.AreEqual(refHttp, s.GetRow(0).GetCell(0).CellFormula);
+ ClassicAssert.AreEqual(refHttp, s.GetRow(0).GetCell(0).CellFormula);
}
[Test]
@@ -3266,7 +3266,7 @@ public void Test53109()
HSSFWorkbook wb = OpenSample("53109.xls");
IWorkbook wbBack = HSSFTestDataSamples.WriteOutAndReadBack(wb);
- Assert.IsNotNull(wbBack);
+ ClassicAssert.IsNotNull(wbBack);
wb.Close();
}
@@ -3277,7 +3277,7 @@ public void Test53109a()
HSSFWorkbook wb = OpenSample("com.aida-tour.www_SPO_files_maldives%20august%20october.xls");
IWorkbook wbBack = HSSFTestDataSamples.WriteOutAndReadBack(wb);
- Assert.IsNotNull(wbBack);
+ ClassicAssert.IsNotNull(wbBack);
wb.Close();
}
@@ -3311,7 +3311,7 @@ public void Test48043()
}*/
IWorkbook wbBack = HSSFTestDataSamples.WriteOutAndReadBack(wb);
- Assert.IsNotNull(wbBack);
+ ClassicAssert.IsNotNull(wbBack);
wbBack.Close();
wb.Close();
@@ -3369,7 +3369,7 @@ public void Test46515()
// Pop structure into Structure HSSFSheet
int pict = wb.AddPicture(imageBytes, PictureType.JPEG);
ISheet sheet = wb.GetSheet("Structure");
- Assert.IsNotNull(sheet, "Did not find sheet");
+ ClassicAssert.IsNotNull(sheet, "Did not find sheet");
HSSFPatriarch patriarch = (HSSFPatriarch)sheet.CreateDrawingPatriarch();
HSSFClientAnchor anchor = new HSSFClientAnchor(0, 0, 0, 0, (short)1, 1, (short)10, 22);
anchor.AnchorType = AnchorType.MoveDontResize; //(2);
@@ -3387,21 +3387,21 @@ public void Test55668()
ISheet sheet = wb.GetSheetAt(0);
IRow row = sheet.GetRow(0);
ICell cell = row.GetCell(0);
- Assert.AreEqual(CellType.Formula, cell.CellType);
- Assert.AreEqual("IF(TRUE,\"\",\"\")", cell.CellFormula);
- Assert.AreEqual("", cell.StringCellValue);
+ ClassicAssert.AreEqual(CellType.Formula, cell.CellType);
+ ClassicAssert.AreEqual("IF(TRUE,\"\",\"\")", cell.CellFormula);
+ ClassicAssert.AreEqual("", cell.StringCellValue);
cell.SetCellType(CellType.String);
- Assert.AreEqual(CellType.Blank, cell.CellType);
+ ClassicAssert.AreEqual(CellType.Blank, cell.CellType);
try
{
- Assert.IsNull(cell.CellFormula);
+ ClassicAssert.IsNull(cell.CellFormula);
Assert.Fail("Should throw an exception here");
}
catch
{
// expected here
}
- Assert.AreEqual("", cell.StringCellValue);
+ ClassicAssert.AreEqual("", cell.StringCellValue);
wb.Close();
}
@@ -3410,7 +3410,7 @@ public void Test55982()
{
IWorkbook wb = HSSFTestDataSamples.OpenSampleWorkbook("55982.xls");
ISheet newSheet = wb.CloneSheet(1);
- Assert.IsNotNull(newSheet);
+ ClassicAssert.IsNotNull(newSheet);
wb.Close();
}
@@ -3427,15 +3427,15 @@ public void Test51332()
shape = new HSSFTextbox(null, anchor);
shape.ShapeId = 1025;
cmo = (CommonObjectDataSubRecord)shape.GetObjRecord().SubRecords[0];
- Assert.AreEqual(1, cmo.ObjectId);
+ ClassicAssert.AreEqual(1, cmo.ObjectId);
shape = new HSSFPicture(null, anchor);
shape.ShapeId = 1026;
cmo = (CommonObjectDataSubRecord)shape.GetObjRecord().SubRecords[0];
- Assert.AreEqual(2, cmo.ObjectId);
+ ClassicAssert.AreEqual(2, cmo.ObjectId);
shape = new HSSFComment(null, anchor);
shape.ShapeId = 1027;
cmo = (CommonObjectDataSubRecord)shape.GetObjRecord().SubRecords[0];
- Assert.AreEqual(1027, cmo.ObjectId);
+ ClassicAssert.AreEqual(1027, cmo.ObjectId);
}
@@ -3453,19 +3453,19 @@ public void Test53564()
HSSFBorderFormatting bord = rule.CreateBorderFormatting() as HSSFBorderFormatting;
bord.BorderDiagonal = BorderStyle.Thick;
- Assert.AreEqual(BorderStyle.Thick, bord.BorderDiagonal);
+ ClassicAssert.AreEqual(BorderStyle.Thick, bord.BorderDiagonal);
bord.IsBackwardDiagonalOn = true;
- Assert.IsTrue(bord.IsBackwardDiagonalOn);
+ ClassicAssert.IsTrue(bord.IsBackwardDiagonalOn);
bord.IsForwardDiagonalOn = true;
- Assert.IsTrue(bord.IsForwardDiagonalOn);
+ ClassicAssert.IsTrue(bord.IsForwardDiagonalOn);
bord.DiagonalBorderColor = BLUE;
- Assert.AreEqual(BLUE, bord.DiagonalBorderColor);
+ ClassicAssert.AreEqual(BLUE, bord.DiagonalBorderColor);
// Create the bottom border style so we know what a border is supposed to look like
bord.BorderBottom = BorderStyle.Thick;
- Assert.AreEqual(BorderStyle.Thick, bord.BorderBottom);
+ ClassicAssert.AreEqual(BorderStyle.Thick, bord.BorderBottom);
bord.BottomBorderColor = BLUE;
- Assert.AreEqual(BLUE, bord.BottomBorderColor);
+ ClassicAssert.AreEqual(BLUE, bord.BottomBorderColor);
CellRangeAddress[] A2_D4 = { new CellRangeAddress(1, 3, 0, 3) };
scf.AddConditionalFormatting(A2_D4, rule);
@@ -3509,7 +3509,7 @@ public void Test52447()
}
catch
{
- Assert.IsNotNull(wb);
+ ClassicAssert.IsNotNull(wb);
}
}
@@ -3523,7 +3523,7 @@ public void TestAmazonDownloadFile()
}
catch
{
- Assert.IsNotNull(wb);
+ ClassicAssert.IsNotNull(wb);
}
}
}
diff --git a/testcases/main/HSSF/UserModel/TestCellStyle.cs b/testcases/main/HSSF/UserModel/TestCellStyle.cs
index 5eb9ecb26..8f025947d 100644
--- a/testcases/main/HSSF/UserModel/TestCellStyle.cs
+++ b/testcases/main/HSSF/UserModel/TestCellStyle.cs
@@ -30,7 +30,7 @@ namespace TestCases.HSSF.UserModel
using NPOI.HSSF.UserModel;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using TestCases.HSSF;
using NPOI.SS.UserModel;
using NPOI.HSSF.Util;
@@ -103,8 +103,8 @@ public void TestWriteSheetFont()
out1.Close();
SanityChecker sanityChecker = new SanityChecker();
sanityChecker.CheckHSSFWorkbook(wb);
- Assert.AreEqual(99, s.LastRowNum, "LAST ROW == 99");
- Assert.AreEqual(0, s.FirstRowNum, "FIRST ROW == 0");
+ ClassicAssert.AreEqual(99, s.LastRowNum, "LAST ROW == 99");
+ ClassicAssert.AreEqual(0, s.FirstRowNum, "FIRST ROW == 0");
// assert((s.LastRowNum == 99));
}
@@ -141,8 +141,8 @@ public void TestDataStyle()
SanityChecker sanityChecker = new SanityChecker();
sanityChecker.CheckHSSFWorkbook(wb);
- Assert.AreEqual(0, s.LastRowNum, "LAST ROW ");
- Assert.AreEqual(0, s.FirstRowNum, "FIRST ROW ");
+ ClassicAssert.AreEqual(0, s.LastRowNum, "LAST ROW ");
+ ClassicAssert.AreEqual(0, s.FirstRowNum, "FIRST ROW ");
}
[Test]
@@ -165,15 +165,15 @@ public void TestHashEquals()
cell2.CellStyle = (cs2);
cell2.SetCellValue(DateTime.Now);
- Assert.AreEqual(cs1.GetHashCode(), cs1.GetHashCode());
- Assert.AreEqual(cs2.GetHashCode(), cs2.GetHashCode());
- Assert.IsTrue(cs1.Equals(cs1));
- Assert.IsTrue(cs2.Equals(cs2));
+ ClassicAssert.AreEqual(cs1.GetHashCode(), cs1.GetHashCode());
+ ClassicAssert.AreEqual(cs2.GetHashCode(), cs2.GetHashCode());
+ ClassicAssert.IsTrue(cs1.Equals(cs1));
+ ClassicAssert.IsTrue(cs2.Equals(cs2));
// Change cs1, hash will alter
int hash1 = cs1.GetHashCode();
cs1.DataFormat = (HSSFDataFormat.GetBuiltinFormat("m/dd/yy"));
- Assert.IsFalse(hash1 == cs1.GetHashCode());
+ ClassicAssert.IsFalse(hash1 == cs1.GetHashCode());
wb.Close();
}
@@ -234,8 +234,8 @@ public void TestWriteSheetStyle()
out1.Close();
SanityChecker sanityChecker = new SanityChecker();
sanityChecker.CheckHSSFWorkbook(wb);
- Assert.AreEqual(99, s.LastRowNum, "LAST ROW == 99");
- Assert.AreEqual(0, s.FirstRowNum, "FIRST ROW == 0");
+ ClassicAssert.AreEqual(99, s.LastRowNum, "LAST ROW == 99");
+ ClassicAssert.AreEqual(0, s.FirstRowNum, "FIRST ROW == 0");
// assert((s.LastRowNum == 99));
}
@@ -250,30 +250,30 @@ public void TestCloneStyleSameWB()
HSSFWorkbook wb = new HSSFWorkbook();
IFont fnt = wb.CreateFont();
fnt.FontName = ("TestingFont");
- Assert.AreEqual(5, wb.NumberOfFonts);
+ ClassicAssert.AreEqual(5, wb.NumberOfFonts);
NPOI.SS.UserModel.ICellStyle orig = wb.CreateCellStyle();
orig.Alignment = (HorizontalAlignment.Right);
orig.SetFont(fnt);
orig.DataFormat = ((short)18);
- Assert.AreEqual(HorizontalAlignment.Right, orig.Alignment);
- Assert.AreEqual(fnt, orig.GetFont(wb));
- Assert.AreEqual(18, orig.DataFormat);
+ ClassicAssert.AreEqual(HorizontalAlignment.Right, orig.Alignment);
+ ClassicAssert.AreEqual(fnt, orig.GetFont(wb));
+ ClassicAssert.AreEqual(18, orig.DataFormat);
NPOI.SS.UserModel.ICellStyle clone = wb.CreateCellStyle();
- Assert.AreNotEqual(HorizontalAlignment.Right, clone.Alignment);
- Assert.AreNotEqual(fnt, clone.GetFont(wb));
- Assert.AreNotEqual(18, clone.DataFormat);
+ ClassicAssert.AreNotEqual(HorizontalAlignment.Right, clone.Alignment);
+ ClassicAssert.AreNotEqual(fnt, clone.GetFont(wb));
+ ClassicAssert.AreNotEqual(18, clone.DataFormat);
clone.CloneStyleFrom(orig);
- Assert.AreEqual(HorizontalAlignment.Right, orig.Alignment);
- Assert.AreEqual(fnt, clone.GetFont(wb));
- Assert.AreEqual(18, clone.DataFormat);
- Assert.AreEqual(5, wb.NumberOfFonts);
+ ClassicAssert.AreEqual(HorizontalAlignment.Right, orig.Alignment);
+ ClassicAssert.AreEqual(fnt, clone.GetFont(wb));
+ ClassicAssert.AreEqual(18, clone.DataFormat);
+ ClassicAssert.AreEqual(5, wb.NumberOfFonts);
orig.Alignment = HorizontalAlignment.Left;
- Assert.AreEqual(HorizontalAlignment.Right, clone.Alignment);
+ ClassicAssert.AreEqual(HorizontalAlignment.Right, clone.Alignment);
}
/**
@@ -287,7 +287,7 @@ public void TestCloneStyleDiffWB()
IFont fnt = wbOrig.CreateFont();
fnt.FontName = ("TestingFont");
- Assert.AreEqual(5, wbOrig.NumberOfFonts);
+ ClassicAssert.AreEqual(5, wbOrig.NumberOfFonts);
IDataFormat fmt = wbOrig.CreateDataFormat();
fmt.GetFormat("MadeUpOne");
@@ -298,27 +298,27 @@ public void TestCloneStyleDiffWB()
orig.SetFont(fnt);
orig.DataFormat = (fmt.GetFormat("Test##"));
- Assert.AreEqual(HorizontalAlignment.Right, orig.Alignment);
- Assert.AreEqual(fnt, orig.GetFont(wbOrig));
- Assert.AreEqual(fmt.GetFormat("Test##"), orig.DataFormat);
+ ClassicAssert.AreEqual(HorizontalAlignment.Right, orig.Alignment);
+ ClassicAssert.AreEqual(fnt, orig.GetFont(wbOrig));
+ ClassicAssert.AreEqual(fmt.GetFormat("Test##"), orig.DataFormat);
// Now a style on another workbook
HSSFWorkbook wbClone = new HSSFWorkbook();
- Assert.AreEqual(4, wbClone.NumberOfFonts);
+ ClassicAssert.AreEqual(4, wbClone.NumberOfFonts);
IDataFormat fmtClone = wbClone.CreateDataFormat();
NPOI.SS.UserModel.ICellStyle clone = wbClone.CreateCellStyle();
- Assert.AreEqual(4, wbClone.NumberOfFonts);
+ ClassicAssert.AreEqual(4, wbClone.NumberOfFonts);
- Assert.AreNotEqual(HorizontalAlignment.Right, clone.Alignment);
- Assert.AreNotEqual("TestingFont", clone.GetFont(wbClone).FontName);
+ ClassicAssert.AreNotEqual(HorizontalAlignment.Right, clone.Alignment);
+ ClassicAssert.AreNotEqual("TestingFont", clone.GetFont(wbClone).FontName);
clone.CloneStyleFrom(orig);
- Assert.AreEqual(HorizontalAlignment.Right, clone.Alignment);
- Assert.AreEqual("TestingFont", clone.GetFont(wbClone).FontName);
- Assert.AreEqual(fmtClone.GetFormat("Test##"), clone.DataFormat);
- Assert.AreNotEqual(fmtClone.GetFormat("Test##"), fmt.GetFormat("Test##"));
- Assert.AreEqual(5, wbClone.NumberOfFonts);
+ ClassicAssert.AreEqual(HorizontalAlignment.Right, clone.Alignment);
+ ClassicAssert.AreEqual("TestingFont", clone.GetFont(wbClone).FontName);
+ ClassicAssert.AreEqual(fmtClone.GetFormat("Test##"), clone.DataFormat);
+ ClassicAssert.AreNotEqual(fmtClone.GetFormat("Test##"), fmt.GetFormat("Test##"));
+ ClassicAssert.AreEqual(5, wbClone.NumberOfFonts);
}
[Test]
public void TestStyleNames()
@@ -333,46 +333,46 @@ public void TestStyleNames()
HSSFCellStyle cs2 = (HSSFCellStyle)c2.CellStyle;
HSSFCellStyle cs3 = (HSSFCellStyle)c3.CellStyle;
- Assert.IsNotNull(cs1);
- Assert.IsNotNull(cs2);
- Assert.IsNotNull(cs3);
+ ClassicAssert.IsNotNull(cs1);
+ ClassicAssert.IsNotNull(cs2);
+ ClassicAssert.IsNotNull(cs3);
// Check we got the styles we'd expect
- Assert.AreEqual(10, cs1.GetFont(wb).FontHeightInPoints);
- Assert.AreEqual(9, cs2.GetFont(wb).FontHeightInPoints);
- Assert.AreEqual(12, cs3.GetFont(wb).FontHeightInPoints);
+ ClassicAssert.AreEqual(10, cs1.GetFont(wb).FontHeightInPoints);
+ ClassicAssert.AreEqual(9, cs2.GetFont(wb).FontHeightInPoints);
+ ClassicAssert.AreEqual(12, cs3.GetFont(wb).FontHeightInPoints);
- Assert.AreEqual(15, cs1.Index);
- Assert.AreEqual(23, cs2.Index);
- Assert.AreEqual(24, cs3.Index);
+ ClassicAssert.AreEqual(15, cs1.Index);
+ ClassicAssert.AreEqual(23, cs2.Index);
+ ClassicAssert.AreEqual(24, cs3.Index);
- Assert.IsNull(cs1.ParentStyle);
- Assert.IsNotNull(cs2.ParentStyle);
- Assert.IsNotNull(cs3.ParentStyle);
+ ClassicAssert.IsNull(cs1.ParentStyle);
+ ClassicAssert.IsNotNull(cs2.ParentStyle);
+ ClassicAssert.IsNotNull(cs3.ParentStyle);
- Assert.AreEqual(21, cs2.ParentStyle.Index);
- Assert.AreEqual(22, cs3.ParentStyle.Index);
+ ClassicAssert.AreEqual(21, cs2.ParentStyle.Index);
+ ClassicAssert.AreEqual(22, cs3.ParentStyle.Index);
// Now Check we can get style records for
// the parent ones
- Assert.IsNull(wb.Workbook.GetStyleRecord(15));
- Assert.IsNull(wb.Workbook.GetStyleRecord(23));
- Assert.IsNull(wb.Workbook.GetStyleRecord(24));
+ ClassicAssert.IsNull(wb.Workbook.GetStyleRecord(15));
+ ClassicAssert.IsNull(wb.Workbook.GetStyleRecord(23));
+ ClassicAssert.IsNull(wb.Workbook.GetStyleRecord(24));
- Assert.IsNotNull(wb.Workbook.GetStyleRecord(21));
- Assert.IsNotNull(wb.Workbook.GetStyleRecord(22));
+ ClassicAssert.IsNotNull(wb.Workbook.GetStyleRecord(21));
+ ClassicAssert.IsNotNull(wb.Workbook.GetStyleRecord(22));
// Now Check the style names
- Assert.AreEqual(null, cs1.UserStyleName);
- Assert.AreEqual(null, cs2.UserStyleName);
- Assert.AreEqual(null, cs3.UserStyleName);
- Assert.AreEqual("style1", cs2.ParentStyle.UserStyleName);
- Assert.AreEqual("style2", cs3.ParentStyle.UserStyleName);
+ ClassicAssert.AreEqual(null, cs1.UserStyleName);
+ ClassicAssert.AreEqual(null, cs2.UserStyleName);
+ ClassicAssert.AreEqual(null, cs3.UserStyleName);
+ ClassicAssert.AreEqual("style1", cs2.ParentStyle.UserStyleName);
+ ClassicAssert.AreEqual("style2", cs3.ParentStyle.UserStyleName);
// now apply a named style to a new cell
ICell c4 = s.GetRow(0).CreateCell(1);
c4.CellStyle = (cs2);
- Assert.AreEqual("style1", ((HSSFCellStyle)c4.CellStyle).ParentStyle.UserStyleName);
+ ClassicAssert.AreEqual("style1", ((HSSFCellStyle)c4.CellStyle).ParentStyle.UserStyleName);
}
[Test]
@@ -383,40 +383,40 @@ public void TestGetSetBorderHair()
ICellStyle cs;
cs = s.GetRow(0).GetCell(0).CellStyle;
- Assert.AreEqual(BorderStyle.Hair, cs.BorderRight);
+ ClassicAssert.AreEqual(BorderStyle.Hair, cs.BorderRight);
cs = s.GetRow(1).GetCell(1).CellStyle;
- Assert.AreEqual(BorderStyle.Dotted, cs.BorderRight);
+ ClassicAssert.AreEqual(BorderStyle.Dotted, cs.BorderRight);
cs = s.GetRow(2).GetCell(2).CellStyle;
- Assert.AreEqual(BorderStyle.DashDotDot, cs.BorderRight);
+ ClassicAssert.AreEqual(BorderStyle.DashDotDot, cs.BorderRight);
cs = s.GetRow(3).GetCell(3).CellStyle;
- Assert.AreEqual(BorderStyle.Dashed, cs.BorderRight);
+ ClassicAssert.AreEqual(BorderStyle.Dashed, cs.BorderRight);
cs = s.GetRow(4).GetCell(4).CellStyle;
- Assert.AreEqual(BorderStyle.Thin, cs.BorderRight);
+ ClassicAssert.AreEqual(BorderStyle.Thin, cs.BorderRight);
cs = s.GetRow(5).GetCell(5).CellStyle;
- Assert.AreEqual(BorderStyle.MediumDashDotDot, cs.BorderRight);
+ ClassicAssert.AreEqual(BorderStyle.MediumDashDotDot, cs.BorderRight);
cs = s.GetRow(6).GetCell(6).CellStyle;
- Assert.AreEqual(BorderStyle.SlantedDashDot, cs.BorderRight);
+ ClassicAssert.AreEqual(BorderStyle.SlantedDashDot, cs.BorderRight);
cs = s.GetRow(7).GetCell(7).CellStyle;
- Assert.AreEqual(BorderStyle.MediumDashDot, cs.BorderRight);
+ ClassicAssert.AreEqual(BorderStyle.MediumDashDot, cs.BorderRight);
cs = s.GetRow(8).GetCell(8).CellStyle;
- Assert.AreEqual(BorderStyle.MediumDashed, cs.BorderRight);
+ ClassicAssert.AreEqual(BorderStyle.MediumDashed, cs.BorderRight);
cs = s.GetRow(9).GetCell(9).CellStyle;
- Assert.AreEqual(BorderStyle.Medium, cs.BorderRight);
+ ClassicAssert.AreEqual(BorderStyle.Medium, cs.BorderRight);
cs = s.GetRow(10).GetCell(10).CellStyle;
- Assert.AreEqual(BorderStyle.Thick, cs.BorderRight);
+ ClassicAssert.AreEqual(BorderStyle.Thick, cs.BorderRight);
cs = s.GetRow(11).GetCell(11).CellStyle;
- Assert.AreEqual(BorderStyle.Double, cs.BorderRight);
+ ClassicAssert.AreEqual(BorderStyle.Double, cs.BorderRight);
}
[Test]
@@ -428,7 +428,7 @@ public void TestShrinkToFit()
IRow r = s.GetRow(0);
ICellStyle cs = r.GetCell(0).CellStyle;
- Assert.AreEqual(true, cs.ShrinkToFit);
+ ClassicAssert.AreEqual(true, cs.ShrinkToFit);
// New file
IWorkbook wbOrig = new HSSFWorkbook();
@@ -447,8 +447,8 @@ public void TestShrinkToFit()
wb = HSSFTestDataSamples.WriteOutAndReadBack(wbOrig as HSSFWorkbook);
s = wb.GetSheetAt(0);
r = s.GetRow(0);
- Assert.AreEqual(false, r.GetCell(0).CellStyle.ShrinkToFit);
- Assert.AreEqual(true, r.GetCell(1).CellStyle.ShrinkToFit);
+ ClassicAssert.AreEqual(false, r.GetCell(0).CellStyle.ShrinkToFit);
+ ClassicAssert.AreEqual(true, r.GetCell(1).CellStyle.ShrinkToFit);
}
[Test]
@@ -480,8 +480,8 @@ public void Test56959()
newCell.CellStyle = (style);
newCell.SetCellValue("2testtext2");
ICellStyle newStyle = newCell.CellStyle;
- Assert.AreEqual(BorderStyle.Dotted, newStyle.BorderBottom);
- Assert.AreEqual(HSSFColor.Red.Index, ((HSSFCellStyle)newStyle).GetFont(wb).Color);
+ ClassicAssert.AreEqual(BorderStyle.Dotted, newStyle.BorderBottom);
+ ClassicAssert.AreEqual(HSSFColor.Red.Index, ((HSSFCellStyle)newStyle).GetFont(wb).Color);
// OutputStream out = new FileOutputStream("/tmp/56959.xls");
// try {
@@ -496,30 +496,30 @@ public void Test58043()
{
HSSFWorkbook wb = new HSSFWorkbook();
HSSFCellStyle cellStyle = wb.CreateCellStyle() as HSSFCellStyle;
- Assert.AreEqual(0, cellStyle.Rotation);
+ ClassicAssert.AreEqual(0, cellStyle.Rotation);
cellStyle.Rotation = ((short)89);
- Assert.AreEqual(89, cellStyle.Rotation);
+ ClassicAssert.AreEqual(89, cellStyle.Rotation);
cellStyle.Rotation = ((short)90);
- Assert.AreEqual(90, cellStyle.Rotation);
+ ClassicAssert.AreEqual(90, cellStyle.Rotation);
cellStyle.Rotation = ((short)-1);
- Assert.AreEqual(-1, cellStyle.Rotation);
+ ClassicAssert.AreEqual(-1, cellStyle.Rotation);
cellStyle.Rotation = ((short)-89);
- Assert.AreEqual(-89, cellStyle.Rotation);
+ ClassicAssert.AreEqual(-89, cellStyle.Rotation);
cellStyle.Rotation = ((short)-90);
- Assert.AreEqual(-90, cellStyle.Rotation);
+ ClassicAssert.AreEqual(-90, cellStyle.Rotation);
cellStyle.Rotation = ((short)-89);
- Assert.AreEqual(-89, cellStyle.Rotation);
+ ClassicAssert.AreEqual(-89, cellStyle.Rotation);
// values above 90 are mapped to the correct values for compatibility between HSSF and XSSF
cellStyle.Rotation = ((short)179);
- Assert.AreEqual(-89, cellStyle.Rotation);
+ ClassicAssert.AreEqual(-89, cellStyle.Rotation);
cellStyle.Rotation = ((short)180);
- Assert.AreEqual(-90, cellStyle.Rotation);
+ ClassicAssert.AreEqual(-90, cellStyle.Rotation);
wb.Close();
}
diff --git a/testcases/main/HSSF/UserModel/TestCloneSheet.cs b/testcases/main/HSSF/UserModel/TestCloneSheet.cs
index 97f282af9..7ea18d012 100644
--- a/testcases/main/HSSF/UserModel/TestCloneSheet.cs
+++ b/testcases/main/HSSF/UserModel/TestCloneSheet.cs
@@ -23,7 +23,7 @@ namespace TestCases.HSSF.UserModel
using NPOI.HSSF.Record;
using NPOI.HSSF.UserModel;
using NPOI.Util;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using TestCases.SS.UserModel;
/**
@@ -48,9 +48,9 @@ public void TestCloneSheetWithoutDrawings()
HSSFSheet s = b.CreateSheet("Test") as HSSFSheet;
HSSFSheet s2 = s.CloneSheet(b) as HSSFSheet;
- Assert.IsNull(s.DrawingPatriarch);
- Assert.IsNull(s2.DrawingPatriarch);
- Assert.AreEqual(HSSFTestHelper.GetSheetForTest(s).Records.Count, HSSFTestHelper.GetSheetForTest(s2).Records.Count);
+ ClassicAssert.IsNull(s.DrawingPatriarch);
+ ClassicAssert.IsNull(s2.DrawingPatriarch);
+ ClassicAssert.AreEqual(HSSFTestHelper.GetSheetForTest(s).Records.Count, HSSFTestHelper.GetSheetForTest(s2).Records.Count);
}
[Test]
@@ -71,13 +71,13 @@ public void TestCloneSheetWithEmptyDrawingAggregate()
EscherSpRecord sp1 = (EscherSpRecord)agg1.GetEscherContainer().GetChild(1).GetChild(0).GetChild(1);
EscherSpRecord sp2 = (EscherSpRecord)agg2.GetEscherContainer().GetChild(1).GetChild(0).GetChild(1);
- Assert.AreEqual(sp1.ShapeId, 1024);
- Assert.AreEqual(sp2.ShapeId, 2048);
+ ClassicAssert.AreEqual(sp1.ShapeId, 1024);
+ ClassicAssert.AreEqual(sp2.ShapeId, 2048);
EscherDgRecord dg = (EscherDgRecord)agg2.GetEscherContainer().GetChild(0);
- Assert.AreEqual(dg.LastMSOSPID, 2048);
- Assert.AreEqual(dg.Instance, 0x2);
+ ClassicAssert.AreEqual(dg.LastMSOSPID, 2048);
+ ClassicAssert.AreEqual(dg.Instance, 0x2);
//everything except id and DgRecord.lastMSOSPID and DgRecord.Instance must be the same
@@ -85,9 +85,9 @@ public void TestCloneSheetWithEmptyDrawingAggregate()
dg.LastMSOSPID = (1024);
dg.Instance =((short)0x1);
- Assert.AreEqual(agg1.Serialize().Length, agg2.Serialize().Length);
- Assert.AreEqual(agg1.ToXml(""), agg2.ToXml(""));
- Assert.IsTrue(Arrays.Equals(agg1.Serialize(), agg2.Serialize()));
+ ClassicAssert.AreEqual(agg1.Serialize().Length, agg2.Serialize().Length);
+ ClassicAssert.AreEqual(agg1.ToXml(""), agg2.ToXml(""));
+ ClassicAssert.IsTrue(Arrays.Equals(agg1.Serialize(), agg2.Serialize()));
}
[Test]
public void TestCloneComment()
@@ -104,32 +104,32 @@ public void TestCloneComment()
HSSFPatriarch p2 = sh2.DrawingPatriarch as HSSFPatriarch;
HSSFComment c2 = (HSSFComment)p2.Children[0];
- Assert.AreEqual(c.String, c2.String);
- Assert.AreEqual(c.Row, c2.Row);
- Assert.AreEqual(c.Column, c2.Column);
+ ClassicAssert.AreEqual(c.String, c2.String);
+ ClassicAssert.AreEqual(c.Row, c2.Row);
+ ClassicAssert.AreEqual(c.Column, c2.Column);
// The ShapeId is not equal?
// assertEquals(c.getNoteRecord().getShapeId(), c2.getNoteRecord().getShapeId());
- Assert.IsTrue(Arrays.Equals(c2.GetTextObjectRecord().Serialize(), c.GetTextObjectRecord().Serialize()));
+ ClassicAssert.IsTrue(Arrays.Equals(c2.GetTextObjectRecord().Serialize(), c.GetTextObjectRecord().Serialize()));
// ShapeId is different
CommonObjectDataSubRecord subRecord = (CommonObjectDataSubRecord)c2.GetObjRecord().SubRecords[0];
subRecord.ObjectId = (1025);
- Assert.IsTrue(Arrays.Equals(c2.GetObjRecord().Serialize(), c.GetObjRecord().Serialize()));
+ ClassicAssert.IsTrue(Arrays.Equals(c2.GetObjRecord().Serialize(), c.GetObjRecord().Serialize()));
// ShapeId is different
c2.NoteRecord.ShapeId = (1025);
- Assert.IsTrue(Arrays.Equals(c2.NoteRecord.Serialize(), c.NoteRecord.Serialize()));
+ ClassicAssert.IsTrue(Arrays.Equals(c2.NoteRecord.Serialize(), c.NoteRecord.Serialize()));
//everything except spRecord.shapeId must be the same
- Assert.IsFalse(Arrays.Equals(c2.GetEscherContainer().Serialize(), c.GetEscherContainer().Serialize()));
+ ClassicAssert.IsFalse(Arrays.Equals(c2.GetEscherContainer().Serialize(), c.GetEscherContainer().Serialize()));
EscherSpRecord sp = (EscherSpRecord)c2.GetEscherContainer().GetChild(0);
sp.ShapeId=(1025);
- Assert.IsTrue(Arrays.Equals(c2.GetEscherContainer().Serialize(), c.GetEscherContainer().Serialize()));
+ ClassicAssert.IsTrue(Arrays.Equals(c2.GetEscherContainer().Serialize(), c.GetEscherContainer().Serialize()));
wb.Close();
}
diff --git a/testcases/main/HSSF/UserModel/TestDataValidation.cs b/testcases/main/HSSF/UserModel/TestDataValidation.cs
index c68078553..eefeba382 100644
--- a/testcases/main/HSSF/UserModel/TestDataValidation.cs
+++ b/testcases/main/HSSF/UserModel/TestDataValidation.cs
@@ -25,7 +25,7 @@ namespace TestCases.HSSF.UserModel
using NPOI.SS.UserModel;
using NPOI.SS.Util;
using NPOI.Util;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using TestCases.HSSF;
using TestCases.SS.UserModel;
@@ -177,7 +177,7 @@ public void TestAddToExistingSheet()
byte[] dvHeaderRecStart = { (byte)0xB2, 0x01, 0x12, 0x00, };
int dvHeaderOffset = FindIndex(wbData, dvHeaderRecStart);
- Assert.IsTrue(dvHeaderOffset > 0);
+ ClassicAssert.IsTrue(dvHeaderOffset > 0);
int nextRecIndex = dvHeaderOffset + 22;
int nextSid
= ((wbData[nextRecIndex + 0] << 0) & 0x00FF)
@@ -190,7 +190,7 @@ int nextSid
{
throw new AssertionException("Identified bug 45519");
}
- Assert.AreEqual(DVRecord.sid, nextSid);
+ ClassicAssert.AreEqual(DVRecord.sid, nextSid);
}
private int FindIndex(byte[] largeData, byte[] searchPattern)
{
@@ -224,7 +224,7 @@ public void TestGetDataValidationsAny()
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.CreateSheet() as HSSFSheet;
List list = sheet.GetDataValidations();
- Assert.AreEqual(0, list.Count);
+ ClassicAssert.AreEqual(0, list.Count);
IDataValidationHelper dataValidationHelper = sheet.GetDataValidationHelper();
IDataValidationConstraint constraint = dataValidationHelper.CreateNumericConstraint(ValidationType.ANY,
@@ -237,31 +237,31 @@ public void TestGetDataValidationsAny()
sheet.AddValidationData(validation);
list = sheet.GetDataValidations(); // <-- works
- Assert.AreEqual(1, list.Count);
+ ClassicAssert.AreEqual(1, list.Count);
HSSFDataValidation dv = list[(0)] as HSSFDataValidation;
{
CellRangeAddressList regions = dv.Regions;
- Assert.AreEqual(1, regions.CountRanges());
+ ClassicAssert.AreEqual(1, regions.CountRanges());
CellRangeAddress Address = regions.GetCellRangeAddress(0);
- Assert.AreEqual(1, Address.FirstRow);
- Assert.AreEqual(2, Address.LastRow);
- Assert.AreEqual(3, Address.FirstColumn);
- Assert.AreEqual(4, Address.LastColumn);
+ ClassicAssert.AreEqual(1, Address.FirstRow);
+ ClassicAssert.AreEqual(2, Address.LastRow);
+ ClassicAssert.AreEqual(3, Address.FirstColumn);
+ ClassicAssert.AreEqual(4, Address.LastColumn);
}
- Assert.AreEqual(true, dv.EmptyCellAllowed);
- Assert.AreEqual(false, dv.SuppressDropDownArrow);
- Assert.AreEqual(true, dv.ShowErrorBox);
- Assert.AreEqual("error-title", dv.ErrorBoxTitle);
- Assert.AreEqual("error-text", dv.ErrorBoxText);
- Assert.AreEqual(true, dv.ShowPromptBox);
- Assert.AreEqual("prompt-title", dv.PromptBoxTitle);
- Assert.AreEqual("prompt-text", dv.PromptBoxText);
+ ClassicAssert.AreEqual(true, dv.EmptyCellAllowed);
+ ClassicAssert.AreEqual(false, dv.SuppressDropDownArrow);
+ ClassicAssert.AreEqual(true, dv.ShowErrorBox);
+ ClassicAssert.AreEqual("error-title", dv.ErrorBoxTitle);
+ ClassicAssert.AreEqual("error-text", dv.ErrorBoxText);
+ ClassicAssert.AreEqual(true, dv.ShowPromptBox);
+ ClassicAssert.AreEqual("prompt-title", dv.PromptBoxTitle);
+ ClassicAssert.AreEqual("prompt-text", dv.PromptBoxText);
IDataValidationConstraint c = dv.ValidationConstraint;
- Assert.AreEqual(ValidationType.ANY, c.GetValidationType());
- Assert.AreEqual(OperatorType.IGNORED, c.Operator);
+ ClassicAssert.AreEqual(ValidationType.ANY, c.GetValidationType());
+ ClassicAssert.AreEqual(OperatorType.IGNORED, c.Operator);
}
[Test]
@@ -270,7 +270,7 @@ public void TestGetDataValidationsintFormula()
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.CreateSheet() as HSSFSheet;
List list = sheet.GetDataValidations();
- Assert.AreEqual(0, list.Count);
+ ClassicAssert.AreEqual(0, list.Count);
IDataValidationHelper dataValidationHelper = sheet.GetDataValidationHelper();
IDataValidationConstraint constraint = dataValidationHelper.CreateintConstraint(OperatorType.BETWEEN, "=A2",
@@ -280,16 +280,16 @@ public void TestGetDataValidationsintFormula()
sheet.AddValidationData(validation);
list = sheet.GetDataValidations(); // <-- works
- Assert.AreEqual(1, list.Count);
+ ClassicAssert.AreEqual(1, list.Count);
HSSFDataValidation dv = list[(0)] as HSSFDataValidation;
DVConstraint c = dv.Constraint;
- Assert.AreEqual(ValidationType.INTEGER, c.GetValidationType());
- Assert.AreEqual(OperatorType.BETWEEN, c.Operator);
- Assert.AreEqual("A2", c.Formula1);
- Assert.AreEqual("A3", c.Formula2);
- Assert.AreEqual(double.NaN, c.Value1);
- Assert.AreEqual(double.NaN, c.Value2);
+ ClassicAssert.AreEqual(ValidationType.INTEGER, c.GetValidationType());
+ ClassicAssert.AreEqual(OperatorType.BETWEEN, c.Operator);
+ ClassicAssert.AreEqual("A2", c.Formula1);
+ ClassicAssert.AreEqual("A3", c.Formula2);
+ ClassicAssert.AreEqual(double.NaN, c.Value1);
+ ClassicAssert.AreEqual(double.NaN, c.Value2);
}
[Test]
@@ -297,7 +297,7 @@ public void TestGetDataValidationsintValue(){
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.CreateSheet() as HSSFSheet;
List list = sheet.GetDataValidations();
- Assert.AreEqual(0, list.Count);
+ ClassicAssert.AreEqual(0, list.Count);
IDataValidationHelper dataValidationHelper = sheet.GetDataValidationHelper();
IDataValidationConstraint constraint = dataValidationHelper.CreateintConstraint(OperatorType.BETWEEN, "100",
@@ -307,16 +307,16 @@ public void TestGetDataValidationsintValue(){
sheet.AddValidationData(validation);
list = sheet.GetDataValidations(); // <-- works
- Assert.AreEqual(1, list.Count);
+ ClassicAssert.AreEqual(1, list.Count);
HSSFDataValidation dv = list[(0)] as HSSFDataValidation;
DVConstraint c = dv.Constraint;
- Assert.AreEqual(ValidationType.INTEGER, c.GetValidationType());
- Assert.AreEqual(OperatorType.BETWEEN, c.Operator);
- Assert.AreEqual(null, c.Formula1);
- Assert.AreEqual(null, c.Formula2);
- Assert.AreEqual(100, c.Value1);
- Assert.AreEqual(200, c.Value2);
+ ClassicAssert.AreEqual(ValidationType.INTEGER, c.GetValidationType());
+ ClassicAssert.AreEqual(OperatorType.BETWEEN, c.Operator);
+ ClassicAssert.AreEqual(null, c.Formula1);
+ ClassicAssert.AreEqual(null, c.Formula2);
+ ClassicAssert.AreEqual(100, c.Value1);
+ ClassicAssert.AreEqual(200, c.Value2);
}
[Test]
@@ -324,7 +324,7 @@ public void TestGetDataValidationsDecimal(){
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.CreateSheet() as HSSFSheet;
List list = sheet.GetDataValidations();
- Assert.AreEqual(0, list.Count);
+ ClassicAssert.AreEqual(0, list.Count);
IDataValidationHelper dataValidationHelper = sheet.GetDataValidationHelper();
IDataValidationConstraint constraint = dataValidationHelper.CreateDecimalConstraint(OperatorType.BETWEEN, "=A2",
@@ -334,16 +334,16 @@ public void TestGetDataValidationsDecimal(){
sheet.AddValidationData(validation);
list = sheet.GetDataValidations(); // <-- works
- Assert.AreEqual(1, list.Count);
+ ClassicAssert.AreEqual(1, list.Count);
HSSFDataValidation dv = list[(0)] as HSSFDataValidation;
DVConstraint c = dv.Constraint;
- Assert.AreEqual(ValidationType.DECIMAL, c.GetValidationType());
- Assert.AreEqual(OperatorType.BETWEEN, c.Operator);
- Assert.AreEqual("A2", c.Formula1);
- Assert.AreEqual(null, c.Formula2);
- Assert.AreEqual(double.NaN, c.Value1);
- Assert.AreEqual(200, c.Value2);
+ ClassicAssert.AreEqual(ValidationType.DECIMAL, c.GetValidationType());
+ ClassicAssert.AreEqual(OperatorType.BETWEEN, c.Operator);
+ ClassicAssert.AreEqual("A2", c.Formula1);
+ ClassicAssert.AreEqual(null, c.Formula2);
+ ClassicAssert.AreEqual(double.NaN, c.Value1);
+ ClassicAssert.AreEqual(200, c.Value2);
}
[Test]
@@ -352,7 +352,7 @@ public void TestGetDataValidationsDate()
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.CreateSheet() as HSSFSheet;
List list = sheet.GetDataValidations();
- Assert.AreEqual(0, list.Count);
+ ClassicAssert.AreEqual(0, list.Count);
IDataValidationHelper dataValidationHelper = sheet.GetDataValidationHelper();
IDataValidationConstraint constraint = dataValidationHelper.CreateDateConstraint(OperatorType.EQUAL,
@@ -362,16 +362,16 @@ public void TestGetDataValidationsDate()
sheet.AddValidationData(validation);
list = sheet.GetDataValidations(); // <-- works
- Assert.AreEqual(1, list.Count);
+ ClassicAssert.AreEqual(1, list.Count);
HSSFDataValidation dv = list[(0)] as HSSFDataValidation;
DVConstraint c = dv.Constraint;
- Assert.AreEqual(ValidationType.DATE, c.GetValidationType());
- Assert.AreEqual(OperatorType.EQUAL, c.Operator);
- Assert.AreEqual(null, c.Formula1);
- Assert.AreEqual(null, c.Formula2);
- Assert.AreEqual(DateUtil.GetExcelDate(DateUtil.ParseYYYYMMDDDate("2014/10/25")), c.Value1);
- Assert.AreEqual(double.NaN, c.Value2);
+ ClassicAssert.AreEqual(ValidationType.DATE, c.GetValidationType());
+ ClassicAssert.AreEqual(OperatorType.EQUAL, c.Operator);
+ ClassicAssert.AreEqual(null, c.Formula1);
+ ClassicAssert.AreEqual(null, c.Formula2);
+ ClassicAssert.AreEqual(DateUtil.GetExcelDate(DateUtil.ParseYYYYMMDDDate("2014/10/25")), c.Value1);
+ ClassicAssert.AreEqual(double.NaN, c.Value2);
}
[Test]
@@ -380,7 +380,7 @@ public void TestGetDataValidationsListExplicit()
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.CreateSheet() as HSSFSheet;
List list = sheet.GetDataValidations();
- Assert.AreEqual(0, list.Count);
+ ClassicAssert.AreEqual(0, list.Count);
IDataValidationHelper dataValidationHelper = sheet.GetDataValidationHelper();
IDataValidationConstraint constraint = dataValidationHelper.CreateExplicitListConstraint(new String[] { "aaa",
@@ -391,22 +391,22 @@ public void TestGetDataValidationsListExplicit()
sheet.AddValidationData(validation);
list = sheet.GetDataValidations(); // <-- works
- Assert.AreEqual(1, list.Count);
+ ClassicAssert.AreEqual(1, list.Count);
HSSFDataValidation dv = list[(0)] as HSSFDataValidation;
- Assert.AreEqual(true, dv.SuppressDropDownArrow);
+ ClassicAssert.AreEqual(true, dv.SuppressDropDownArrow);
DVConstraint c = dv.Constraint;
- Assert.AreEqual(ValidationType.LIST, c.GetValidationType());
- Assert.AreEqual(null, c.Formula1);
- Assert.AreEqual(null, c.Formula2);
- Assert.AreEqual(double.NaN, c.Value1);
- Assert.AreEqual(double.NaN, c.Value2);
+ ClassicAssert.AreEqual(ValidationType.LIST, c.GetValidationType());
+ ClassicAssert.AreEqual(null, c.Formula1);
+ ClassicAssert.AreEqual(null, c.Formula2);
+ ClassicAssert.AreEqual(double.NaN, c.Value1);
+ ClassicAssert.AreEqual(double.NaN, c.Value2);
String[] values = c.ExplicitListValues;
- Assert.AreEqual(3, values.Length);
- Assert.AreEqual("aaa", values[0]);
- Assert.AreEqual("bbb", values[1]);
- Assert.AreEqual("ccc", values[2]);
+ ClassicAssert.AreEqual(3, values.Length);
+ ClassicAssert.AreEqual("aaa", values[0]);
+ ClassicAssert.AreEqual("bbb", values[1]);
+ ClassicAssert.AreEqual("ccc", values[2]);
}
[Test]
@@ -415,7 +415,7 @@ public void TestGetDataValidationsListFormula()
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.CreateSheet() as HSSFSheet;
List list = sheet.GetDataValidations();
- Assert.AreEqual(0, list.Count);
+ ClassicAssert.AreEqual(0, list.Count);
IDataValidationHelper dataValidationHelper = sheet.GetDataValidationHelper();
IDataValidationConstraint constraint = dataValidationHelper.CreateFormulaListConstraint("A2");
@@ -425,17 +425,17 @@ public void TestGetDataValidationsListFormula()
sheet.AddValidationData(validation);
list = sheet.GetDataValidations(); // <-- works
- Assert.AreEqual(1, list.Count);
+ ClassicAssert.AreEqual(1, list.Count);
HSSFDataValidation dv = list[(0)] as HSSFDataValidation;
- Assert.AreEqual(true, dv.SuppressDropDownArrow);
+ ClassicAssert.AreEqual(true, dv.SuppressDropDownArrow);
DVConstraint c = dv.Constraint;
- Assert.AreEqual(ValidationType.LIST, c.GetValidationType());
- Assert.AreEqual("A2", c.Formula1);
- Assert.AreEqual(null, c.Formula2);
- Assert.AreEqual(double.NaN, c.Value1);
- Assert.AreEqual(double.NaN, c.Value2);
+ ClassicAssert.AreEqual(ValidationType.LIST, c.GetValidationType());
+ ClassicAssert.AreEqual("A2", c.Formula1);
+ ClassicAssert.AreEqual(null, c.Formula2);
+ ClassicAssert.AreEqual(double.NaN, c.Value1);
+ ClassicAssert.AreEqual(double.NaN, c.Value2);
}
[Test]
@@ -444,7 +444,7 @@ public void TestGetDataValidationsFormula()
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.CreateSheet() as HSSFSheet;
List list = sheet.GetDataValidations();
- Assert.AreEqual(0, list.Count);
+ ClassicAssert.AreEqual(0, list.Count);
IDataValidationHelper dataValidationHelper = sheet.GetDataValidationHelper();
IDataValidationConstraint constraint = dataValidationHelper.CreateCustomConstraint("A2:A3");
@@ -453,15 +453,15 @@ public void TestGetDataValidationsFormula()
sheet.AddValidationData(validation);
list = sheet.GetDataValidations(); // <-- works
- Assert.AreEqual(1, list.Count);
+ ClassicAssert.AreEqual(1, list.Count);
HSSFDataValidation dv = list[(0)] as HSSFDataValidation;
DVConstraint c = dv.Constraint;
- Assert.AreEqual(ValidationType.FORMULA, c.GetValidationType());
- Assert.AreEqual("A2:A3", c.Formula1);
- Assert.AreEqual(null, c.Formula2);
- Assert.AreEqual(double.NaN, c.Value1);
- Assert.AreEqual(double.NaN, c.Value2);
+ ClassicAssert.AreEqual(ValidationType.FORMULA, c.GetValidationType());
+ ClassicAssert.AreEqual("A2:A3", c.Formula1);
+ ClassicAssert.AreEqual(null, c.Formula2);
+ ClassicAssert.AreEqual(double.NaN, c.Value1);
+ ClassicAssert.AreEqual(double.NaN, c.Value2);
}
[Test]
@@ -471,7 +471,7 @@ public void TestRemoveDataValidation()
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.CreateSheet() as HSSFSheet;
List list = sheet.GetDataValidations();
- Assert.AreEqual(0, list.Count);
+ ClassicAssert.AreEqual(0, list.Count);
IDataValidationHelper dataValidationHelper = sheet.GetDataValidationHelper();
IDataValidationConstraint constraint = dataValidationHelper.CreateCustomConstraint("A2:A3");
@@ -480,12 +480,12 @@ public void TestRemoveDataValidation()
sheet.AddValidationData(validation);
list = sheet.GetDataValidations();
- Assert.AreEqual(1, list.Count);
+ ClassicAssert.AreEqual(1, list.Count);
sheet.RemoveDataValidation(validation);
list = sheet.GetDataValidations();
- Assert.AreEqual(0, list.Count);
+ ClassicAssert.AreEqual(0, list.Count);
}
}
}
diff --git a/testcases/main/HSSF/UserModel/TestEmbeddedObjects.cs b/testcases/main/HSSF/UserModel/TestEmbeddedObjects.cs
index 62739bbaf..85aafe1ce 100644
--- a/testcases/main/HSSF/UserModel/TestEmbeddedObjects.cs
+++ b/testcases/main/HSSF/UserModel/TestEmbeddedObjects.cs
@@ -19,7 +19,7 @@ limitations Under the License.
using System.Linq;
using System.Text;
using NPOI.HSSF.UserModel;
-using NUnit.Framework;
+using NUnit.Framework;using NUnit.Framework.Legacy;
namespace TestCases.HSSF.UserModel
{
@@ -34,11 +34,11 @@ public void TestReadExistingObject()
{
HSSFWorkbook wb = HSSFTestDataSamples.OpenSampleWorkbook("drawings.xls");
IList list = wb.GetAllEmbeddedObjects();
- Assert.AreEqual(list.Count, 1);
+ ClassicAssert.AreEqual(list.Count, 1);
HSSFObjectData obj = list[0];
- Assert.IsNotNull(obj.GetObjectData());
- Assert.IsNotNull(obj.GetDirectory());
- Assert.IsNotNull(obj.OLE2ClassName);
+ ClassicAssert.IsNotNull(obj.GetObjectData());
+ ClassicAssert.IsNotNull(obj.GetDirectory());
+ ClassicAssert.IsNotNull(obj.OLE2ClassName);
}
/**
@@ -50,10 +50,10 @@ public void TestReadNestedObject()
{
HSSFWorkbook wb = HSSFTestDataSamples.OpenSampleWorkbook("WithCheckBoxes.xls");
IList list = wb.GetAllEmbeddedObjects();
- Assert.AreEqual(list.Count, 1);
+ ClassicAssert.AreEqual(list.Count, 1);
HSSFObjectData obj = list[0];
- Assert.IsNotNull(obj.GetObjectData());
- Assert.IsNotNull(obj.OLE2ClassName);
+ ClassicAssert.IsNotNull(obj.GetObjectData());
+ ClassicAssert.IsNotNull(obj.OLE2ClassName);
}
/**
@@ -65,7 +65,7 @@ public void TestReadManyNestedObjects()
{
HSSFWorkbook wb = HSSFTestDataSamples.OpenSampleWorkbook("45538_form_Header.xls");
IList list = wb.GetAllEmbeddedObjects();
- Assert.AreEqual(list.Count, 40);
+ ClassicAssert.AreEqual(list.Count, 40);
}
}
}
diff --git a/testcases/main/HSSF/UserModel/TestEscherGraphics.cs b/testcases/main/HSSF/UserModel/TestEscherGraphics.cs
index 8bbcda6a2..9b7132df5 100644
--- a/testcases/main/HSSF/UserModel/TestEscherGraphics.cs
+++ b/testcases/main/HSSF/UserModel/TestEscherGraphics.cs
@@ -24,7 +24,7 @@ namespace TestCases.HSSF.UserModel
using NPOI.SS.UserModel;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.PixelFormats;
@@ -70,8 +70,8 @@ public void TestGetFont()
System.Drawing.Font f = graphics.Font;
if (f.ToString().IndexOf("dialog") == -1 && f.ToString().IndexOf("Dialog") == -1)
{
- //Assert.AreEqual("java.awt.Font[family=Arial,name=Arial,style=plain,size=10]", f.ToString());
- Assert.AreEqual("[Font: Name=Arial, Size=10, Units=3, GdiCharSet=1, GdiVerticalFont=False]", f.ToString());
+ //ClassicAssert.AreEqual("java.awt.Font[family=Arial,name=Arial,style=plain,size=10]", f.ToString());
+ ClassicAssert.AreEqual("[Font: Name=Arial, Size=10, Units=3, GdiCharSet=1, GdiVerticalFont=False]", f.ToString());
}
}
*/
@@ -83,10 +83,10 @@ public void TestGetFont()
// if (f.ToString().IndexOf("dialog") != -1 || f.ToString().IndexOf("Dialog") != -1)
// return;
- // Assert.AreEqual(7, TextRenderer.MeasureText("X", f).Width);
- // Assert.AreEqual("Arial", f.FontFamily.Name);
- // Assert.AreEqual(10, f.Size);
- // //Assert.AreEqual("java.awt.Font[family=Arial,name=Arial,style=plain,size=10]", fontMetrics.GetFont().ToString());
+ // ClassicAssert.AreEqual(7, TextRenderer.MeasureText("X", f).Width);
+ // ClassicAssert.AreEqual("Arial", f.FontFamily.Name);
+ // ClassicAssert.AreEqual(10, f.Size);
+ // //ClassicAssert.AreEqual("java.awt.Font[family=Arial,name=Arial,style=plain,size=10]", fontMetrics.GetFont().ToString());
//}
/* TODO-Fonts:
@@ -95,14 +95,14 @@ public void TestSetFont()
{
System.Drawing.Font f = new System.Drawing.Font("Helvetica", 12,FontStyle.Regular);
graphics.SetFont(f);
- Assert.AreEqual(f, graphics.Font);
+ ClassicAssert.AreEqual(f, graphics.Font);
}
*/
[Test]
public void TestSetColor()
{
graphics.SetColor(Color.Red);
- Assert.AreEqual(Color.Red, graphics.Color);
+ ClassicAssert.AreEqual(Color.Red, graphics.Color);
}
[Test]
@@ -110,11 +110,11 @@ public void TestFillRect()
{
graphics.FillRect(10, 10, 20, 20);
HSSFSimpleShape s = (HSSFSimpleShape)escherGroupA.Children[0];
- Assert.AreEqual(HSSFSimpleShape.OBJECT_TYPE_RECTANGLE, s.ShapeType);
- Assert.AreEqual(10, s.Anchor.Dx1);
- Assert.AreEqual(10, s.Anchor.Dy1);
- Assert.AreEqual(30, s.Anchor.Dy2);
- Assert.AreEqual(30, s.Anchor.Dx2);
+ ClassicAssert.AreEqual(HSSFSimpleShape.OBJECT_TYPE_RECTANGLE, s.ShapeType);
+ ClassicAssert.AreEqual(10, s.Anchor.Dx1);
+ ClassicAssert.AreEqual(10, s.Anchor.Dy1);
+ ClassicAssert.AreEqual(30, s.Anchor.Dy2);
+ ClassicAssert.AreEqual(30, s.Anchor.Dx2);
}
[Test]
@@ -122,7 +122,7 @@ public void TestDrawString()
{
graphics.DrawString("This is a Test", 10, 10);
HSSFTextbox t = (HSSFTextbox)escherGroupA.Children[0];
- Assert.AreEqual("This is a Test", t.String.String);
+ ClassicAssert.AreEqual("This is a Test", t.String.String);
}
[Test]
@@ -141,37 +141,37 @@ public void TestGetDataBackAgain()
patriarch = (HSSFPatriarch)s.DrawingPatriarch;
- Assert.IsNotNull(patriarch);
- Assert.AreEqual(10, patriarch.X1);
- Assert.AreEqual(20, patriarch.Y1);
- Assert.AreEqual(30, patriarch.X2);
- Assert.AreEqual(40, patriarch.Y2);
+ ClassicAssert.IsNotNull(patriarch);
+ ClassicAssert.AreEqual(10, patriarch.X1);
+ ClassicAssert.AreEqual(20, patriarch.Y1);
+ ClassicAssert.AreEqual(30, patriarch.X2);
+ ClassicAssert.AreEqual(40, patriarch.Y2);
// Check the two groups too
- Assert.AreEqual(2, patriarch.CountOfAllChildren);
- Assert.IsTrue(patriarch.Children[0] is HSSFShapeGroup);
- Assert.IsTrue(patriarch.Children[1] is HSSFShapeGroup);
+ ClassicAssert.AreEqual(2, patriarch.CountOfAllChildren);
+ ClassicAssert.IsTrue(patriarch.Children[0] is HSSFShapeGroup);
+ ClassicAssert.IsTrue(patriarch.Children[1] is HSSFShapeGroup);
s1 = (HSSFShapeGroup)patriarch.Children[0];
s2 = (HSSFShapeGroup)patriarch.Children[1];
- Assert.AreEqual(0, s1.X1);
- Assert.AreEqual(0, s1.Y1);
- Assert.AreEqual(1023, s1.X2);
- Assert.AreEqual(255, s1.Y2);
- Assert.AreEqual(0, s2.X1);
- Assert.AreEqual(0, s2.Y1);
- Assert.AreEqual(1023, s2.X2);
- Assert.AreEqual(255, s2.Y2);
-
- Assert.AreEqual(0, s1.Anchor.Dx1);
- Assert.AreEqual(0, s1.Anchor.Dy1);
- Assert.AreEqual(1022, s1.Anchor.Dx2);
- Assert.AreEqual(255, s1.Anchor.Dy2);
- Assert.AreEqual(20, s2.Anchor.Dx1);
- Assert.AreEqual(30, s2.Anchor.Dy1);
- Assert.AreEqual(500, s2.Anchor.Dx2);
- Assert.AreEqual(200, s2.Anchor.Dy2);
+ ClassicAssert.AreEqual(0, s1.X1);
+ ClassicAssert.AreEqual(0, s1.Y1);
+ ClassicAssert.AreEqual(1023, s1.X2);
+ ClassicAssert.AreEqual(255, s1.Y2);
+ ClassicAssert.AreEqual(0, s2.X1);
+ ClassicAssert.AreEqual(0, s2.Y1);
+ ClassicAssert.AreEqual(1023, s2.X2);
+ ClassicAssert.AreEqual(255, s2.Y2);
+
+ ClassicAssert.AreEqual(0, s1.Anchor.Dx1);
+ ClassicAssert.AreEqual(0, s1.Anchor.Dy1);
+ ClassicAssert.AreEqual(1022, s1.Anchor.Dx2);
+ ClassicAssert.AreEqual(255, s1.Anchor.Dy2);
+ ClassicAssert.AreEqual(20, s2.Anchor.Dx1);
+ ClassicAssert.AreEqual(30, s2.Anchor.Dy1);
+ ClassicAssert.AreEqual(500, s2.Anchor.Dx2);
+ ClassicAssert.AreEqual(200, s2.Anchor.Dy2);
// Write and re-load once more, to Check that's ok
@@ -181,37 +181,37 @@ public void TestGetDataBackAgain()
s = (HSSFSheet)workbook.GetSheetAt(0);
patriarch = (HSSFPatriarch)s.DrawingPatriarch;
- Assert.IsNotNull(patriarch);
- Assert.AreEqual(10, patriarch.X1);
- Assert.AreEqual(20, patriarch.Y1);
- Assert.AreEqual(30, patriarch.X2);
- Assert.AreEqual(40, patriarch.Y2);
+ ClassicAssert.IsNotNull(patriarch);
+ ClassicAssert.AreEqual(10, patriarch.X1);
+ ClassicAssert.AreEqual(20, patriarch.Y1);
+ ClassicAssert.AreEqual(30, patriarch.X2);
+ ClassicAssert.AreEqual(40, patriarch.Y2);
// Check the two groups too
- Assert.AreEqual(2, patriarch.CountOfAllChildren);
- Assert.IsTrue(patriarch.Children[0] is HSSFShapeGroup);
- Assert.IsTrue(patriarch.Children[1] is HSSFShapeGroup);
+ ClassicAssert.AreEqual(2, patriarch.CountOfAllChildren);
+ ClassicAssert.IsTrue(patriarch.Children[0] is HSSFShapeGroup);
+ ClassicAssert.IsTrue(patriarch.Children[1] is HSSFShapeGroup);
s1 = (HSSFShapeGroup)patriarch.Children[0];
s2 = (HSSFShapeGroup)patriarch.Children[1];
- Assert.AreEqual(0, s1.X1);
- Assert.AreEqual(0, s1.Y1);
- Assert.AreEqual(1023, s1.X2);
- Assert.AreEqual(255, s1.Y2);
- Assert.AreEqual(0, s2.X1);
- Assert.AreEqual(0, s2.Y1);
- Assert.AreEqual(1023, s2.X2);
- Assert.AreEqual(255, s2.Y2);
-
- Assert.AreEqual(0, s1.Anchor.Dx1);
- Assert.AreEqual(0, s1.Anchor.Dy1);
- Assert.AreEqual(1022, s1.Anchor.Dx2);
- Assert.AreEqual(255, s1.Anchor.Dy2);
- Assert.AreEqual(20, s2.Anchor.Dx1);
- Assert.AreEqual(30, s2.Anchor.Dy1);
- Assert.AreEqual(500, s2.Anchor.Dx2);
- Assert.AreEqual(200, s2.Anchor.Dy2);
+ ClassicAssert.AreEqual(0, s1.X1);
+ ClassicAssert.AreEqual(0, s1.Y1);
+ ClassicAssert.AreEqual(1023, s1.X2);
+ ClassicAssert.AreEqual(255, s1.Y2);
+ ClassicAssert.AreEqual(0, s2.X1);
+ ClassicAssert.AreEqual(0, s2.Y1);
+ ClassicAssert.AreEqual(1023, s2.X2);
+ ClassicAssert.AreEqual(255, s2.Y2);
+
+ ClassicAssert.AreEqual(0, s1.Anchor.Dx1);
+ ClassicAssert.AreEqual(0, s1.Anchor.Dy1);
+ ClassicAssert.AreEqual(1022, s1.Anchor.Dx2);
+ ClassicAssert.AreEqual(255, s1.Anchor.Dy2);
+ ClassicAssert.AreEqual(20, s2.Anchor.Dx1);
+ ClassicAssert.AreEqual(30, s2.Anchor.Dy1);
+ ClassicAssert.AreEqual(500, s2.Anchor.Dx2);
+ ClassicAssert.AreEqual(200, s2.Anchor.Dy2);
// Change the positions of the first groups,
// but not of their anchors
@@ -223,38 +223,38 @@ public void TestGetDataBackAgain()
s =(HSSFSheet)workbook.GetSheetAt(0);
patriarch = (HSSFPatriarch)s.DrawingPatriarch;
- Assert.IsNotNull(patriarch);
- Assert.AreEqual(10, patriarch.X1);
- Assert.AreEqual(20, patriarch.Y1);
- Assert.AreEqual(30, patriarch.X2);
- Assert.AreEqual(40, patriarch.Y2);
+ ClassicAssert.IsNotNull(patriarch);
+ ClassicAssert.AreEqual(10, patriarch.X1);
+ ClassicAssert.AreEqual(20, patriarch.Y1);
+ ClassicAssert.AreEqual(30, patriarch.X2);
+ ClassicAssert.AreEqual(40, patriarch.Y2);
// Check the two groups too
- Assert.AreEqual(2, patriarch.CountOfAllChildren);
- Assert.AreEqual(2, patriarch.Children.Count);
- Assert.IsTrue(patriarch.Children[0] is HSSFShapeGroup);
- Assert.IsTrue(patriarch.Children[1] is HSSFShapeGroup);
+ ClassicAssert.AreEqual(2, patriarch.CountOfAllChildren);
+ ClassicAssert.AreEqual(2, patriarch.Children.Count);
+ ClassicAssert.IsTrue(patriarch.Children[0] is HSSFShapeGroup);
+ ClassicAssert.IsTrue(patriarch.Children[1] is HSSFShapeGroup);
s1 = (HSSFShapeGroup)patriarch.Children[0];
s2 = (HSSFShapeGroup)patriarch.Children[1];
- Assert.AreEqual(2, s1.X1);
- Assert.AreEqual(3, s1.Y1);
- Assert.AreEqual(1021, s1.X2);
- Assert.AreEqual(242, s1.Y2);
- Assert.AreEqual(0, s2.X1);
- Assert.AreEqual(0, s2.Y1);
- Assert.AreEqual(1023, s2.X2);
- Assert.AreEqual(255, s2.Y2);
-
- Assert.AreEqual(0, s1.Anchor.Dx1);
- Assert.AreEqual(0, s1.Anchor.Dy1);
- Assert.AreEqual(1022, s1.Anchor.Dx2);
- Assert.AreEqual(255, s1.Anchor.Dy2);
- Assert.AreEqual(20, s2.Anchor.Dx1);
- Assert.AreEqual(30, s2.Anchor.Dy1);
- Assert.AreEqual(500, s2.Anchor.Dx2);
- Assert.AreEqual(200, s2.Anchor.Dy2);
+ ClassicAssert.AreEqual(2, s1.X1);
+ ClassicAssert.AreEqual(3, s1.Y1);
+ ClassicAssert.AreEqual(1021, s1.X2);
+ ClassicAssert.AreEqual(242, s1.Y2);
+ ClassicAssert.AreEqual(0, s2.X1);
+ ClassicAssert.AreEqual(0, s2.Y1);
+ ClassicAssert.AreEqual(1023, s2.X2);
+ ClassicAssert.AreEqual(255, s2.Y2);
+
+ ClassicAssert.AreEqual(0, s1.Anchor.Dx1);
+ ClassicAssert.AreEqual(0, s1.Anchor.Dy1);
+ ClassicAssert.AreEqual(1022, s1.Anchor.Dx2);
+ ClassicAssert.AreEqual(255, s1.Anchor.Dy2);
+ ClassicAssert.AreEqual(20, s2.Anchor.Dx1);
+ ClassicAssert.AreEqual(30, s2.Anchor.Dy1);
+ ClassicAssert.AreEqual(500, s2.Anchor.Dx2);
+ ClassicAssert.AreEqual(200, s2.Anchor.Dy2);
// Now Add some text to one group, and some more
@@ -266,7 +266,7 @@ public void TestGetDataBackAgain()
s2.CreateTextbox(new HSSFChildAnchor(41, 42, 43, 44)) as HSSFTextbox;
tbox2.String = (new HSSFRichTextString("This is text box 2"));
- Assert.AreEqual(3, patriarch.Children.Count);
+ ClassicAssert.AreEqual(3, patriarch.Children.Count);
baos = new MemoryStream();
@@ -276,22 +276,22 @@ public void TestGetDataBackAgain()
patriarch = (HSSFPatriarch)s.DrawingPatriarch;
- Assert.IsNotNull(patriarch);
- Assert.AreEqual(10, patriarch.X1);
- Assert.AreEqual(20, patriarch.Y1);
- Assert.AreEqual(30, patriarch.X2);
- Assert.AreEqual(40, patriarch.Y2);
+ ClassicAssert.IsNotNull(patriarch);
+ ClassicAssert.AreEqual(10, patriarch.X1);
+ ClassicAssert.AreEqual(20, patriarch.Y1);
+ ClassicAssert.AreEqual(30, patriarch.X2);
+ ClassicAssert.AreEqual(40, patriarch.Y2);
// Check the two groups and the text
// Result of patriarch.countOfAllChildren() makes no sense:
// Returns 4 for 2 empty groups + 1 TextBox.
- //Assert.AreEqual(3, patriarch.CountOfAllChildren);
- Assert.AreEqual(3, patriarch.Children.Count);
+ //ClassicAssert.AreEqual(3, patriarch.CountOfAllChildren);
+ ClassicAssert.AreEqual(3, patriarch.Children.Count);
// Should be two groups and a text
- Assert.IsTrue(patriarch.Children[0] is HSSFShapeGroup);
- Assert.IsTrue(patriarch.Children[1] is HSSFShapeGroup);
- Assert.IsTrue(patriarch.Children[2] is HSSFTextbox);
+ ClassicAssert.IsTrue(patriarch.Children[0] is HSSFShapeGroup);
+ ClassicAssert.IsTrue(patriarch.Children[1] is HSSFShapeGroup);
+ ClassicAssert.IsTrue(patriarch.Children[2] is HSSFTextbox);
s1 = (HSSFShapeGroup)patriarch.Children[0];
@@ -299,26 +299,26 @@ public void TestGetDataBackAgain()
s2 = (HSSFShapeGroup)patriarch.Children[1];
- Assert.AreEqual(2, s1.X1);
- Assert.AreEqual(3, s1.Y1);
- Assert.AreEqual(1021, s1.X2);
- Assert.AreEqual(242, s1.Y2);
- Assert.AreEqual(0, s2.X1);
- Assert.AreEqual(0, s2.Y1);
- Assert.AreEqual(1023, s2.X2);
- Assert.AreEqual(255, s2.Y2);
-
- Assert.AreEqual(0, s1.Anchor.Dx1);
- Assert.AreEqual(0, s1.Anchor.Dy1);
- Assert.AreEqual(1022, s1.Anchor.Dx2);
- Assert.AreEqual(255, s1.Anchor.Dy2);
- Assert.AreEqual(20, s2.Anchor.Dx1);
- Assert.AreEqual(30, s2.Anchor.Dy1);
- Assert.AreEqual(500, s2.Anchor.Dx2);
- Assert.AreEqual(200, s2.Anchor.Dy2);
+ ClassicAssert.AreEqual(2, s1.X1);
+ ClassicAssert.AreEqual(3, s1.Y1);
+ ClassicAssert.AreEqual(1021, s1.X2);
+ ClassicAssert.AreEqual(242, s1.Y2);
+ ClassicAssert.AreEqual(0, s2.X1);
+ ClassicAssert.AreEqual(0, s2.Y1);
+ ClassicAssert.AreEqual(1023, s2.X2);
+ ClassicAssert.AreEqual(255, s2.Y2);
+
+ ClassicAssert.AreEqual(0, s1.Anchor.Dx1);
+ ClassicAssert.AreEqual(0, s1.Anchor.Dy1);
+ ClassicAssert.AreEqual(1022, s1.Anchor.Dx2);
+ ClassicAssert.AreEqual(255, s1.Anchor.Dy2);
+ ClassicAssert.AreEqual(20, s2.Anchor.Dx1);
+ ClassicAssert.AreEqual(30, s2.Anchor.Dy1);
+ ClassicAssert.AreEqual(500, s2.Anchor.Dx2);
+ ClassicAssert.AreEqual(200, s2.Anchor.Dy2);
// Not working just yet
- //Assert.AreEqual("I am text box 1", tbox1.String.String);
+ //ClassicAssert.AreEqual("I am text box 1", tbox1.String.String);
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/UserModel/TestExternalReferenceChange.cs b/testcases/main/HSSF/UserModel/TestExternalReferenceChange.cs
index b1e106a47..6e5a7c5bc 100644
--- a/testcases/main/HSSF/UserModel/TestExternalReferenceChange.cs
+++ b/testcases/main/HSSF/UserModel/TestExternalReferenceChange.cs
@@ -18,7 +18,7 @@ limitations Under the License.
using System.Collections.Generic;
using System.Linq;
using System.Text;
-using NUnit.Framework;
+using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.UserModel;
using NPOI.SS.UserModel;
@@ -40,22 +40,22 @@ protected void SetUp()
mainWorkbook = HSSFTestDataSamples.OpenSampleWorkbook(MAIN_WORKBOOK_FILENAME);
sourceWorkbook = HSSFTestDataSamples.OpenSampleWorkbook(SOURCE_WORKBOOK_FILENAME);
- Assert.IsNotNull(mainWorkbook);
- Assert.IsNotNull(sourceWorkbook);
+ ClassicAssert.IsNotNull(mainWorkbook);
+ ClassicAssert.IsNotNull(sourceWorkbook);
}
[Test]
public void TestDummyToSource()
{
bool changed = mainWorkbook.ChangeExternalReference("DOESNOTEXIST", SOURCE_WORKBOOK_FILENAME);
- Assert.IsFalse(changed);
+ ClassicAssert.IsFalse(changed);
changed = mainWorkbook.ChangeExternalReference(SOURCE_DUMMY_WORKBOOK_FILENAME, SOURCE_WORKBOOK_FILENAME);
- Assert.IsTrue(changed);
+ ClassicAssert.IsTrue(changed);
HSSFSheet lSheet = (HSSFSheet)mainWorkbook.GetSheetAt(0);
HSSFCell lA1Cell = (HSSFCell)lSheet.GetRow(0).GetCell(0);
- Assert.AreEqual(CellType.Formula, lA1Cell.CellType);
+ ClassicAssert.AreEqual(CellType.Formula, lA1Cell.CellType);
HSSFFormulaEvaluator lMainWorkbookEvaluator = new HSSFFormulaEvaluator(mainWorkbook);
HSSFFormulaEvaluator lSourceEvaluator = new HSSFFormulaEvaluator(sourceWorkbook);
@@ -63,9 +63,9 @@ public void TestDummyToSource()
new String[] { MAIN_WORKBOOK_FILENAME, SOURCE_WORKBOOK_FILENAME },
new HSSFFormulaEvaluator[] { lMainWorkbookEvaluator, lSourceEvaluator });
- Assert.AreEqual(CellType.Numeric, lMainWorkbookEvaluator.EvaluateFormulaCell(lA1Cell));
+ ClassicAssert.AreEqual(CellType.Numeric, lMainWorkbookEvaluator.EvaluateFormulaCell(lA1Cell));
- Assert.AreEqual(20.0d, lA1Cell.NumericCellValue, 0.00001d);
+ ClassicAssert.AreEqual(20.0d, lA1Cell.NumericCellValue, 0.00001d);
}
diff --git a/testcases/main/HSSF/UserModel/TestFontDetails.cs b/testcases/main/HSSF/UserModel/TestFontDetails.cs
index 8616640aa..11716747b 100644
--- a/testcases/main/HSSF/UserModel/TestFontDetails.cs
+++ b/testcases/main/HSSF/UserModel/TestFontDetails.cs
@@ -20,7 +20,7 @@ namespace TestCases.HSSF.UserModel
using System;
using NPOI.Util.Collections;
using NPOI.HSSF.UserModel;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
* Tests the implementation of the FontDetails class.
*
@@ -45,20 +45,20 @@ public void SetUp()
[Test]
public void TestCreate()
{
- Assert.AreEqual(13, fontDetails.GetHeight());
- Assert.AreEqual(6, fontDetails.GetCharWidth('a'));
- Assert.AreEqual(3, fontDetails.GetCharWidth('f'));
+ ClassicAssert.AreEqual(13, fontDetails.GetHeight());
+ ClassicAssert.AreEqual(6, fontDetails.GetCharWidth('a'));
+ ClassicAssert.AreEqual(3, fontDetails.GetCharWidth('f'));
}
[Test]
public void TestGetStringWidth()
{
- Assert.AreEqual(9, fontDetails.GetStringWidth("af"));
+ ClassicAssert.AreEqual(9, fontDetails.GetStringWidth("af"));
}
[Test]
public void TestGetCharWidth()
{
- Assert.AreEqual(6, fontDetails.GetCharWidth('a'));
- Assert.AreEqual(9, fontDetails.GetCharWidth('='));
+ ClassicAssert.AreEqual(6, fontDetails.GetCharWidth('a'));
+ ClassicAssert.AreEqual(9, fontDetails.GetCharWidth('='));
}
}
diff --git a/testcases/main/HSSF/UserModel/TestFormulaEvaluatorBugs.cs b/testcases/main/HSSF/UserModel/TestFormulaEvaluatorBugs.cs
index cf5e94de5..3a142911d 100644
--- a/testcases/main/HSSF/UserModel/TestFormulaEvaluatorBugs.cs
+++ b/testcases/main/HSSF/UserModel/TestFormulaEvaluatorBugs.cs
@@ -21,7 +21,7 @@ namespace TestCases.HSSF.UserModel
using System.Collections;
using System.Configuration;
using System.IO;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.Record.Aggregates;
using NPOI.HSSF.UserModel;
using NPOI.SS.Formula;
@@ -73,7 +73,7 @@ public void Test44636()
row.GetCell(2).SetCellValue(25);
HSSFFormulaEvaluator.EvaluateAllFormulaCells(wb);
- Assert.AreEqual(4.2 * 25, row.GetCell(3).NumericCellValue, 0.0001);
+ ClassicAssert.AreEqual(4.2 * 25, row.GetCell(3).NumericCellValue, 0.0001);
if (OUTPUT_TEST_FILES)
@@ -99,7 +99,7 @@ public void Test44636()
row.CreateCell(0).CellFormula = ("SUM(A1:B1)");
HSSFFormulaEvaluator.EvaluateAllFormulaCells(wb);
- Assert.AreEqual(5.4, row.GetCell(0).NumericCellValue, 0.0001);
+ ClassicAssert.AreEqual(5.4, row.GetCell(0).NumericCellValue, 0.0001);
if (OUTPUT_TEST_FILES)
{
@@ -136,48 +136,48 @@ public void Test44297()
row = sheet.GetRow(0);
cell = row.GetCell(0);
- Assert.AreEqual("31+46", cell.CellFormula);
- Assert.AreEqual(77, eva.Evaluate(cell).NumberValue, 0);
+ ClassicAssert.AreEqual("31+46", cell.CellFormula);
+ ClassicAssert.AreEqual(77, eva.Evaluate(cell).NumberValue, 0);
row = sheet.GetRow(1);
cell = row.GetCell(0);
- Assert.AreEqual("30+53", cell.CellFormula);
- Assert.AreEqual(83, eva.Evaluate(cell).NumberValue, 0);
+ ClassicAssert.AreEqual("30+53", cell.CellFormula);
+ ClassicAssert.AreEqual(83, eva.Evaluate(cell).NumberValue, 0);
row = sheet.GetRow(2);
cell = row.GetCell(0);
- Assert.AreEqual("SUM(A1:A2)", cell.CellFormula);
- Assert.AreEqual(160, eva.Evaluate(cell).NumberValue, 0);
+ ClassicAssert.AreEqual("SUM(A1:A2)", cell.CellFormula);
+ ClassicAssert.AreEqual(160, eva.Evaluate(cell).NumberValue, 0);
row = sheet.GetRow(4);
cell = row.GetCell(0);
- Assert.AreEqual("32767+32768", cell.CellFormula);
- Assert.AreEqual(65535, eva.Evaluate(cell).NumberValue, 0);
+ ClassicAssert.AreEqual("32767+32768", cell.CellFormula);
+ ClassicAssert.AreEqual(65535, eva.Evaluate(cell).NumberValue, 0);
row = sheet.GetRow(7);
cell = row.GetCell(0);
- Assert.AreEqual("32744+42333", cell.CellFormula);
- Assert.AreEqual(75077, eva.Evaluate(cell).NumberValue, 0);
+ ClassicAssert.AreEqual("32744+42333", cell.CellFormula);
+ ClassicAssert.AreEqual(75077, eva.Evaluate(cell).NumberValue, 0);
row = sheet.GetRow(8);
cell = row.GetCell(0);
- Assert.AreEqual("327680/32768", cell.CellFormula);
- Assert.AreEqual(10, eva.Evaluate(cell).NumberValue, 0);
+ ClassicAssert.AreEqual("327680/32768", cell.CellFormula);
+ ClassicAssert.AreEqual(10, eva.Evaluate(cell).NumberValue, 0);
row = sheet.GetRow(9);
cell = row.GetCell(0);
- Assert.AreEqual("32767+32769", cell.CellFormula);
- Assert.AreEqual(65536, eva.Evaluate(cell).NumberValue, 0);
+ ClassicAssert.AreEqual("32767+32769", cell.CellFormula);
+ ClassicAssert.AreEqual(65536, eva.Evaluate(cell).NumberValue, 0);
row = sheet.GetRow(10);
cell = row.GetCell(0);
- Assert.AreEqual("35000+36000", cell.CellFormula);
- Assert.AreEqual(71000, eva.Evaluate(cell).NumberValue, 0);
+ ClassicAssert.AreEqual("35000+36000", cell.CellFormula);
+ ClassicAssert.AreEqual(71000, eva.Evaluate(cell).NumberValue, 0);
row = sheet.GetRow(11);
cell = row.GetCell(0);
- Assert.AreEqual("-1000000-3000000", cell.CellFormula);
- Assert.AreEqual(-4000000, eva.Evaluate(cell).NumberValue, 0);
+ ClassicAssert.AreEqual("-1000000-3000000", cell.CellFormula);
+ ClassicAssert.AreEqual(-4000000, eva.Evaluate(cell).NumberValue, 0);
wb.Close();
}
@@ -210,39 +210,39 @@ public void Test44410()
FormulaRecordAggregate frec = (FormulaRecordAggregate)((HSSFCell)cellSUM).CellValueRecord;
Ptg[] ops = frec.FormulaRecord.ParsedExpression;
- Assert.AreEqual(2, ops.Length);
- Assert.AreEqual(typeof(AreaPtg), ops[0].GetType());
- Assert.AreEqual(typeof(FuncVarPtg), ops[1].GetType());
+ ClassicAssert.AreEqual(2, ops.Length);
+ ClassicAssert.AreEqual(typeof(AreaPtg), ops[0].GetType());
+ ClassicAssert.AreEqual(typeof(FuncVarPtg), ops[1].GetType());
// Actually stored as C1 to C65536
// (last row is -1 === 65535)
AreaPtg ptg = (AreaPtg)ops[0];
- Assert.AreEqual(2, ptg.FirstColumn);
- Assert.AreEqual(2, ptg.LastColumn);
- Assert.AreEqual(0, ptg.FirstRow);
- Assert.AreEqual(65535, ptg.LastRow);
- Assert.AreEqual("C:C", ptg.ToFormulaString());
+ ClassicAssert.AreEqual(2, ptg.FirstColumn);
+ ClassicAssert.AreEqual(2, ptg.LastColumn);
+ ClassicAssert.AreEqual(0, ptg.FirstRow);
+ ClassicAssert.AreEqual(65535, ptg.LastRow);
+ ClassicAssert.AreEqual("C:C", ptg.ToFormulaString());
// Will show as C:C, but won't know how many
// rows it covers as we don't have the sheet
// to hand when turning the Ptgs into a string
- Assert.AreEqual("SUM(C:C)", cellSUM.CellFormula);
+ ClassicAssert.AreEqual("SUM(C:C)", cellSUM.CellFormula);
// But the evaluator knows the sheet, so it
// can do it properly
- Assert.AreEqual(6, eva.Evaluate(cellSUM).NumberValue, 0);
+ ClassicAssert.AreEqual(6, eva.Evaluate(cellSUM).NumberValue, 0);
// Test the index
// Again, the formula string will be right but
// lacking row count, Evaluated will be right
ICell cellIDX = rowIDX.GetCell(0);
- Assert.AreEqual("INDEX(C:C,2,1)", cellIDX.CellFormula);
- Assert.AreEqual(2, eva.Evaluate(cellIDX).NumberValue, 0);
+ ClassicAssert.AreEqual("INDEX(C:C,2,1)", cellIDX.CellFormula);
+ ClassicAssert.AreEqual(2, eva.Evaluate(cellIDX).NumberValue, 0);
// Across two colums
ICell cellSUM2D = rowSUM2D.GetCell(0);
- Assert.AreEqual("SUM(C:D)", cellSUM2D.CellFormula);
- Assert.AreEqual(66, eva.Evaluate(cellSUM2D).NumberValue, 0);
+ ClassicAssert.AreEqual("SUM(C:D)", cellSUM2D.CellFormula);
+ ClassicAssert.AreEqual(66, eva.Evaluate(cellSUM2D).NumberValue, 0);
wb.Close();
}
@@ -270,7 +270,7 @@ public void TestEvaluateBooleanInCell_bug44508()
{
Assert.Fail("Identified bug 44508");
}
- Assert.AreEqual(true, cell.BooleanCellValue);
+ ClassicAssert.AreEqual(true, cell.BooleanCellValue);
wb.Close();
}
@@ -404,17 +404,17 @@ public void TestSlowEvaluate45376()
// With caching, the evaluationCount is 8 which is a big improvement
// Note - these expected values may change if the WorkbookEvaluator is
// ever optimised to short circuit 'if' functions.
- Assert.AreEqual(8, evalCount);
+ ClassicAssert.AreEqual(8, evalCount);
// The cache hits would be 24 if fully evaluating all arguments of the
// "IF()" functions (Each of the 8 formulas has 4 refs to formula cells
// which result in 1 cache miss and 3 cache hits). However with the
// short-circuit-if optimisation, 2 of the cell refs get skipped
// reducing this metric 8.
- Assert.AreEqual(8, evalListener.GetCountCacheHits());
+ ClassicAssert.AreEqual(8, evalListener.GetCountCacheHits());
// confirm the evaluation result too
- Assert.AreEqual(ErrorEval.NA, ve);
+ ClassicAssert.AreEqual(ErrorEval.NA, ve);
wb.Close();
}
@@ -435,31 +435,31 @@ public void TestDateWithNegativeParts_bug48528()
cell.CellFormula = ("DATE(2012,2,1)");
fe.NotifyUpdateCell(cell);
- Assert.AreEqual(40940.0, fe.Evaluate(cell).NumberValue);
+ ClassicAssert.AreEqual(40940.0, fe.Evaluate(cell).NumberValue);
cell.CellFormula = ("DATE(2012,2,1+4)");
fe.NotifyUpdateCell(cell);
- Assert.AreEqual(40944.0, fe.Evaluate(cell).NumberValue);
+ ClassicAssert.AreEqual(40944.0, fe.Evaluate(cell).NumberValue);
cell.CellFormula = ("DATE(2012,2-1,1+4)");
fe.NotifyUpdateCell(cell);
- Assert.AreEqual(40913.0, fe.Evaluate(cell).NumberValue);
+ ClassicAssert.AreEqual(40913.0, fe.Evaluate(cell).NumberValue);
cell.CellFormula = ("DATE(2012,2,1-27)");
fe.NotifyUpdateCell(cell);
- Assert.AreEqual(40913.0, fe.Evaluate(cell).NumberValue);
+ ClassicAssert.AreEqual(40913.0, fe.Evaluate(cell).NumberValue);
cell.CellFormula = ("DATE(2012,2-2,1+4)");
fe.NotifyUpdateCell(cell);
- Assert.AreEqual(40882.0, fe.Evaluate(cell).NumberValue);
+ ClassicAssert.AreEqual(40882.0, fe.Evaluate(cell).NumberValue);
cell.CellFormula = ("DATE(2012,2,1-58)");
fe.NotifyUpdateCell(cell);
- Assert.AreEqual(40882.0, fe.Evaluate(cell).NumberValue);
+ ClassicAssert.AreEqual(40882.0, fe.Evaluate(cell).NumberValue);
cell.CellFormula = ("DATE(2012,2-12,1+4)");
fe.NotifyUpdateCell(cell);
- Assert.AreEqual(40579.0, fe.Evaluate(cell).NumberValue);
+ ClassicAssert.AreEqual(40579.0, fe.Evaluate(cell).NumberValue);
wb.Close();
}
@@ -522,9 +522,9 @@ public void Test55747_55324()
{
cell = row.GetCell(i) as HSSFCell;
Ptg[] ptgs = getPtgs(cell);
- Assert.AreEqual(4, ptgs.Length);
- Assert.AreEqual(typeof(FuncPtg), ptgs[3].GetType());
- Assert.AreEqual("MID", ((FuncPtg)ptgs[3]).Name);
+ ClassicAssert.AreEqual(4, ptgs.Length);
+ ClassicAssert.AreEqual(typeof(FuncPtg), ptgs[3].GetType());
+ ClassicAssert.AreEqual("MID", ((FuncPtg)ptgs[3]).Name);
assertRefPtgA1('V', ptgs, 0);
}
@@ -564,21 +564,21 @@ public void Test55747_55324()
// Check our cached values were correctly evaluated
cell = row.GetCell(CellReference.ConvertColStringToIndex("A")) as HSSFCell;
- Assert.AreEqual("abc", cell.StringCellValue);
+ ClassicAssert.AreEqual("abc", cell.StringCellValue);
cell = row.GetCell(CellReference.ConvertColStringToIndex("B")) as HSSFCell;
- Assert.AreEqual("ab", cell.StringCellValue);
+ ClassicAssert.AreEqual("ab", cell.StringCellValue);
cell = row.GetCell(CellReference.ConvertColStringToIndex("C")) as HSSFCell;
- Assert.AreEqual("A", cell.StringCellValue);
+ ClassicAssert.AreEqual("A", cell.StringCellValue);
cell = row.GetCell(CellReference.ConvertColStringToIndex("D")) as HSSFCell;
- Assert.AreEqual("ab", cell.StringCellValue);
+ ClassicAssert.AreEqual("ab", cell.StringCellValue);
cell = row.GetCell(CellReference.ConvertColStringToIndex("E")) as HSSFCell;
- Assert.AreEqual("X", cell.StringCellValue);
+ ClassicAssert.AreEqual("X", cell.StringCellValue);
cell = row.GetCell(CellReference.ConvertColStringToIndex("F")) as HSSFCell;
- Assert.AreEqual("bc", cell.StringCellValue);
+ ClassicAssert.AreEqual("bc", cell.StringCellValue);
cell = row.GetCell(CellReference.ConvertColStringToIndex("G")) as HSSFCell;
- Assert.AreEqual("ab", cell.StringCellValue);
+ ClassicAssert.AreEqual("ab", cell.StringCellValue);
cell = row.GetCell(CellReference.ConvertColStringToIndex("H")) as HSSFCell;
- Assert.AreEqual("A", cell.StringCellValue);
+ ClassicAssert.AreEqual("A", cell.StringCellValue);
// Enable this to write out + check in Excel
if (OUTPUT_TEST_FILES)
@@ -590,8 +590,8 @@ public void Test55747_55324()
}
private Ptg[] getPtgs(HSSFCell cell)
{
- Assert.AreEqual(CellType.Formula, cell.CellType);
- Assert.AreEqual(typeof(FormulaRecordAggregate), cell.CellValueRecord.GetType());
+ ClassicAssert.AreEqual(CellType.Formula, cell.CellType);
+ ClassicAssert.AreEqual(typeof(FormulaRecordAggregate), cell.CellValueRecord.GetType());
FormulaRecordAggregate agg = (FormulaRecordAggregate)cell.CellValueRecord;
FormulaRecord rec = agg.FormulaRecord;
return rec.ParsedExpression;
@@ -599,10 +599,10 @@ private Ptg[] getPtgs(HSSFCell cell)
private void assertRefPtgA1(char rv, Ptg[] ptgs, int at)
{
Ptg ptg = ptgs[at];
- Assert.AreEqual(typeof(RefPtg), ptg.GetType());
- Assert.AreEqual(0, ((RefPtg)ptg).Row);
- Assert.AreEqual(0, ((RefPtg)ptg).Column);
- Assert.AreEqual(rv, ((RefPtg)ptg).RVAType);
+ ClassicAssert.AreEqual(typeof(RefPtg), ptg.GetType());
+ ClassicAssert.AreEqual(0, ((RefPtg)ptg).Row);
+ ClassicAssert.AreEqual(0, ((RefPtg)ptg).Column);
+ ClassicAssert.AreEqual(rv, ((RefPtg)ptg).RVAType);
}
}
diff --git a/testcases/main/HSSF/UserModel/TestFormulaEvaluatorDocs.cs b/testcases/main/HSSF/UserModel/TestFormulaEvaluatorDocs.cs
index 079716ced..864a8c8cb 100644
--- a/testcases/main/HSSF/UserModel/TestFormulaEvaluatorDocs.cs
+++ b/testcases/main/HSSF/UserModel/TestFormulaEvaluatorDocs.cs
@@ -20,7 +20,7 @@ namespace TestCases.HSSF.UserModel
using System;
using System.Collections;
using NPOI.HSSF.UserModel;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.SS.UserModel;
/**
@@ -65,9 +65,9 @@ public void TestEvaluateAll()
s2r1c1.CellFormula = ("S1!A1");
// Not Evaluated yet
- Assert.AreEqual(0.0, s1r1c3.NumericCellValue, 0);
- Assert.AreEqual(0.0, s1r2c3.NumericCellValue, 0);
- Assert.AreEqual(0.0, s2r1c1.NumericCellValue, 0);
+ ClassicAssert.AreEqual(0.0, s1r1c3.NumericCellValue, 0);
+ ClassicAssert.AreEqual(0.0, s1r2c3.NumericCellValue, 0);
+ ClassicAssert.AreEqual(0.0, s2r1c1.NumericCellValue, 0);
// Do a full Evaluate, as per our docs
// uses EvaluateFormulaCell()
@@ -88,24 +88,24 @@ public void TestEvaluateAll()
evaluator.EvaluateFormulaCell(c);
// For Testing - all should be numeric
- Assert.AreEqual(CellType.Numeric, evaluator.EvaluateFormulaCell(c));
+ ClassicAssert.AreEqual(CellType.Numeric, evaluator.EvaluateFormulaCell(c));
}
}
}
}
// Check now as expected
- Assert.AreEqual(55.7, wb.GetSheetAt(0).GetRow(0).GetCell(2).NumericCellValue, 0);
- Assert.AreEqual("SUM(A1:B1)", wb.GetSheetAt(0).GetRow(0).GetCell(2).CellFormula);
- Assert.AreEqual(CellType.Formula, wb.GetSheetAt(0).GetRow(0).GetCell(2).CellType);
+ ClassicAssert.AreEqual(55.7, wb.GetSheetAt(0).GetRow(0).GetCell(2).NumericCellValue, 0);
+ ClassicAssert.AreEqual("SUM(A1:B1)", wb.GetSheetAt(0).GetRow(0).GetCell(2).CellFormula);
+ ClassicAssert.AreEqual(CellType.Formula, wb.GetSheetAt(0).GetRow(0).GetCell(2).CellType);
- Assert.AreEqual(-4.6, wb.GetSheetAt(0).GetRow(1).GetCell(2).NumericCellValue, 0);
- Assert.AreEqual("SUM(A2:B2)", wb.GetSheetAt(0).GetRow(1).GetCell(2).CellFormula);
- Assert.AreEqual(CellType.Formula, wb.GetSheetAt(0).GetRow(1).GetCell(2).CellType);
+ ClassicAssert.AreEqual(-4.6, wb.GetSheetAt(0).GetRow(1).GetCell(2).NumericCellValue, 0);
+ ClassicAssert.AreEqual("SUM(A2:B2)", wb.GetSheetAt(0).GetRow(1).GetCell(2).CellFormula);
+ ClassicAssert.AreEqual(CellType.Formula, wb.GetSheetAt(0).GetRow(1).GetCell(2).CellType);
- Assert.AreEqual(22.3, wb.GetSheetAt(1).GetRow(0).GetCell(0).NumericCellValue, 0);
- Assert.AreEqual("'S1'!A1", wb.GetSheetAt(1).GetRow(0).GetCell(0).CellFormula);
- Assert.AreEqual(CellType.Formula, wb.GetSheetAt(1).GetRow(0).GetCell(0).CellType);
+ ClassicAssert.AreEqual(22.3, wb.GetSheetAt(1).GetRow(0).GetCell(0).NumericCellValue, 0);
+ ClassicAssert.AreEqual("'S1'!A1", wb.GetSheetAt(1).GetRow(0).GetCell(0).CellFormula);
+ ClassicAssert.AreEqual(CellType.Formula, wb.GetSheetAt(1).GetRow(0).GetCell(0).CellType);
// Now do the alternate call, which zaps the formulas
@@ -126,14 +126,14 @@ public void TestEvaluateAll()
}
}
- Assert.AreEqual(55.7, wb.GetSheetAt(0).GetRow(0).GetCell(2).NumericCellValue, 0);
- Assert.AreEqual(CellType.Numeric, wb.GetSheetAt(0).GetRow(0).GetCell(2).CellType);
+ ClassicAssert.AreEqual(55.7, wb.GetSheetAt(0).GetRow(0).GetCell(2).NumericCellValue, 0);
+ ClassicAssert.AreEqual(CellType.Numeric, wb.GetSheetAt(0).GetRow(0).GetCell(2).CellType);
- Assert.AreEqual(-4.6, wb.GetSheetAt(0).GetRow(1).GetCell(2).NumericCellValue, 0);
- Assert.AreEqual(CellType.Numeric, wb.GetSheetAt(0).GetRow(1).GetCell(2).CellType);
+ ClassicAssert.AreEqual(-4.6, wb.GetSheetAt(0).GetRow(1).GetCell(2).NumericCellValue, 0);
+ ClassicAssert.AreEqual(CellType.Numeric, wb.GetSheetAt(0).GetRow(1).GetCell(2).CellType);
- Assert.AreEqual(22.3, wb.GetSheetAt(1).GetRow(0).GetCell(0).NumericCellValue, 0);
- Assert.AreEqual(CellType.Numeric, wb.GetSheetAt(1).GetRow(0).GetCell(0).CellType);
+ ClassicAssert.AreEqual(22.3, wb.GetSheetAt(1).GetRow(0).GetCell(0).NumericCellValue, 0);
+ ClassicAssert.AreEqual(CellType.Numeric, wb.GetSheetAt(1).GetRow(0).GetCell(0).CellType);
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/UserModel/TestFormulas.cs b/testcases/main/HSSF/UserModel/TestFormulas.cs
index 1308c5b67..17f89f1b7 100644
--- a/testcases/main/HSSF/UserModel/TestFormulas.cs
+++ b/testcases/main/HSSF/UserModel/TestFormulas.cs
@@ -24,7 +24,7 @@ namespace TestCases.HSSF.UserModel
using NPOI.SS.Util;
using NPOI.Util;
using NPOI.HSSF.UserModel;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.SS.UserModel;
using NPOI.SS.Formula.PTG;
using NPOI.HSSF.Model;
@@ -67,7 +67,7 @@ public void TestBasicAddIntegers()
r = s.GetRow(1);
c = r.GetCell(1);
- Assert.IsTrue("1+1".Equals(c.CellFormula), "Formula is as expected");
+ ClassicAssert.IsTrue("1+1".Equals(c.CellFormula), "Formula is as expected");
}
/**
@@ -227,9 +227,9 @@ private static void floatVerify(String operator1, HSSFWorkbook wb)
{
ICell c = r.GetCell(y);
- Assert.IsTrue(c.CellFormula != null, "got a formula");
+ ClassicAssert.IsTrue(c.CellFormula != null, "got a formula");
- Assert.IsTrue(
+ ClassicAssert.IsTrue(
("" + x + "." + y + operator1 + y + "." + x).Equals(c.CellFormula),
"loop Formula is as expected " + x + "." + y + operator1 + y + "." + x + "!=" + c.CellFormula);
}
@@ -344,7 +344,7 @@ private static void OperationalRefVerify(String operator1, HSSFWorkbook wb)
r = s.GetRow(0);
c = r.GetCell(1);
//get our minimum values
- Assert.IsTrue(("A2" + operator1 + "A3").Equals(c.CellFormula), "minval Formula is as expected A2" + operator1 + "A3 != " + c.CellFormula);
+ ClassicAssert.IsTrue(("A2" + operator1 + "A3").Equals(c.CellFormula), "minval Formula is as expected A2" + operator1 + "A3 != " + c.CellFormula);
for (int x = 1; x < short.MaxValue && x > 0; x = (short)(x * 2))
@@ -388,7 +388,7 @@ private static void OperationalRefVerify(String operator1, HSSFWorkbook wb)
String ref2 = cr.FormatAsString();
- Assert.IsTrue((
+ ClassicAssert.IsTrue((
("" + ref1 + operator1 + ref2).Equals(c.CellFormula)
), "loop Formula is as expected " + ref1 + operator1 + ref2 + "!=" + c.CellFormula
);
@@ -399,7 +399,7 @@ private static void OperationalRefVerify(String operator1, HSSFWorkbook wb)
r = s.GetRow(0);
c = r.GetCell(0);
- Assert.AreEqual("B1" + operator1 + "IV255", c.CellFormula);
+ ClassicAssert.AreEqual("B1" + operator1 + "IV255", c.CellFormula);
}
@@ -425,7 +425,7 @@ private static void OrderTest(String formula)
//get our minimum values
r = s.GetRow(0);
c = r.GetCell(1);
- Assert.IsTrue(formula.Equals(c.CellFormula), "minval Formula is as expected"
+ ClassicAssert.IsTrue(formula.Equals(c.CellFormula), "minval Formula is as expected"
);
}
@@ -483,7 +483,7 @@ private static void BinomialVerify(String operator1, HSSFWorkbook wb)
//get our minimum values
r = s.GetRow(0);
c = r.GetCell(1);
- Assert.IsTrue(("1" + operator1 + "1").Equals(c.CellFormula),
+ ClassicAssert.IsTrue(("1" + operator1 + "1").Equals(c.CellFormula),
"minval Formula is as expected 1" + operator1 + "1 != " + c.CellFormula);
for (int x = 1; x < short.MaxValue && x > 0; x = (short)(x * 2))
@@ -495,7 +495,7 @@ private static void BinomialVerify(String operator1, HSSFWorkbook wb)
c = r.GetCell(y);
- Assert.IsTrue(("" + x + operator1 + y).Equals(c.CellFormula),
+ ClassicAssert.IsTrue(("" + x + operator1 + y).Equals(c.CellFormula),
"loop Formula is as expected " + x + operator1 + y + "!=" + c.CellFormula
);
}
@@ -505,7 +505,7 @@ private static void BinomialVerify(String operator1, HSSFWorkbook wb)
r = s.GetRow(0);
c = r.GetCell(0);
- Assert.IsTrue(
+ ClassicAssert.IsTrue(
("" + short.MaxValue + operator1 + short.MaxValue).Equals(c.CellFormula), "maxval Formula is as expected"
);
@@ -533,7 +533,7 @@ public static void AreaFunctionTest(String function)
r = s.GetRow(0);
c = r.GetCell(0);
- Assert.IsTrue((function + "(A2:A3)").Equals((function + "(A2:A3)")), "function =" + function + "(A2:A3)"
+ ClassicAssert.IsTrue((function + "(A2:A3)").Equals((function + "(A2:A3)")), "function =" + function + "(A2:A3)"
);
}
@@ -560,7 +560,7 @@ public void RefArrayFunctionTest(String function)
r = s.GetRow(0);
c = r.GetCell(0);
- Assert.IsTrue((function + "(A2,A3)").Equals(c.CellFormula), "function =" + function + "(A2,A3)"
+ ClassicAssert.IsTrue((function + "(A2,A3)").Equals(c.CellFormula), "function =" + function + "(A2,A3)"
);
}
@@ -590,12 +590,12 @@ public void RefAreaArrayFunctionTest(String function)
r = s.GetRow(0);
c = r.GetCell(0);
- Assert.IsTrue(
+ ClassicAssert.IsTrue(
(function + "(A2:A4,B2:B4)").Equals(c.CellFormula), "function =" + function + "(A2:A4,B2:B4)"
);
c = r.GetCell(1);
- Assert.IsTrue((function + "($A$2:$A4,B$2:B4)").Equals(c.CellFormula),
+ ClassicAssert.IsTrue((function + "($A$2:$A4,B$2:B4)").Equals(c.CellFormula),
"function =" + function + "($A$2:$A4,B$2:B4)"
);
}
@@ -625,15 +625,15 @@ public void TestAbsRefs()
s = wb.GetSheetAt(0);
r = s.GetRow(0);
c = r.GetCell(0);
- Assert.IsTrue(("A3+A2").Equals(c.CellFormula), "A3+A2");
+ ClassicAssert.IsTrue(("A3+A2").Equals(c.CellFormula), "A3+A2");
c = r.GetCell(1);
- Assert.IsTrue(("$A3+$A2").Equals(c.CellFormula), "$A3+$A2");
+ ClassicAssert.IsTrue(("$A3+$A2").Equals(c.CellFormula), "$A3+$A2");
c = r.GetCell(2);
- Assert.IsTrue(("A$3+A$2").Equals(c.CellFormula), "A$3+A$2");
+ ClassicAssert.IsTrue(("A$3+A$2").Equals(c.CellFormula), "A$3+A$2");
c = r.GetCell(3);
- Assert.IsTrue(("$A$3+$A$2").Equals(c.CellFormula), "$A$3+$A$2");
+ ClassicAssert.IsTrue(("$A$3+$A$2").Equals(c.CellFormula), "$A$3+$A$2");
c = r.GetCell(4);
- Assert.IsTrue(("SUM($A$3,$A$2)").Equals(c.CellFormula), "SUM($A$3,$A$2)");
+ ClassicAssert.IsTrue(("SUM($A$3,$A$2)").Equals(c.CellFormula), "SUM($A$3,$A$2)");
}
[Test]
public void TestSheetFunctions()
@@ -657,9 +657,9 @@ public void TestSheetFunctions()
s = wb.GetSheet("B");
r = s.GetRow(0);
c = r.GetCell(0);
- Assert.IsTrue(("AVERAGE(A!A1:B1)").Equals(c.CellFormula), "expected: AVERAGE(A!A1:B1) got: " + c.CellFormula);
+ ClassicAssert.IsTrue(("AVERAGE(A!A1:B1)").Equals(c.CellFormula), "expected: AVERAGE(A!A1:B1) got: " + c.CellFormula);
c = r.GetCell(1);
- Assert.IsTrue(("A!A1+A!B1").Equals(c.CellFormula), "expected: A!A1+A!B1 got: " + c.CellFormula);
+ ClassicAssert.IsTrue(("A!A1+A!B1").Equals(c.CellFormula), "expected: A!A1+A!B1 got: " + c.CellFormula);
}
[Test]
public void TestRVAoperands()
@@ -699,7 +699,7 @@ public void TestRVAoperands()
wb.Write(out1);
out1.Close();
- Assert.IsTrue(File.Exists(tmpfile), "file exists");
+ ClassicAssert.IsTrue(File.Exists(tmpfile), "file exists");
}
[Test]
public void TestStringFormulas()
@@ -719,7 +719,7 @@ public void TestStringFormulas()
s = wb.GetSheetAt(0);
r = s.GetRow(0);
c = r.GetCell(0);
- Assert.AreEqual("UPPER(\"xyz\")", c.CellFormula);
+ ClassicAssert.AreEqual("UPPER(\"xyz\")", c.CellFormula);
}
[Test]
public void TestLogicalFormulas()
@@ -736,7 +736,7 @@ public void TestLogicalFormulas()
s = wb.GetSheetAt(0);
r = s.GetRow(0);
c = r.GetCell(1);
- Assert.AreEqual("IF(A1= BuiltinFormats.FIRST_USER_DEFINED_FORMAT_INDEX);
- Assert.AreEqual("\u00a3##.00[Yellow]", dataFormat.GetFormat(customFmtIdx));
+ ClassicAssert.IsTrue(customFmtIdx >= BuiltinFormats.FIRST_USER_DEFINED_FORMAT_INDEX);
+ ClassicAssert.AreEqual("\u00a3##.00[Yellow]", dataFormat.GetFormat(customFmtIdx));
wb.Close();
}
diff --git a/testcases/main/HSSF/UserModel/TestHSSFDataFormatter.cs b/testcases/main/HSSF/UserModel/TestHSSFDataFormatter.cs
index f38d5995b..f7083ddf8 100644
--- a/testcases/main/HSSF/UserModel/TestHSSFDataFormatter.cs
+++ b/testcases/main/HSSF/UserModel/TestHSSFDataFormatter.cs
@@ -22,7 +22,7 @@ namespace TestCases.HSSF.UserModel
using NPOI.HSSF;
using NPOI.SS.UserModel;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using System.Collections;
using TestCases.HSSF;
using NPOI.SS.Util;
@@ -246,8 +246,8 @@ public void TestGetFormattedCellValueHSSFCell()
String fmtval = formatter.FormatCellValue(cell);
// should not be equal to "555.555"
- Assert.IsTrue(DateUtil.IsCellDateFormatted(cell));
- Assert.IsTrue(!"555.555".Equals(fmtval));
+ ClassicAssert.IsTrue(DateUtil.IsCellDateFormatted(cell));
+ ClassicAssert.IsTrue(!"555.555".Equals(fmtval));
String fmt = cell.CellStyle.GetDataFormatString();
@@ -262,7 +262,7 @@ public void TestGetFormattedCellValueHSSFCell()
}
log(fmt+"\t\t\t"+fmtval + "\t\t\t" + jul);
// check we found july properly
- Assert.IsTrue(fmtval.IndexOf(jul) > -1, "Format came out incorrect - " + fmt);
+ ClassicAssert.IsTrue(fmtval.IndexOf(jul) > -1, "Format came out incorrect - " + fmt);
}
row = wb.GetSheetAt(0).GetRow(1);
@@ -276,11 +276,11 @@ public void TestGetFormattedCellValueHSSFCell()
log(fmtval);
// should not be equal to "555.47431"
- Assert.IsTrue(DateUtil.IsCellDateFormatted(cell));
- Assert.IsTrue(!"555.47431".Equals(fmtval));
+ ClassicAssert.IsTrue(DateUtil.IsCellDateFormatted(cell));
+ ClassicAssert.IsTrue(!"555.47431".Equals(fmtval));
// check we found the time properly
- Assert.IsTrue(fmtval.IndexOf("11:23") > -1,
+ ClassicAssert.IsTrue(fmtval.IndexOf("11:23") > -1,
"Format came out incorrect - " + fmt + ": " + fmtval + ", but expected to find '11:23'");
}
@@ -295,7 +295,7 @@ public void TestGetFormattedCellValueHSSFCell()
log(formatted);
// should not include "12345678" - note that the input value was negative
- Assert.IsTrue(formatted != null && !formatted.Contains("12345678"));
+ ClassicAssert.IsTrue(formatted != null && !formatted.Contains("12345678"));
}
// Test bad number formats
@@ -308,7 +308,7 @@ public void TestGetFormattedCellValueHSSFCell()
log(formatter.FormatCellValue(cell));
// in some locales the the decimal delimiter is a comma, not a dot
string decimalSeparator = System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator;
- Assert.AreEqual("12345678" + decimalSeparator + "9", formatter.FormatCellValue(cell));
+ ClassicAssert.AreEqual("12345678" + decimalSeparator + "9", formatter.FormatCellValue(cell));
}
// Test Zip+4 format
@@ -316,27 +316,27 @@ public void TestGetFormattedCellValueHSSFCell()
ICell cell1 = row.GetCell(0);
log("\n==== ZIP FORMAT ====");
log(formatter.FormatCellValue(cell1));
- Assert.AreEqual("12345-6789", formatter.FormatCellValue(cell1));
+ ClassicAssert.AreEqual("12345-6789", formatter.FormatCellValue(cell1));
// Test phone number format
row = wb.GetSheetAt(0).GetRow(5);
cell1 = row.GetCell(0);
log("\n==== PHONE FORMAT ====");
log(formatter.FormatCellValue(cell1));
- Assert.AreEqual("(555) 123-4567", formatter.FormatCellValue(cell1));
+ ClassicAssert.AreEqual("(555) 123-4567", formatter.FormatCellValue(cell1));
// Test SSN format
row = wb.GetSheetAt(0).GetRow(6);
cell1 = row.GetCell(0);
log("\n==== SSN FORMAT ====");
log(formatter.FormatCellValue(cell1));
- Assert.AreEqual("444-55-1234", formatter.FormatCellValue(cell1));
+ ClassicAssert.AreEqual("444-55-1234", formatter.FormatCellValue(cell1));
// null Test-- null cell should result in empty String
- Assert.AreEqual(formatter.FormatCellValue(null), "");
+ ClassicAssert.AreEqual(formatter.FormatCellValue(null), "");
// null Test-- null cell should result in empty String
- Assert.AreEqual(formatter.FormatCellValue(null), "");
+ ClassicAssert.AreEqual(formatter.FormatCellValue(null), "");
}
[Test]
public void TestGetFormattedCellValueHSSFCellHSSFFormulaEvaluator()
@@ -348,13 +348,13 @@ public void TestGetFormattedCellValueHSSFCellHSSFFormulaEvaluator()
// first without a formula Evaluator
log(formatter.FormatCellValue(cell) + "\t (without Evaluator)");
- Assert.AreEqual("SUM(12.25,12.25)/100", formatter.FormatCellValue(cell));
+ ClassicAssert.AreEqual("SUM(12.25,12.25)/100", formatter.FormatCellValue(cell));
// now with a formula Evaluator
HSSFFormulaEvaluator Evaluator = new HSSFFormulaEvaluator(wb);
log(formatter.FormatCellValue(cell, Evaluator) + "\t\t\t (with Evaluator)");
string decimalSeparator = System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator;
- Assert.AreEqual(formatter.FormatCellValue(cell, Evaluator), "24" + decimalSeparator + "50%");
+ ClassicAssert.AreEqual(formatter.FormatCellValue(cell, Evaluator), "24" + decimalSeparator + "50%");
}
@@ -375,8 +375,8 @@ public void TestSetDefaultNumberFormat()
{
cell.SetCellValue(cell.NumericCellValue * rand.Next() / 1000000 - 1000);
log(formatter.FormatCellValue(cell));
- Assert.IsTrue(formatter.FormatCellValue(cell).StartsWith("Balance "));
- Assert.IsTrue(formatter.FormatCellValue(cell).EndsWith(" USD"));
+ ClassicAssert.IsTrue(formatter.FormatCellValue(cell).StartsWith("Balance "));
+ ClassicAssert.IsTrue(formatter.FormatCellValue(cell).EndsWith(" USD"));
}
}
@@ -391,13 +391,13 @@ public void TestGeneralAtFormat()
IRow row = sheet.GetRow(0);
ICell cellA1 = row.GetCell(0);
- Assert.AreEqual(CellType.Numeric, cellA1.CellType);
- Assert.AreEqual(2345.0, cellA1.NumericCellValue, 0.0001);
- Assert.AreEqual("@", cellA1.CellStyle.GetDataFormatString());
+ ClassicAssert.AreEqual(CellType.Numeric, cellA1.CellType);
+ ClassicAssert.AreEqual(2345.0, cellA1.NumericCellValue, 0.0001);
+ ClassicAssert.AreEqual("@", cellA1.CellStyle.GetDataFormatString());
HSSFDataFormatter f = new HSSFDataFormatter();
- Assert.AreEqual("2345", f.FormatCellValue(cellA1));
+ ClassicAssert.AreEqual("2345", f.FormatCellValue(cellA1));
}
/**
@@ -412,51 +412,51 @@ public void TestFromFile()
HSSFDataFormatter f = new HSSFDataFormatter();
// This one is one of the nasty auto-locale changing ones...
- Assert.AreEqual("dd/mm/yyyy", sheet.GetRow(1).GetCell(0).StringCellValue);
- Assert.AreEqual("m/d/yy", sheet.GetRow(1).GetCell(1).CellStyle.GetDataFormatString());
- Assert.AreEqual("11/24/06", f.FormatCellValue(sheet.GetRow(1).GetCell(1)));
+ ClassicAssert.AreEqual("dd/mm/yyyy", sheet.GetRow(1).GetCell(0).StringCellValue);
+ ClassicAssert.AreEqual("m/d/yy", sheet.GetRow(1).GetCell(1).CellStyle.GetDataFormatString());
+ ClassicAssert.AreEqual("11/24/06", f.FormatCellValue(sheet.GetRow(1).GetCell(1)));
- Assert.AreEqual("yyyy/mm/dd", sheet.GetRow(2).GetCell(0).StringCellValue);
- Assert.AreEqual("yyyy/mm/dd", sheet.GetRow(2).GetCell(1).CellStyle.GetDataFormatString());
- Assert.AreEqual("2006/11/24", f.FormatCellValue(sheet.GetRow(2).GetCell(1)));
+ ClassicAssert.AreEqual("yyyy/mm/dd", sheet.GetRow(2).GetCell(0).StringCellValue);
+ ClassicAssert.AreEqual("yyyy/mm/dd", sheet.GetRow(2).GetCell(1).CellStyle.GetDataFormatString());
+ ClassicAssert.AreEqual("2006/11/24", f.FormatCellValue(sheet.GetRow(2).GetCell(1)));
- Assert.AreEqual("yyyy-mm-dd", sheet.GetRow(3).GetCell(0).StringCellValue);
- Assert.AreEqual("yyyy\\-mm\\-dd", sheet.GetRow(3).GetCell(1).CellStyle.GetDataFormatString());
- Assert.AreEqual("2006-11-24", f.FormatCellValue(sheet.GetRow(3).GetCell(1)));
+ ClassicAssert.AreEqual("yyyy-mm-dd", sheet.GetRow(3).GetCell(0).StringCellValue);
+ ClassicAssert.AreEqual("yyyy\\-mm\\-dd", sheet.GetRow(3).GetCell(1).CellStyle.GetDataFormatString());
+ ClassicAssert.AreEqual("2006-11-24", f.FormatCellValue(sheet.GetRow(3).GetCell(1)));
- Assert.AreEqual("yy/mm/dd", sheet.GetRow(4).GetCell(0).StringCellValue);
- Assert.AreEqual("yy/mm/dd", sheet.GetRow(4).GetCell(1).CellStyle.GetDataFormatString());
- Assert.AreEqual("06/11/24", f.FormatCellValue(sheet.GetRow(4).GetCell(1)));
+ ClassicAssert.AreEqual("yy/mm/dd", sheet.GetRow(4).GetCell(0).StringCellValue);
+ ClassicAssert.AreEqual("yy/mm/dd", sheet.GetRow(4).GetCell(1).CellStyle.GetDataFormatString());
+ ClassicAssert.AreEqual("06/11/24", f.FormatCellValue(sheet.GetRow(4).GetCell(1)));
// Another builtin fun one
- Assert.AreEqual("dd/mm/yy", sheet.GetRow(5).GetCell(0).StringCellValue);
- Assert.AreEqual("d/m/yy;@", sheet.GetRow(5).GetCell(1).CellStyle.GetDataFormatString());
- Assert.AreEqual("24/11/06", f.FormatCellValue(sheet.GetRow(5).GetCell(1)));
+ ClassicAssert.AreEqual("dd/mm/yy", sheet.GetRow(5).GetCell(0).StringCellValue);
+ ClassicAssert.AreEqual("d/m/yy;@", sheet.GetRow(5).GetCell(1).CellStyle.GetDataFormatString());
+ ClassicAssert.AreEqual("24/11/06", f.FormatCellValue(sheet.GetRow(5).GetCell(1)));
- Assert.AreEqual("dd-mm-yy", sheet.GetRow(6).GetCell(0).StringCellValue);
- Assert.AreEqual("dd\\-mm\\-yy", sheet.GetRow(6).GetCell(1).CellStyle.GetDataFormatString());
- Assert.AreEqual("24-11-06", f.FormatCellValue(sheet.GetRow(6).GetCell(1)));
+ ClassicAssert.AreEqual("dd-mm-yy", sheet.GetRow(6).GetCell(0).StringCellValue);
+ ClassicAssert.AreEqual("dd\\-mm\\-yy", sheet.GetRow(6).GetCell(1).CellStyle.GetDataFormatString());
+ ClassicAssert.AreEqual("24-11-06", f.FormatCellValue(sheet.GetRow(6).GetCell(1)));
// Another builtin fun one
- Assert.AreEqual("nn.nn", sheet.GetRow(9).GetCell(0).StringCellValue);
- Assert.AreEqual("General", sheet.GetRow(9).GetCell(1).CellStyle.GetDataFormatString());
- Assert.AreEqual("10.52", f.FormatCellValue(sheet.GetRow(9).GetCell(1)));
+ ClassicAssert.AreEqual("nn.nn", sheet.GetRow(9).GetCell(0).StringCellValue);
+ ClassicAssert.AreEqual("General", sheet.GetRow(9).GetCell(1).CellStyle.GetDataFormatString());
+ ClassicAssert.AreEqual("10.52", f.FormatCellValue(sheet.GetRow(9).GetCell(1)));
// text isn't quite the format rule...
- Assert.AreEqual("nn.nnn", sheet.GetRow(10).GetCell(0).StringCellValue);
- Assert.AreEqual("0.000", sheet.GetRow(10).GetCell(1).CellStyle.GetDataFormatString());
- Assert.AreEqual("10.520", f.FormatCellValue(sheet.GetRow(10).GetCell(1)));
+ ClassicAssert.AreEqual("nn.nnn", sheet.GetRow(10).GetCell(0).StringCellValue);
+ ClassicAssert.AreEqual("0.000", sheet.GetRow(10).GetCell(1).CellStyle.GetDataFormatString());
+ ClassicAssert.AreEqual("10.520", f.FormatCellValue(sheet.GetRow(10).GetCell(1)));
// text isn't quite the format rule...
- Assert.AreEqual("nn.n", sheet.GetRow(11).GetCell(0).StringCellValue);
- Assert.AreEqual("0.0", sheet.GetRow(11).GetCell(1).CellStyle.GetDataFormatString());
- Assert.AreEqual("10.5", f.FormatCellValue(sheet.GetRow(11).GetCell(1)));
+ ClassicAssert.AreEqual("nn.n", sheet.GetRow(11).GetCell(0).StringCellValue);
+ ClassicAssert.AreEqual("0.0", sheet.GetRow(11).GetCell(1).CellStyle.GetDataFormatString());
+ ClassicAssert.AreEqual("10.5", f.FormatCellValue(sheet.GetRow(11).GetCell(1)));
// text isn't quite the format rule...
- Assert.AreEqual("\u00a3nn.nn", sheet.GetRow(12).GetCell(0).StringCellValue);
- Assert.AreEqual("\"\u00a3\"#,##0.00", sheet.GetRow(12).GetCell(1).CellStyle.GetDataFormatString());
- Assert.AreEqual("\u00a310.52", f.FormatCellValue(sheet.GetRow(12).GetCell(1)));
+ ClassicAssert.AreEqual("\u00a3nn.nn", sheet.GetRow(12).GetCell(0).StringCellValue);
+ ClassicAssert.AreEqual("\"\u00a3\"#,##0.00", sheet.GetRow(12).GetCell(1).CellStyle.GetDataFormatString());
+ ClassicAssert.AreEqual("\u00a310.52", f.FormatCellValue(sheet.GetRow(12).GetCell(1)));
}
private static void log(String msg)
diff --git a/testcases/main/HSSF/UserModel/TestHSSFDateUtil.cs b/testcases/main/HSSF/UserModel/TestHSSFDateUtil.cs
index 6fc72a6f2..986bda34a 100644
--- a/testcases/main/HSSF/UserModel/TestHSSFDateUtil.cs
+++ b/testcases/main/HSSF/UserModel/TestHSSFDateUtil.cs
@@ -22,7 +22,7 @@ namespace TestCases.HSSF.UserModel
using TestCases.HSSF;
using NPOI.HSSF.Model;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.UserModel;
using NPOI.SS.UserModel;
using NPOI.SS.Util;
@@ -63,7 +63,7 @@ public void TestDateConversion()
double excelDate =
DateUtil.GetExcelDate(date, false);
- Assert.AreEqual(date,DateUtil.GetJavaDate(excelDate, false), "Checking hour = " + hour);
+ ClassicAssert.AreEqual(date,DateUtil.GetJavaDate(excelDate, false), "Checking hour = " + hour);
}
// Check 1900 and 1904 date windowing conversions
@@ -77,10 +77,10 @@ public void TestDateConversion()
dateIf1904 = dateIf1904.AddDays(1); // now Jan. 2, 2004
// 1900 windowing
- Assert.AreEqual(dateIf1900,
+ ClassicAssert.AreEqual(dateIf1900,
DateUtil.GetJavaDate(excelDate2, false), "Checking 1900 Date Windowing");
// 1904 windowing
- Assert.AreEqual(
+ ClassicAssert.AreEqual(
dateIf1904,DateUtil.GetJavaDate(excelDate2, true),"Checking 1904 Date Windowing");
}
@@ -108,10 +108,10 @@ public void TestExcelConversionOnDSTStart()
double excelDate = DateUtil.GetExcelDate(javaDate, false);
double difference = excelDate - Math.Floor(excelDate);
int differenceInHours = (int)(difference * 24 * 60 + 0.5) / 60;
- Assert.AreEqual(
+ ClassicAssert.AreEqual(
hour,
differenceInHours, "Checking " + hour + " hour on Daylight Saving Time start date");
- Assert.AreEqual(
+ ClassicAssert.AreEqual(
javaDate,
DateUtil.GetJavaDate(excelDate, false),
"Checking " + hour + " hour on Daylight Saving Time start date");
@@ -142,7 +142,7 @@ public void TestJavaConversionOnDSTStart()
cal.AddHours(hour);
DateTime javaDate = DateUtil.GetJavaDate(excelDate, false);
- Assert.AreEqual(
+ ClassicAssert.AreEqual(
excelDate,
DateUtil.GetExcelDate(javaDate, false),0.001);
}
@@ -164,10 +164,10 @@ public void TestExcelConversionOnDSTEnd()
double excelDate = DateUtil.GetExcelDate(javaDate, false);
double difference = excelDate - Math.Floor(excelDate);
int differenceInHours = (int)(difference * 24 * 60 + 0.5) / 60;
- Assert.AreEqual(
+ ClassicAssert.AreEqual(
hour,
differenceInHours, "Checking " + hour + " hour on Daylight Saving Time end date");
- Assert.AreEqual(
+ ClassicAssert.AreEqual(
javaDate,
DateUtil.GetJavaDate(excelDate, false),
"Checking " + hour + " hour on Daylight Saving Time start date");
@@ -190,7 +190,7 @@ public void TestJavaConversionOnDSTEnd()
{
cal.AddHours( hour);
DateTime javaDate = DateUtil.GetJavaDate(excelDate, false);
- Assert.AreEqual(
+ ClassicAssert.AreEqual(
excelDate,
DateUtil.GetExcelDate(javaDate, false),0.1);
}
@@ -218,7 +218,7 @@ public void TestCalendarConversion()
DateTime javaDate = DateUtil.GetJavaDate(excelDate);
// Should Match despite time-zone
- Assert.AreEqual(expected, javaDate, "Checking timezone " + id);
+ ClassicAssert.AreEqual(expected, javaDate, "Checking timezone " + id);
}
@@ -253,8 +253,8 @@ public void TestIdentifyDateFormats()
for (int i = 0; i < builtins.Length; i++)
{
String formatStr = HSSFDataFormat.GetBuiltinFormat(builtins[i]);
- Assert.IsTrue(DateUtil.IsInternalDateFormat(builtins[i]));
- Assert.IsTrue(DateUtil.IsADateFormat(builtins[i], formatStr));
+ ClassicAssert.IsTrue(DateUtil.IsInternalDateFormat(builtins[i]));
+ ClassicAssert.IsTrue(DateUtil.IsADateFormat(builtins[i], formatStr));
}
// Now try a few built-in non date formats
@@ -262,16 +262,16 @@ public void TestIdentifyDateFormats()
for (int i = 0; i < builtins.Length; i++)
{
String formatStr = HSSFDataFormat.GetBuiltinFormat(builtins[i]);
- Assert.IsFalse(DateUtil.IsInternalDateFormat(builtins[i]));
- Assert.IsFalse(DateUtil.IsADateFormat(builtins[i], formatStr));
+ ClassicAssert.IsFalse(DateUtil.IsInternalDateFormat(builtins[i]));
+ ClassicAssert.IsFalse(DateUtil.IsADateFormat(builtins[i], formatStr));
}
// Now for some non-internal ones
// These come after the real ones
int numBuiltins = HSSFDataFormat.NumberOfBuiltinBuiltinFormats;
- Assert.IsTrue(numBuiltins < 60);
+ ClassicAssert.IsTrue(numBuiltins < 60);
short formatId = 60;
- Assert.IsFalse(DateUtil.IsInternalDateFormat(formatId));
+ ClassicAssert.IsFalse(DateUtil.IsInternalDateFormat(formatId));
// Valid ones first
String[] formats = new String[] {
@@ -302,7 +302,7 @@ public void TestIdentifyDateFormats()
};
for (int i = 0; i < formats.Length; i++)
{
- Assert.IsTrue(
+ ClassicAssert.IsTrue(
DateUtil.IsADateFormat(formatId, formats[i])
,formats[i] + " is a date format"
);
@@ -318,7 +318,7 @@ public void TestIdentifyDateFormats()
};
for (int i = 0; i < formats.Length; i++)
{
- Assert.IsTrue(
+ ClassicAssert.IsTrue(
DateUtil.IsADateFormat(formatId, formats[i]),
formats[i] + " is a datetime format"
);
@@ -334,7 +334,7 @@ public void TestIdentifyDateFormats()
};
for (int i = 0; i < formats.Length; i++)
{
- Assert.IsFalse(
+ ClassicAssert.IsFalse(
DateUtil.IsADateFormat(formatId, formats[i]),
formats[i] + " is not a date or datetime format"
@@ -349,7 +349,7 @@ public void TestIdentifyDateFormats()
};
for (int i = 0; i < formats.Length; i++)
{
- // Assert.IsFalse( DateUtil.IsADateFormat(formatId, formats[i]) );
+ // ClassicAssert.IsFalse( DateUtil.IsADateFormat(formatId, formats[i]) );
}
}
@@ -364,7 +364,7 @@ public void TestOnARealFile()
HSSFWorkbook workbook = HSSFTestDataSamples.OpenSampleWorkbook("DateFormats.xls");
NPOI.SS.UserModel.ISheet sheet = workbook.GetSheetAt(0);
InternalWorkbook wb = workbook.Workbook;
- Assert.IsNotNull(wb);
+ ClassicAssert.IsNotNull(wb);
IRow row;
ICell cell;
@@ -378,43 +378,43 @@ public void TestOnARealFile()
row = sheet.GetRow(0);
cell = row.GetCell(1);
style = cell.CellStyle;
- Assert.AreEqual(aug_10_2007, cell.NumericCellValue, 0.0001);
- Assert.AreEqual("d-mmm-yy", style.GetDataFormatString());
- Assert.IsTrue(DateUtil.IsInternalDateFormat(style.DataFormat));
- Assert.IsTrue(DateUtil.IsADateFormat(style.DataFormat, style.GetDataFormatString()));
- Assert.IsTrue(DateUtil.IsCellDateFormatted(cell));
+ ClassicAssert.AreEqual(aug_10_2007, cell.NumericCellValue, 0.0001);
+ ClassicAssert.AreEqual("d-mmm-yy", style.GetDataFormatString());
+ ClassicAssert.IsTrue(DateUtil.IsInternalDateFormat(style.DataFormat));
+ ClassicAssert.IsTrue(DateUtil.IsADateFormat(style.DataFormat, style.GetDataFormatString()));
+ ClassicAssert.IsTrue(DateUtil.IsCellDateFormatted(cell));
row = sheet.GetRow(1);
cell = row.GetCell(1);
style = cell.CellStyle;
- Assert.AreEqual(aug_10_2007, cell.NumericCellValue, 0.0001);
- Assert.IsFalse(DateUtil.IsInternalDateFormat(cell.CellStyle.DataFormat));
- Assert.IsTrue(DateUtil.IsADateFormat(style.DataFormat, style.GetDataFormatString()));
- Assert.IsTrue(DateUtil.IsCellDateFormatted(cell));
+ ClassicAssert.AreEqual(aug_10_2007, cell.NumericCellValue, 0.0001);
+ ClassicAssert.IsFalse(DateUtil.IsInternalDateFormat(cell.CellStyle.DataFormat));
+ ClassicAssert.IsTrue(DateUtil.IsADateFormat(style.DataFormat, style.GetDataFormatString()));
+ ClassicAssert.IsTrue(DateUtil.IsCellDateFormatted(cell));
row = sheet.GetRow(2);
cell = row.GetCell(1);
style = cell.CellStyle;
- Assert.AreEqual(aug_10_2007, cell.NumericCellValue, 0.0001);
- Assert.IsTrue(DateUtil.IsInternalDateFormat(cell.CellStyle.DataFormat));
- Assert.IsTrue(DateUtil.IsADateFormat(style.DataFormat, style.GetDataFormatString()));
- Assert.IsTrue(DateUtil.IsCellDateFormatted(cell));
+ ClassicAssert.AreEqual(aug_10_2007, cell.NumericCellValue, 0.0001);
+ ClassicAssert.IsTrue(DateUtil.IsInternalDateFormat(cell.CellStyle.DataFormat));
+ ClassicAssert.IsTrue(DateUtil.IsADateFormat(style.DataFormat, style.GetDataFormatString()));
+ ClassicAssert.IsTrue(DateUtil.IsCellDateFormatted(cell));
row = sheet.GetRow(3);
cell = row.GetCell(1);
style = cell.CellStyle;
- Assert.AreEqual(aug_10_2007, cell.NumericCellValue, 0.0001);
- Assert.IsFalse(DateUtil.IsInternalDateFormat(cell.CellStyle.DataFormat));
- Assert.IsTrue(DateUtil.IsADateFormat(style.DataFormat, style.GetDataFormatString()));
- Assert.IsTrue(DateUtil.IsCellDateFormatted(cell));
+ ClassicAssert.AreEqual(aug_10_2007, cell.NumericCellValue, 0.0001);
+ ClassicAssert.IsFalse(DateUtil.IsInternalDateFormat(cell.CellStyle.DataFormat));
+ ClassicAssert.IsTrue(DateUtil.IsADateFormat(style.DataFormat, style.GetDataFormatString()));
+ ClassicAssert.IsTrue(DateUtil.IsCellDateFormatted(cell));
row = sheet.GetRow(4);
cell = row.GetCell(1);
style = cell.CellStyle;
- Assert.AreEqual(aug_10_2007, cell.NumericCellValue, 0.0001);
- Assert.IsFalse(DateUtil.IsInternalDateFormat(cell.CellStyle.DataFormat));
- Assert.IsTrue(DateUtil.IsADateFormat(style.DataFormat, style.GetDataFormatString()));
- Assert.IsTrue(DateUtil.IsCellDateFormatted(cell));
+ ClassicAssert.AreEqual(aug_10_2007, cell.NumericCellValue, 0.0001);
+ ClassicAssert.IsFalse(DateUtil.IsInternalDateFormat(cell.CellStyle.DataFormat));
+ ClassicAssert.IsTrue(DateUtil.IsADateFormat(style.DataFormat, style.GetDataFormatString()));
+ ClassicAssert.IsTrue(DateUtil.IsCellDateFormatted(cell));
}
[Test]
@@ -422,48 +422,48 @@ public void ExcelDateBorderCases()
{
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
- Assert.AreEqual(1.0, DateUtil.GetExcelDate(df.Parse("1900-01-01")), 0.00001);
- Assert.AreEqual(31.0, DateUtil.GetExcelDate(df.Parse("1900-01-31")), 0.00001);
- Assert.AreEqual(32.0, DateUtil.GetExcelDate(df.Parse("1900-02-01")), 0.00001);
- Assert.AreEqual(/* BAD_DATE! */ -1.0, DateUtil.GetExcelDate(df.Parse("1899-12-31")), 0.00001);
+ ClassicAssert.AreEqual(1.0, DateUtil.GetExcelDate(df.Parse("1900-01-01")), 0.00001);
+ ClassicAssert.AreEqual(31.0, DateUtil.GetExcelDate(df.Parse("1900-01-31")), 0.00001);
+ ClassicAssert.AreEqual(32.0, DateUtil.GetExcelDate(df.Parse("1900-02-01")), 0.00001);
+ ClassicAssert.AreEqual(/* BAD_DATE! */ -1.0, DateUtil.GetExcelDate(df.Parse("1899-12-31")), 0.00001);
}
[Test]
public void TestDateBug_2Excel()
{
- Assert.AreEqual(59.0, DateUtil.GetExcelDate(new DateTime(1900, CALENDAR_FEBRUARY, 28), false), 1);
- Assert.AreEqual(61.0, DateUtil.GetExcelDate(new DateTime(1900, CALENDAR_MARCH, 1), false), 1);
+ ClassicAssert.AreEqual(59.0, DateUtil.GetExcelDate(new DateTime(1900, CALENDAR_FEBRUARY, 28), false), 1);
+ ClassicAssert.AreEqual(61.0, DateUtil.GetExcelDate(new DateTime(1900, CALENDAR_MARCH, 1), false), 1);
- Assert.AreEqual(37315.00, DateUtil.GetExcelDate(new DateTime(2002, CALENDAR_FEBRUARY, 28), false), 1);
- Assert.AreEqual(37316.00, DateUtil.GetExcelDate(new DateTime(2002, CALENDAR_MARCH, 1), false), 1);
- Assert.AreEqual(37257.00, DateUtil.GetExcelDate(new DateTime(2002, CALENDAR_JANUARY, 1), false), 1);
- Assert.AreEqual(38074.00, DateUtil.GetExcelDate(new DateTime(2004, CALENDAR_MARCH, 28), false), 1);
+ ClassicAssert.AreEqual(37315.00, DateUtil.GetExcelDate(new DateTime(2002, CALENDAR_FEBRUARY, 28), false), 1);
+ ClassicAssert.AreEqual(37316.00, DateUtil.GetExcelDate(new DateTime(2002, CALENDAR_MARCH, 1), false), 1);
+ ClassicAssert.AreEqual(37257.00, DateUtil.GetExcelDate(new DateTime(2002, CALENDAR_JANUARY, 1), false), 1);
+ ClassicAssert.AreEqual(38074.00, DateUtil.GetExcelDate(new DateTime(2004, CALENDAR_MARCH, 28), false), 1);
}
[Test]
public void TestDateBug_2Java()
{
- Assert.AreEqual(new DateTime(1900, CALENDAR_FEBRUARY, 28), DateUtil.GetJavaDate(59.0, false));
- Assert.AreEqual(new DateTime(1900, CALENDAR_MARCH, 1), DateUtil.GetJavaDate(61.0, false));
+ ClassicAssert.AreEqual(new DateTime(1900, CALENDAR_FEBRUARY, 28), DateUtil.GetJavaDate(59.0, false));
+ ClassicAssert.AreEqual(new DateTime(1900, CALENDAR_MARCH, 1), DateUtil.GetJavaDate(61.0, false));
- Assert.AreEqual(new DateTime(2002, CALENDAR_FEBRUARY, 28), DateUtil.GetJavaDate(37315.00, false));
- Assert.AreEqual(new DateTime(2002, CALENDAR_MARCH, 1), DateUtil.GetJavaDate(37316.00, false));
- Assert.AreEqual(new DateTime(2002, CALENDAR_JANUARY, 1), DateUtil.GetJavaDate(37257.00, false));
- Assert.AreEqual(new DateTime(2004, CALENDAR_MARCH, 28), DateUtil.GetJavaDate(38074.00, false));
+ ClassicAssert.AreEqual(new DateTime(2002, CALENDAR_FEBRUARY, 28), DateUtil.GetJavaDate(37315.00, false));
+ ClassicAssert.AreEqual(new DateTime(2002, CALENDAR_MARCH, 1), DateUtil.GetJavaDate(37316.00, false));
+ ClassicAssert.AreEqual(new DateTime(2002, CALENDAR_JANUARY, 1), DateUtil.GetJavaDate(37257.00, false));
+ ClassicAssert.AreEqual(new DateTime(2004, CALENDAR_MARCH, 28), DateUtil.GetJavaDate(38074.00, false));
}
[Test]
public void TestDate1904()
{
- Assert.AreEqual(new DateTime(1904, CALENDAR_JANUARY, 2), DateUtil.GetJavaDate(1.0, true));
- Assert.AreEqual(new DateTime(1904, CALENDAR_JANUARY, 1), DateUtil.GetJavaDate(0.0, true));
- Assert.AreEqual(0.0, DateUtil.GetExcelDate(new DateTime(1904, CALENDAR_JANUARY, 1), true), 0.00001);
- Assert.AreEqual(1.0, DateUtil.GetExcelDate(new DateTime(1904, CALENDAR_JANUARY, 2), true), 0.00001);
+ ClassicAssert.AreEqual(new DateTime(1904, CALENDAR_JANUARY, 2), DateUtil.GetJavaDate(1.0, true));
+ ClassicAssert.AreEqual(new DateTime(1904, CALENDAR_JANUARY, 1), DateUtil.GetJavaDate(0.0, true));
+ ClassicAssert.AreEqual(0.0, DateUtil.GetExcelDate(new DateTime(1904, CALENDAR_JANUARY, 1), true), 0.00001);
+ ClassicAssert.AreEqual(1.0, DateUtil.GetExcelDate(new DateTime(1904, CALENDAR_JANUARY, 2), true), 0.00001);
- Assert.AreEqual(new DateTime(1998, CALENDAR_JULY, 5), DateUtil.GetJavaDate(35981, false));
- Assert.AreEqual(new DateTime(1998, CALENDAR_JULY, 5), DateUtil.GetJavaDate(34519, true));
+ ClassicAssert.AreEqual(new DateTime(1998, CALENDAR_JULY, 5), DateUtil.GetJavaDate(35981, false));
+ ClassicAssert.AreEqual(new DateTime(1998, CALENDAR_JULY, 5), DateUtil.GetJavaDate(34519, true));
- Assert.AreEqual(35981.0, DateUtil.GetExcelDate(new DateTime(1998, CALENDAR_JULY, 5), false), 0.00001);
- Assert.AreEqual(34519.0, DateUtil.GetExcelDate(new DateTime(1998, CALENDAR_JULY, 5), true), 0.00001);
+ ClassicAssert.AreEqual(35981.0, DateUtil.GetExcelDate(new DateTime(1998, CALENDAR_JULY, 5), false), 0.00001);
+ ClassicAssert.AreEqual(34519.0, DateUtil.GetExcelDate(new DateTime(1998, CALENDAR_JULY, 5), true), 0.00001);
}
/**
@@ -474,10 +474,10 @@ public void TestAbsoluteDay()
{
// 1 Jan 1900 is 1 day after 31 Dec 1899
DateTime calendar = new DateTime(1900, 1, 1);
- Assert.AreEqual(1, DateUtil.AbsoluteDay(calendar, false), "Checking absolute day (1 Jan 1900)");
+ ClassicAssert.AreEqual(1, DateUtil.AbsoluteDay(calendar, false), "Checking absolute day (1 Jan 1900)");
// 1 Jan 1901 is 366 days after 31 Dec 1899
calendar = new DateTime(1901, 1, 1);
- Assert.AreEqual(366, DateUtil.AbsoluteDay(calendar, false), "Checking absolute day (1 Jan 1901)");
+ ClassicAssert.AreEqual(366, DateUtil.AbsoluteDay(calendar, false), "Checking absolute day (1 Jan 1901)");
}
[Test]
@@ -510,16 +510,16 @@ public void TestConvertTime()
{
double delta = 1E-7; // a couple of digits more accuracy than strictly required
- Assert.AreEqual(0.5, DateUtil.ConvertTime("12:00"), delta);
- Assert.AreEqual(2.0 / 3, DateUtil.ConvertTime("16:00"), delta);
- Assert.AreEqual(0.0000116, DateUtil.ConvertTime("0:00:01"), delta);
- Assert.AreEqual(0.7330440, DateUtil.ConvertTime("17:35:35"), delta);
+ ClassicAssert.AreEqual(0.5, DateUtil.ConvertTime("12:00"), delta);
+ ClassicAssert.AreEqual(2.0 / 3, DateUtil.ConvertTime("16:00"), delta);
+ ClassicAssert.AreEqual(0.0000116, DateUtil.ConvertTime("0:00:01"), delta);
+ ClassicAssert.AreEqual(0.7330440, DateUtil.ConvertTime("17:35:35"), delta);
}
[Test]
public void TestParseDate()
{
- Assert.AreEqual(new DateTime(2008, 8, 3), DateUtil.ParseYYYYMMDDDate("2008/08/03"));
- Assert.AreEqual(new DateTime(1994, 5, 1), DateUtil.ParseYYYYMMDDDate("1994/05/01"));
+ ClassicAssert.AreEqual(new DateTime(2008, 8, 3), DateUtil.ParseYYYYMMDDDate("2008/08/03"));
+ ClassicAssert.AreEqual(new DateTime(1994, 5, 1), DateUtil.ParseYYYYMMDDDate("1994/05/01"));
}
/**
@@ -532,7 +532,7 @@ public void TestConvertDateTime()
// 0.7 corresponds to time 16:48:00
DateTime actual = DateUtil.GetJavaDate(30000.7);
DateTime expected = new DateTime(1982, 2, 18, 16, 48, 0);
- Assert.AreEqual(expected, actual);
+ ClassicAssert.AreEqual(expected, actual);
}
/**
* User reported a datetime issue in POI-2.5:
@@ -551,7 +551,7 @@ public void TestBug19172()
DateTime returnedValue = (DateTime)cell.DateCellValue;
- Assert.AreEqual(valueToTest.TimeOfDay, returnedValue.TimeOfDay);
+ ClassicAssert.AreEqual(valueToTest.TimeOfDay, returnedValue.TimeOfDay);
}
/**
* DateUtil.isCellFormatted(Cell) should not true for a numeric cell
@@ -563,7 +563,7 @@ public void TestBug54557()
string format = ".0000";
bool isDateFormat = HSSFDateUtil.IsADateFormat(165, format);
- Assert.AreEqual(false, isDateFormat);
+ ClassicAssert.AreEqual(false, isDateFormat);
}
[Test]
@@ -571,13 +571,13 @@ public void Bug56269()
{
double excelFraction = 41642.45833321759d;
DateTime calNoRound = HSSFDateUtil.GetJavaCalendar(excelFraction, false);
- Assert.AreEqual(10, calNoRound.Hour);
- Assert.AreEqual(59, calNoRound.Minute);
- Assert.AreEqual(59, calNoRound.Second);
+ ClassicAssert.AreEqual(10, calNoRound.Hour);
+ ClassicAssert.AreEqual(59, calNoRound.Minute);
+ ClassicAssert.AreEqual(59, calNoRound.Second);
DateTime calRound = HSSFDateUtil.GetJavaCalendar(excelFraction, false,(TimeZoneInfo)null, true);
- Assert.AreEqual(11, calRound.Hour);
- Assert.AreEqual(0, calRound.Minute);
- Assert.AreEqual(0, calRound.Second);
+ ClassicAssert.AreEqual(11, calRound.Hour);
+ ClassicAssert.AreEqual(0, calRound.Minute);
+ ClassicAssert.AreEqual(0, calRound.Second);
}
}
diff --git a/testcases/main/HSSF/UserModel/TestHSSFExternalFunctions.cs b/testcases/main/HSSF/UserModel/TestHSSFExternalFunctions.cs
index cf6a2ab54..ac64f70df 100644
--- a/testcases/main/HSSF/UserModel/TestHSSFExternalFunctions.cs
+++ b/testcases/main/HSSF/UserModel/TestHSSFExternalFunctions.cs
@@ -23,7 +23,7 @@ namespace TestCases.HSSF.UserModel
using NPOI.SS.Formula;
using TestCases.SS.Formula;
using TestCases.HSSF;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.SS.UserModel;
/**
@@ -52,18 +52,18 @@ public void TestATP()
ISheet sh = wb.GetSheetAt(0);
// these two are not imlemented in r
- Assert.AreEqual("DELTA(1.3,1.5)", sh.GetRow(0).GetCell(1).CellFormula);
- Assert.AreEqual("COMPLEX(2,4)", sh.GetRow(1).GetCell(1).CellFormula);
+ ClassicAssert.AreEqual("DELTA(1.3,1.5)", sh.GetRow(0).GetCell(1).CellFormula);
+ ClassicAssert.AreEqual("COMPLEX(2,4)", sh.GetRow(1).GetCell(1).CellFormula);
ICell cell2 = sh.GetRow(2).GetCell(1);
- Assert.AreEqual("ISODD(2)", cell2.CellFormula);
- Assert.AreEqual(false, Evaluator.Evaluate(cell2).BooleanValue);
- Assert.AreEqual(CellType.Boolean, Evaluator.EvaluateFormulaCell(cell2));
+ ClassicAssert.AreEqual("ISODD(2)", cell2.CellFormula);
+ ClassicAssert.AreEqual(false, Evaluator.Evaluate(cell2).BooleanValue);
+ ClassicAssert.AreEqual(CellType.Boolean, Evaluator.EvaluateFormulaCell(cell2));
ICell cell3 = sh.GetRow(3).GetCell(1);
- Assert.AreEqual("ISEVEN(2)", cell3.CellFormula);
- Assert.AreEqual(true, Evaluator.Evaluate(cell3).BooleanValue);
- Assert.AreEqual(CellType.Boolean, Evaluator.EvaluateFormulaCell(cell3));
+ ClassicAssert.AreEqual("ISEVEN(2)", cell3.CellFormula);
+ ClassicAssert.AreEqual(true, Evaluator.Evaluate(cell3).BooleanValue);
+ ClassicAssert.AreEqual(CellType.Boolean, Evaluator.EvaluateFormulaCell(cell3));
}
}
diff --git a/testcases/main/HSSF/UserModel/TestHSSFFont.cs b/testcases/main/HSSF/UserModel/TestHSSFFont.cs
index 78536d7f6..951e100dd 100644
--- a/testcases/main/HSSF/UserModel/TestHSSFFont.cs
+++ b/testcases/main/HSSF/UserModel/TestHSSFFont.cs
@@ -17,7 +17,7 @@
namespace TestCases.HSSF.UserModel
{
using NPOI.HSSF.UserModel;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.SS.UserModel;
using TestCases.SS.UserModel;
diff --git a/testcases/main/HSSF/UserModel/TestHSSFFormulaEvaluator.cs b/testcases/main/HSSF/UserModel/TestHSSFFormulaEvaluator.cs
index 2cc777383..7ecc60e32 100644
--- a/testcases/main/HSSF/UserModel/TestHSSFFormulaEvaluator.cs
+++ b/testcases/main/HSSF/UserModel/TestHSSFFormulaEvaluator.cs
@@ -22,7 +22,7 @@ namespace TestCases.HSSF.UserModel
using NPOI.SS.Formula;
using NPOI.SS.Formula.Eval;
using NPOI.SS.UserModel;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using System;
using TestCases.HSSF;
using TestCases.SS.Formula;
@@ -59,8 +59,8 @@ public void TestEvaluateSimple()
ICell cell = sheet.GetRow(8).GetCell(0);
HSSFFormulaEvaluator fe = new HSSFFormulaEvaluator(wb);
CellValue cv = fe.Evaluate(cell);
- Assert.AreEqual(CellType.Numeric, cv.CellType);
- Assert.AreEqual(3.72, cv.NumberValue, 0.0);
+ ClassicAssert.AreEqual(CellType.Numeric, cv.CellType);
+ ClassicAssert.AreEqual(3.72, cv.NumberValue, 0.0);
wb.Close();
}
@@ -93,7 +93,7 @@ public override void TestUpdateCachedFormulaResultFromErrorToNumber_bug46479()
Assert.Fail("Identified bug 46479a");
}
}
- Assert.AreEqual(3.5, cellB1.NumericCellValue, 0.0);
+ ClassicAssert.AreEqual(3.5, cellB1.NumericCellValue, 0.0);
wb.Close();
}
@@ -137,8 +137,8 @@ public void TestDefinedNameWithComplexFlag_bug47048()
try
{
value = hsf.Evaluate(cellA1);
- Assert.AreEqual(CellType.Numeric, value.CellType);
- Assert.AreEqual(5.33, value.NumberValue, 0.0);
+ ClassicAssert.AreEqual(CellType.Numeric, value.CellType);
+ ClassicAssert.AreEqual(5.33, value.NumberValue, 0.0);
}
catch (Exception e)
{
@@ -203,8 +203,8 @@ public void TestShortCircuitIfEvaluation()
// Without short-circuit-if evaluation, evaluating cell 'A1' takes 3 extra evaluations (for D1,E1,F1)
Assert.Fail("Identifed bug 48195 - Formula evaluator should short-circuit IF() calculations.");
}
- Assert.AreEqual(3, evalCount);
- Assert.AreEqual(2.0, ((NumberEval)ve).NumberValue, 0D);
+ ClassicAssert.AreEqual(3, evalCount);
+ ClassicAssert.AreEqual(2.0, ((NumberEval)ve).NumberValue, 0D);
wb.Close();
}
@@ -221,24 +221,24 @@ public void TestXRefs()
// VLookup on a name in another file
cell = wb1.GetSheetAt(0).GetRow(1).GetCell(2);
- Assert.AreEqual(CellType.Formula, cell.CellType);
- Assert.AreEqual(CellType.Numeric, cell.CachedFormulaResultType);
- Assert.AreEqual(12.30, cell.NumericCellValue, 0.0001);
+ ClassicAssert.AreEqual(CellType.Formula, cell.CellType);
+ ClassicAssert.AreEqual(CellType.Numeric, cell.CachedFormulaResultType);
+ ClassicAssert.AreEqual(12.30, cell.NumericCellValue, 0.0001);
// WARNING - this is wrong!
// The file name should be Showing, but bug #45970 is fixed
// we seem to loose it
- Assert.AreEqual("VLOOKUP(PART,COSTS,2,FALSE)", cell.CellFormula);
+ ClassicAssert.AreEqual("VLOOKUP(PART,COSTS,2,FALSE)", cell.CellFormula);
// Simple reference to a name in another file
cell = wb1.GetSheetAt(0).GetRow(1).GetCell(4);
- Assert.AreEqual(CellType.Formula, cell.CellType);
- Assert.AreEqual(CellType.Numeric, cell.CachedFormulaResultType);
- Assert.AreEqual(36.90, cell.NumericCellValue, 0.0001);
+ ClassicAssert.AreEqual(CellType.Formula, cell.CellType);
+ ClassicAssert.AreEqual(CellType.Numeric, cell.CachedFormulaResultType);
+ ClassicAssert.AreEqual(36.90, cell.NumericCellValue, 0.0001);
// WARNING - this is wrong!
// The file name should be Showing, but bug #45970 is fixed
// we seem to loose it
- Assert.AreEqual("Cost*Markup_Cost", cell.CellFormula);
+ ClassicAssert.AreEqual("Cost*Markup_Cost", cell.CellFormula);
// Evaluate the cells
@@ -260,26 +260,26 @@ public void TestXRefs()
// Re-check VLOOKUP one
cell = wb1.GetSheetAt(0).GetRow(1).GetCell(2);
- Assert.AreEqual(CellType.Formula, cell.CellType);
- Assert.AreEqual(CellType.Numeric, cell.CachedFormulaResultType);
- Assert.AreEqual(12.30, cell.NumericCellValue, 0.0001);
+ ClassicAssert.AreEqual(CellType.Formula, cell.CellType);
+ ClassicAssert.AreEqual(CellType.Numeric, cell.CachedFormulaResultType);
+ ClassicAssert.AreEqual(12.30, cell.NumericCellValue, 0.0001);
// Re-check ref one
cell = wb1.GetSheetAt(0).GetRow(1).GetCell(4);
- Assert.AreEqual(CellType.Formula, cell.CellType);
- Assert.AreEqual(CellType.Numeric, cell.CachedFormulaResultType);
- Assert.AreEqual(36.90, cell.NumericCellValue, 0.0001);
+ ClassicAssert.AreEqual(CellType.Formula, cell.CellType);
+ ClassicAssert.AreEqual(CellType.Numeric, cell.CachedFormulaResultType);
+ ClassicAssert.AreEqual(36.90, cell.NumericCellValue, 0.0001);
// Add a formula that refers to one of the existing external workbooks
cell = wb1.GetSheetAt(0).GetRow(1).CreateCell(40);
cell.CellFormula = (/*setter*/"Cost*[XRefCalcData.xls]MarkupSheet!$B$1");
// Check is was stored correctly
- Assert.AreEqual("Cost*[XRefCalcData.xls]MarkupSheet!$B$1", cell.CellFormula);
+ ClassicAssert.AreEqual("Cost*[XRefCalcData.xls]MarkupSheet!$B$1", cell.CellFormula);
// Check it Evaluates correctly
eval.EvaluateFormulaCell(cell);
- Assert.AreEqual(24.60 * 1.8, cell.NumericCellValue, 0);
+ ClassicAssert.AreEqual(24.60 * 1.8, cell.NumericCellValue, 0);
// Try to add a formula for a new external workbook, won't be allowed to start
@@ -298,7 +298,7 @@ public void TestXRefs()
// Now add a formula that refers to our new workbook
cell.CellFormula = (/*setter*/"[alt.xls]Sheet0!$A$1");
- Assert.AreEqual("[alt.xls]Sheet0!$A$1", cell.CellFormula);
+ ClassicAssert.AreEqual("[alt.xls]Sheet0!$A$1", cell.CellFormula);
// Evaluate it, without a link to that workbook
try
@@ -318,7 +318,7 @@ public void TestXRefs()
}
);
eval.EvaluateFormulaCell(cell);
- Assert.AreEqual("In another workbook", cell.StringCellValue);
+ ClassicAssert.AreEqual("In another workbook", cell.StringCellValue);
// Save and re-load
@@ -335,15 +335,15 @@ public void TestXRefs()
// Check the one referring to the previously existing workbook behaves
cell = wb4.GetSheetAt(0).GetRow(1).GetCell(40);
- Assert.AreEqual("Cost*[XRefCalcData.xls]MarkupSheet!$B$1", cell.CellFormula);
+ ClassicAssert.AreEqual("Cost*[XRefCalcData.xls]MarkupSheet!$B$1", cell.CellFormula);
eval.EvaluateFormulaCell(cell);
- Assert.AreEqual(24.60 * 1.8, cell.NumericCellValue);
+ ClassicAssert.AreEqual(24.60 * 1.8, cell.NumericCellValue);
// Now check the newly Added reference
cell = wb4.GetSheetAt(0).GetRow(1).GetCell(42);
- Assert.AreEqual("[alt.xls]Sheet0!$A$1", cell.CellFormula);
+ ClassicAssert.AreEqual("[alt.xls]Sheet0!$A$1", cell.CellFormula);
eval.EvaluateFormulaCell(cell);
- Assert.AreEqual("In another workbook", cell.StringCellValue);
+ ClassicAssert.AreEqual("In another workbook", cell.StringCellValue);
wb4.Close();
wb3.Close();
diff --git a/testcases/main/HSSF/UserModel/TestHSSFHeaderFooter.cs b/testcases/main/HSSF/UserModel/TestHSSFHeaderFooter.cs
index 9ee44b0df..9512512d3 100644
--- a/testcases/main/HSSF/UserModel/TestHSSFHeaderFooter.cs
+++ b/testcases/main/HSSF/UserModel/TestHSSFHeaderFooter.cs
@@ -19,7 +19,7 @@ namespace TestCases.HSSF.UserModel
{
using System;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.UserModel;
using TestCases.HSSF;
using NPOI.SS.UserModel;
@@ -48,19 +48,19 @@ public void TestRetrieveCorrectHeader()
NPOI.SS.UserModel.ISheet s = wb.GetSheetAt(0);
IHeader head = s.Header;
- Assert.AreEqual("Top Left", head.Left);
- Assert.AreEqual("Top Center", head.Center);
- Assert.AreEqual("Top Right", head.Right);
+ ClassicAssert.AreEqual("Top Left", head.Left);
+ ClassicAssert.AreEqual("Top Center", head.Center);
+ ClassicAssert.AreEqual("Top Right", head.Right);
}
[Test]
public void TestSpecialChars()
{
- Assert.AreEqual("&U", HSSFHeader.StartUnderline);
- Assert.AreEqual("&U", HSSFHeader.EndUnderline);
- Assert.AreEqual("&P", HSSFHeader.Page);
+ ClassicAssert.AreEqual("&U", HSSFHeader.StartUnderline);
+ ClassicAssert.AreEqual("&U", HSSFHeader.EndUnderline);
+ ClassicAssert.AreEqual("&P", HSSFHeader.Page);
- Assert.AreEqual("&22", HSSFFooter.FontSize((short)22));
- Assert.AreEqual("&\"Arial,bold\"", HSSFFooter.Font("Arial", "bold"));
+ ClassicAssert.AreEqual("&22", HSSFFooter.FontSize((short)22));
+ ClassicAssert.AreEqual("&\"Arial,bold\"", HSSFFooter.Font("Arial", "bold"));
}
[Test]
public void TestStripFields()
@@ -72,34 +72,34 @@ public void TestStripFields()
String withOtherAnds = "I am a&P Test header&&";
String withOtherAnds2 = "I am a&P Test header&a&b";
- Assert.IsTrue(0 < HeaderFooter.Fields.AllFields.Count,
+ ClassicAssert.IsTrue(0 < HeaderFooter.Fields.AllFields.Count,
string.Format(CultureInfo.InvariantCulture, "Fields.AllFields must be initialized before the following tests are working. Fields.AllFields.Count: {0}. ",
HeaderFooter.Fields.AllFields.Count));
- Assert.AreEqual(simple, HSSFHeader.StripFields(simple));
- Assert.AreEqual(simple, HeaderFooter.StripFields(withPage));
- Assert.AreEqual(simple, HSSFHeader.StripFields(withPage));
- Assert.AreEqual(simple, HSSFHeader.StripFields(withLots));
- Assert.AreEqual(simple, HSSFHeader.StripFields(withFont));
- Assert.AreEqual(simple + "&&", HSSFHeader.StripFields(withOtherAnds));
- Assert.AreEqual(simple + "&a&b", HSSFHeader.StripFields(withOtherAnds2));
+ ClassicAssert.AreEqual(simple, HSSFHeader.StripFields(simple));
+ ClassicAssert.AreEqual(simple, HeaderFooter.StripFields(withPage));
+ ClassicAssert.AreEqual(simple, HSSFHeader.StripFields(withPage));
+ ClassicAssert.AreEqual(simple, HSSFHeader.StripFields(withLots));
+ ClassicAssert.AreEqual(simple, HSSFHeader.StripFields(withFont));
+ ClassicAssert.AreEqual(simple + "&&", HSSFHeader.StripFields(withOtherAnds));
+ ClassicAssert.AreEqual(simple + "&a&b", HSSFHeader.StripFields(withOtherAnds2));
// Now Test the default Strip flag
HSSFWorkbook wb = HSSFTestDataSamples.OpenSampleWorkbook("EmbeddedChartHeaderTest.xls");
NPOI.SS.UserModel.ISheet s = wb.GetSheetAt(0);
IHeader head = s.Header;
- Assert.AreEqual("Top Left", head.Left);
- Assert.AreEqual("Top Center", head.Center);
- Assert.AreEqual("Top Right", head.Right);
+ ClassicAssert.AreEqual("Top Left", head.Left);
+ ClassicAssert.AreEqual("Top Center", head.Center);
+ ClassicAssert.AreEqual("Top Right", head.Right);
head.Left = ("Top &P&F&D Left");
- Assert.AreEqual("Top &P&F&D Left", head.Left);
+ ClassicAssert.AreEqual("Top &P&F&D Left", head.Left);
- Assert.AreEqual("Top Left", NPOI.HSSF.UserModel.HeaderFooter.StripFields(head.Left));
+ ClassicAssert.AreEqual("Top Left", NPOI.HSSF.UserModel.HeaderFooter.StripFields(head.Left));
// Now even more complex
head.Center = ("HEADER TEXT &P&N&D&T&Z&F&F&A&G&X END");
- Assert.AreEqual("HEADER TEXT END", NPOI.HSSF.UserModel.HeaderFooter.StripFields(head.Center));
+ ClassicAssert.AreEqual("HEADER TEXT END", NPOI.HSSF.UserModel.HeaderFooter.StripFields(head.Center));
}
/**
@@ -115,9 +115,9 @@ public void TestRetrieveCorrectFooter()
NPOI.SS.UserModel.ISheet s = wb.GetSheetAt(0);
IFooter foot = s.Footer;
- Assert.AreEqual("Bottom Left", foot.Left);
- Assert.AreEqual("Bottom Center", foot.Center);
- Assert.AreEqual("Bottom Right", foot.Right);
+ ClassicAssert.AreEqual("Bottom Left", foot.Left);
+ ClassicAssert.AreEqual("Bottom Center", foot.Center);
+ ClassicAssert.AreEqual("Bottom Right", foot.Right);
}
/**
@@ -136,9 +136,9 @@ public void TestHeaderHas16bitCharacter()
HSSFWorkbook b2 = HSSFTestDataSamples.WriteOutAndReadBack(b);
IHeader h2 = b2.GetSheet("Test").Header;
- Assert.AreEqual(h2.Left, "\u0391");
- Assert.AreEqual(h2.Center, "\u0392");
- Assert.AreEqual(h2.Right, "\u0393");
+ ClassicAssert.AreEqual(h2.Left, "\u0391");
+ ClassicAssert.AreEqual(h2.Center, "\u0392");
+ ClassicAssert.AreEqual(h2.Right, "\u0393");
}
/**
@@ -157,9 +157,9 @@ public void TestFooterHas16bitCharacter()
HSSFWorkbook b2 = HSSFTestDataSamples.WriteOutAndReadBack(b);
IFooter f2 = b2.GetSheet("Test").Footer;
- Assert.AreEqual(f2.Left, "\u0391");
- Assert.AreEqual(f2.Center, "\u0392");
- Assert.AreEqual(f2.Right, "\u0393");
+ ClassicAssert.AreEqual(f2.Left, "\u0391");
+ ClassicAssert.AreEqual(f2.Center, "\u0392");
+ ClassicAssert.AreEqual(f2.Right, "\u0393");
}
[Test]
public void TestReadDBCSHeaderFooter()
@@ -167,14 +167,14 @@ public void TestReadDBCSHeaderFooter()
HSSFWorkbook wb = HSSFTestDataSamples.OpenSampleWorkbook("DBCSHeader.xls");
NPOI.SS.UserModel.ISheet s = wb.GetSheetAt(0);
IHeader h = s.Header;
- Assert.AreEqual(h.Left, "\u090f\u0915", "Header Left ");
- Assert.AreEqual(h.Center, "\u0939\u094b\u0917\u093e", "Header Center ");
- Assert.AreEqual(h.Right, "\u091c\u093e", "Header Right ");
+ ClassicAssert.AreEqual(h.Left, "\u090f\u0915", "Header Left ");
+ ClassicAssert.AreEqual(h.Center, "\u0939\u094b\u0917\u093e", "Header Center ");
+ ClassicAssert.AreEqual(h.Right, "\u091c\u093e", "Header Right ");
IFooter f = s.Footer;
- Assert.AreEqual(f.Left, "\u091c\u093e", "Footer Left ");
- Assert.AreEqual(f.Center, "\u091c\u093e", "Footer Center ");
- Assert.AreEqual(f.Right, "\u091c\u093e", "Footer Right ");
+ ClassicAssert.AreEqual(f.Left, "\u091c\u093e", "Footer Left ");
+ ClassicAssert.AreEqual(f.Center, "\u091c\u093e", "Footer Center ");
+ ClassicAssert.AreEqual(f.Right, "\u091c\u093e", "Footer Right ");
}
/**
* Excel tolerates files with missing HEADER/FOOTER records. POI should do the same.
@@ -196,18 +196,18 @@ public void TestMissingHeaderFooterRecord_bug47244()
{
throw new AssertionException("Identified bug 47244a");
}
- Assert.AreEqual("", footer.RawText);
+ ClassicAssert.AreEqual("", footer.RawText);
HSSFHeader header = (HSSFHeader)sheet.Header;
- Assert.AreEqual("", header.RawText);
+ ClassicAssert.AreEqual("", header.RawText);
// make sure header / footer is properly linked to underlying data
HSSFHeader header2 = (HSSFHeader)sheet.Header;
header.Center = (/*setter*/"foo");
- Assert.AreEqual("foo", header2.Center);
+ ClassicAssert.AreEqual("foo", header2.Center);
HSSFFooter footer2 = (HSSFFooter)sheet.Footer;
footer.Center = (/*setter*/"bar");
- Assert.AreEqual("bar", footer2.Center);
+ ClassicAssert.AreEqual("bar", footer2.Center);
}
}
diff --git a/testcases/main/HSSF/UserModel/TestHSSFHyperlink.cs b/testcases/main/HSSF/UserModel/TestHSSFHyperlink.cs
index 6a97f9cd8..a063fcfa3 100644
--- a/testcases/main/HSSF/UserModel/TestHSSFHyperlink.cs
+++ b/testcases/main/HSSF/UserModel/TestHSSFHyperlink.cs
@@ -19,7 +19,7 @@ namespace TestCases.HSSF.UserModel
{
using System;
using System.IO;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using TestCases.HSSF;
using NPOI.HSSF.UserModel;
using NPOI.SS.UserModel;
@@ -53,34 +53,34 @@ public void TestRead()
sheet = wb.GetSheet("WebLinks");
cell = sheet.GetRow(4).GetCell(0);
link = cell.Hyperlink;
- Assert.IsNotNull(link);
- Assert.AreEqual("POI", link.Label);
- Assert.AreEqual("POI", cell.RichStringCellValue.String);
- Assert.AreEqual("http://poi.apache.org/", link.Address);
+ ClassicAssert.IsNotNull(link);
+ ClassicAssert.AreEqual("POI", link.Label);
+ ClassicAssert.AreEqual("POI", cell.RichStringCellValue.String);
+ ClassicAssert.AreEqual("http://poi.apache.org/", link.Address);
cell = sheet.GetRow(8).GetCell(0);
link = cell.Hyperlink;
- Assert.IsNotNull(link);
- Assert.AreEqual("HSSF", link.Label);
- Assert.AreEqual("HSSF", cell.RichStringCellValue.String);
- Assert.AreEqual("http://poi.apache.org/hssf/", link.Address);
+ ClassicAssert.IsNotNull(link);
+ ClassicAssert.AreEqual("HSSF", link.Label);
+ ClassicAssert.AreEqual("HSSF", cell.RichStringCellValue.String);
+ ClassicAssert.AreEqual("http://poi.apache.org/hssf/", link.Address);
sheet = wb.GetSheet("Emails");
cell = sheet.GetRow(4).GetCell(0);
link = cell.Hyperlink;
- Assert.IsNotNull(link);
- Assert.AreEqual("dev", link.Label);
- Assert.AreEqual("dev", cell.RichStringCellValue.String);
- Assert.AreEqual("mailto:dev@poi.apache.org", link.Address);
+ ClassicAssert.IsNotNull(link);
+ ClassicAssert.AreEqual("dev", link.Label);
+ ClassicAssert.AreEqual("dev", cell.RichStringCellValue.String);
+ ClassicAssert.AreEqual("mailto:dev@poi.apache.org", link.Address);
sheet = wb.GetSheet("Internal");
cell = sheet.GetRow(4).GetCell(0);
link = cell.Hyperlink;
- Assert.IsNotNull(link);
- Assert.AreEqual("Link To First Sheet", link.Label);
- Assert.AreEqual("Link To First Sheet", cell.RichStringCellValue.String);
- Assert.AreEqual("WebLinks!A1", link.TextMark);
- Assert.AreEqual("WebLinks!A1", link.Address);
+ ClassicAssert.IsNotNull(link);
+ ClassicAssert.AreEqual("Link To First Sheet", link.Label);
+ ClassicAssert.AreEqual("Link To First Sheet", cell.RichStringCellValue.String);
+ ClassicAssert.AreEqual("WebLinks!A1", link.TextMark);
+ ClassicAssert.AreEqual("WebLinks!A1", link.Address);
}
[Test]
public void TestModify()
@@ -105,8 +105,8 @@ public void TestModify()
sheet = wb.GetSheet("WebLinks");
cell = sheet.GetRow(4).GetCell(0);
link = cell.Hyperlink;
- Assert.IsNotNull(link);
- Assert.AreEqual("www.apache.org", link.Address);
+ ClassicAssert.IsNotNull(link);
+ ClassicAssert.AreEqual("www.apache.org", link.Address);
}
/**
@@ -149,15 +149,15 @@ public void TestCreateDocumentLink()
cell = sheet.GetRow(0).GetCell(0);
link = cell.Hyperlink;
- Assert.IsNotNull(link);
- Assert.AreEqual("'Target Sheet'!A1", link.TextMark);
- Assert.AreEqual("'Target Sheet'!A1", link.Address);
+ ClassicAssert.IsNotNull(link);
+ ClassicAssert.AreEqual("'Target Sheet'!A1", link.TextMark);
+ ClassicAssert.AreEqual("'Target Sheet'!A1", link.Address);
cell = sheet.GetRow(1).GetCell(0);
link = cell.Hyperlink;
- Assert.IsNotNull(link);
- Assert.AreEqual("'Hyperlinks'!A1", link.TextMark);
- Assert.AreEqual("'Hyperlinks'!A1", link.Address);
+ ClassicAssert.IsNotNull(link);
+ ClassicAssert.AreEqual("'Hyperlinks'!A1", link.TextMark);
+ ClassicAssert.AreEqual("'Hyperlinks'!A1", link.Address);
}
/**
* Test that NPOI.SS.UserModel.Sheet#shiftRows moves hyperlinks,
@@ -174,36 +174,36 @@ public void TestShiftRows()
//verify existing hyperlink in A3
ICell cell1 = sheet.GetRow(2).GetCell(0);
IHyperlink link1 = cell1.Hyperlink;
- Assert.IsNotNull(link1);
- Assert.AreEqual(2, link1.FirstRow);
- Assert.AreEqual(2, link1.LastRow);
+ ClassicAssert.IsNotNull(link1);
+ ClassicAssert.AreEqual(2, link1.FirstRow);
+ ClassicAssert.AreEqual(2, link1.LastRow);
//assign a hyperlink to A4
HSSFHyperlink link2 = new HSSFHyperlink(HyperlinkType.Document);
link2.Address=("Sheet2!A2");
ICell cell2 = sheet.GetRow(3).GetCell(0);
cell2.Hyperlink=(link2);
- Assert.AreEqual(3, link2.FirstRow);
- Assert.AreEqual(3, link2.LastRow);
+ ClassicAssert.AreEqual(3, link2.FirstRow);
+ ClassicAssert.AreEqual(3, link2.LastRow);
//move the 3rd row two rows down
sheet.ShiftRows(sheet.FirstRowNum, sheet.LastRowNum, 2);
//cells A3 and A4 don't contain hyperlinks anymore
- Assert.IsNull(sheet.GetRow(2).GetCell(0).Hyperlink);
- Assert.IsNull(sheet.GetRow(3).GetCell(0).Hyperlink);
+ ClassicAssert.IsNull(sheet.GetRow(2).GetCell(0).Hyperlink);
+ ClassicAssert.IsNull(sheet.GetRow(3).GetCell(0).Hyperlink);
//the first hypelink now belongs to A5
IHyperlink link1_shifted = sheet.GetRow(2 + 2).GetCell(0).Hyperlink;
- Assert.IsNotNull(link1_shifted);
- Assert.AreEqual(4, link1_shifted.FirstRow);
- Assert.AreEqual(4, link1_shifted.LastRow);
+ ClassicAssert.IsNotNull(link1_shifted);
+ ClassicAssert.AreEqual(4, link1_shifted.FirstRow);
+ ClassicAssert.AreEqual(4, link1_shifted.LastRow);
//the second hypelink now belongs to A6
IHyperlink link2_shifted = sheet.GetRow(3 + 2).GetCell(0).Hyperlink;
- Assert.IsNotNull(link2_shifted);
- Assert.AreEqual(5, link2_shifted.FirstRow);
- Assert.AreEqual(5, link2_shifted.LastRow);
+ ClassicAssert.IsNotNull(link2_shifted);
+ ClassicAssert.AreEqual(5, link2_shifted.FirstRow);
+ ClassicAssert.AreEqual(5, link2_shifted.LastRow);
}
[Test]
public void TestCreate()
@@ -255,23 +255,23 @@ public void TestCreate()
sheet = wb.GetSheet("Hyperlinks");
cell = sheet.GetRow(0).GetCell(0);
link = cell.Hyperlink;
- Assert.IsNotNull(link);
- Assert.AreEqual("http://poi.apache.org/", link.Address);
+ ClassicAssert.IsNotNull(link);
+ ClassicAssert.AreEqual("http://poi.apache.org/", link.Address);
cell = sheet.GetRow(1).GetCell(0);
link = cell.Hyperlink;
- Assert.IsNotNull(link);
- Assert.AreEqual("link1.xls", link.Address);
+ ClassicAssert.IsNotNull(link);
+ ClassicAssert.AreEqual("link1.xls", link.Address);
cell = sheet.GetRow(2).GetCell(0);
link = cell.Hyperlink;
- Assert.IsNotNull(link);
- Assert.AreEqual("mailto:poi@apache.org?subject=Hyperlinks", link.Address);
+ ClassicAssert.IsNotNull(link);
+ ClassicAssert.AreEqual("mailto:poi@apache.org?subject=Hyperlinks", link.Address);
cell = sheet.GetRow(3).GetCell(0);
link = cell.Hyperlink;
- Assert.IsNotNull(link);
- Assert.AreEqual("'Target Sheet'!A1", link.TextMark);
+ ClassicAssert.IsNotNull(link);
+ ClassicAssert.AreEqual("'Target Sheet'!A1", link.TextMark);
}
[Test]
public void TestCloneSheet()
@@ -285,13 +285,13 @@ public void TestCloneSheet()
cell = sheet.GetRow(4).GetCell(0);
link = cell.Hyperlink;
- Assert.IsNotNull(link);
- Assert.AreEqual("http://poi.apache.org/", link.Address);
+ ClassicAssert.IsNotNull(link);
+ ClassicAssert.AreEqual("http://poi.apache.org/", link.Address);
cell = sheet.GetRow(8).GetCell(0);
link = cell.Hyperlink;
- Assert.IsNotNull(link);
- Assert.AreEqual("http://poi.apache.org/hssf/", link.Address);
+ ClassicAssert.IsNotNull(link);
+ ClassicAssert.AreEqual("http://poi.apache.org/hssf/", link.Address);
}
public override IHyperlink CopyHyperlink(IHyperlink link)
@@ -310,10 +310,10 @@ public void testCopyXSSFHyperlink() {
xlink.setTooltip("tooltip");
HSSFHyperlink hlink = new HSSFHyperlink(xlink);
- Assert.AreEqual("http://poi.apache.org/", hlink.Address);
- Assert.AreEqual("D3", new CellReference(hlink.FirstRow, hlink.FirstColumn).formatAsString());
+ ClassicAssert.AreEqual("http://poi.apache.org/", hlink.Address);
+ ClassicAssert.AreEqual("D3", new CellReference(hlink.FirstRow, hlink.FirstColumn).formatAsString());
// Are HSSFHyperlink.label and XSSFHyperlink.tooltip the same? If so, perhaps one of these needs renamed for a consistent Hyperlink interface
- // Assert.AreEqual("tooltip", hlink.Label);
+ // ClassicAssert.AreEqual("tooltip", hlink.Label);
wb.close();
}*/
diff --git a/testcases/main/HSSF/UserModel/TestHSSFName.cs b/testcases/main/HSSF/UserModel/TestHSSFName.cs
index b4a2e57a1..ff39c5528 100644
--- a/testcases/main/HSSF/UserModel/TestHSSFName.cs
+++ b/testcases/main/HSSF/UserModel/TestHSSFName.cs
@@ -19,7 +19,7 @@ namespace TestCases.HSSF.UserModel
{
using System;
using System.Reflection;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.Model;
using NPOI.HSSF.Record;
using NPOI.HSSF.UserModel;
@@ -77,22 +77,22 @@ public void TestRepeatingRowsAndColumsNames()
sheet.RepeatingRows = (cra);
sheet.CreateFreezePane(0, 3);
}
- Assert.AreEqual(1, wb.NumberOfNames);
+ ClassicAssert.AreEqual(1, wb.NumberOfNames);
IName nr1 = wb.GetNameAt(0);
- Assert.AreEqual("Print_Titles", nr1.NameName);
+ ClassicAssert.AreEqual("Print_Titles", nr1.NameName);
// TODO - full column references not rendering properly, absolute markers not present either
// assertEquals("FirstSheet!$A:$A,FirstSheet!$1:$3", nr1.getRefersToFormula());
- Assert.AreEqual("FirstSheet!A:A,FirstSheet!$A$1:$IV$3", nr1.RefersToFormula);
+ ClassicAssert.AreEqual("FirstSheet!A:A,FirstSheet!$A$1:$IV$3", nr1.RefersToFormula);
// Save and re-open
HSSFWorkbook nwb = HSSFTestDataSamples.WriteOutAndReadBack(wb);
- Assert.AreEqual(1, nwb.NumberOfNames);
+ ClassicAssert.AreEqual(1, nwb.NumberOfNames);
nr1 = nwb.GetNameAt(0);
- Assert.AreEqual("Print_Titles", nr1.NameName);
- Assert.AreEqual("FirstSheet!A:A,FirstSheet!$A$1:$IV$3", nr1.RefersToFormula);
+ ClassicAssert.AreEqual("Print_Titles", nr1.NameName);
+ ClassicAssert.AreEqual("FirstSheet!A:A,FirstSheet!$A$1:$IV$3", nr1.RefersToFormula);
// check that Setting RR&C on a second sheet causes a new Print_Titles built-in
// name to be Created
@@ -101,11 +101,11 @@ public void TestRepeatingRowsAndColumsNames()
sheet.RepeatingColumns = (cra);
sheet.RepeatingRows = (cra);
- Assert.AreEqual(2, nwb.NumberOfNames);
+ ClassicAssert.AreEqual(2, nwb.NumberOfNames);
IName nr2 = nwb.GetNameAt(1);
- Assert.AreEqual("Print_Titles", nr2.NameName);
- Assert.AreEqual("SecondSheet!B:C,SecondSheet!$A$1:$IV$1", nr2.RefersToFormula);
+ ClassicAssert.AreEqual("Print_Titles", nr2.NameName);
+ ClassicAssert.AreEqual("SecondSheet!B:C,SecondSheet!$A$1:$IV$1", nr2.RefersToFormula);
}
[Test]
public void TestNamedRange()
@@ -127,7 +127,7 @@ public void TestNamedRange()
IName namedRange1 = wb.GetNameAt(0);
//Getting it sheet name
sheetName = namedRange1.SheetName;
- Assert.IsNotNull(sheetName);
+ ClassicAssert.IsNotNull(sheetName);
// sanity check
SanityChecker c = new SanityChecker();
@@ -135,8 +135,8 @@ public void TestNamedRange()
wb = HSSFTestDataSamples.WriteOutAndReadBack(wb);
IName nm = wb.GetNameAt(wb.GetNameIndex("RangeTest"));
- Assert.IsTrue("RangeTest".Equals(nm.NameName), "Name is " + nm.NameName);
- Assert.AreEqual(wb.GetSheetName(0) + "!$D$4:$E$8", nm.RefersToFormula);
+ ClassicAssert.IsTrue("RangeTest".Equals(nm.NameName), "Name is " + nm.NameName);
+ ClassicAssert.AreEqual(wb.GetSheetName(0) + "!$D$4:$E$8", nm.RefersToFormula);
}
/**
@@ -159,12 +159,12 @@ public void TestNamedRead()
//Getting its reference
String reference = namedRange1.RefersToFormula;
- Assert.AreEqual(sheetName + "!$A$1:$D$10", reference);
+ ClassicAssert.AreEqual(sheetName + "!$A$1:$D$10", reference);
IName namedRange2 = wb.GetNameAt(1);
- Assert.AreEqual(sheetName + "!$D$17:$G$27", namedRange2.RefersToFormula);
- Assert.AreEqual("SecondNamedRange", namedRange2.NameName);
+ ClassicAssert.AreEqual(sheetName + "!$D$17:$G$27", namedRange2.RefersToFormula);
+ ClassicAssert.AreEqual("SecondNamedRange", namedRange2.NameName);
}
/**
@@ -180,13 +180,13 @@ public void TestNamedReadModify()
IName name = wb.GetNameAt(0);
String sheetName = wb.GetSheetName(0);
- Assert.AreEqual(sheetName + "!$A$1:$D$10", name.RefersToFormula);
+ ClassicAssert.AreEqual(sheetName + "!$A$1:$D$10", name.RefersToFormula);
name = wb.GetNameAt(1);
String newReference = sheetName + "!$A$1:$C$36";
name.RefersToFormula = newReference;
- Assert.AreEqual(newReference, name.RefersToFormula);
+ ClassicAssert.AreEqual(newReference, name.RefersToFormula);
}
/**
@@ -200,7 +200,7 @@ public void TestPrintAreaFileRead()
String sheetName = workbook.GetSheetName(0);
String reference = sheetName + "!$A$1:$C$5";
- Assert.AreEqual(reference, workbook.GetPrintArea(0));
+ ClassicAssert.AreEqual(reference, workbook.GetPrintArea(0));
}
[Test]
@@ -208,18 +208,18 @@ public void TestPrintAreaFileRead()
public void TestDeletedReference()
{
HSSFWorkbook wb = HSSFTestDataSamples.OpenSampleWorkbook("24207.xls");
- Assert.AreEqual(2, wb.NumberOfNames);
+ ClassicAssert.AreEqual(2, wb.NumberOfNames);
IName name1 = wb.GetNameAt(0);
- Assert.AreEqual("a", name1.NameName);
- Assert.AreEqual("Sheet1!$A$1", name1.RefersToFormula);
+ ClassicAssert.AreEqual("a", name1.NameName);
+ ClassicAssert.AreEqual("Sheet1!$A$1", name1.RefersToFormula);
new AreaReference(name1.RefersToFormula);
- Assert.IsTrue(true, "Successfully constructed first reference");
+ ClassicAssert.IsTrue(true, "Successfully constructed first reference");
IName name2 = wb.GetNameAt(1);
- Assert.AreEqual("b", name2.NameName);
- Assert.AreEqual("Sheet1!#REF!", name2.RefersToFormula);
- Assert.IsTrue(name2.IsDeleted);
+ ClassicAssert.AreEqual("b", name2.NameName);
+ ClassicAssert.AreEqual("Sheet1!#REF!", name2.RefersToFormula);
+ ClassicAssert.IsTrue(name2.IsDeleted);
try
{
new AreaReference(name2.RefersToFormula);
@@ -245,7 +245,7 @@ public void TestTypeOfRootPtg()
Ptg[] ptgs = HSSFFormulaParser.Parse("CSCO!$E$71", wb, FormulaType.NamedRange, 0);
foreach (Ptg ptg in ptgs)
{
- Assert.AreEqual('R', ptg.RVAType);
+ ClassicAssert.AreEqual('R', ptg.RVAType);
}
}
}
diff --git a/testcases/main/HSSF/UserModel/TestHSSFOptimiser.cs b/testcases/main/HSSF/UserModel/TestHSSFOptimiser.cs
index 96d622dc5..cd53a7a84 100644
--- a/testcases/main/HSSF/UserModel/TestHSSFOptimiser.cs
+++ b/testcases/main/HSSF/UserModel/TestHSSFOptimiser.cs
@@ -18,7 +18,7 @@ namespace TestCases.HSSF.UserModel
using System;
using NPOI.HSSF.UserModel;
using NPOI.HSSF.Model;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.SS.UserModel;
@@ -30,8 +30,8 @@ public void TestDoesNoHarmIfNothingToDo()
{
HSSFWorkbook wb = new HSSFWorkbook();
// New files start with 4 built in fonts, and 21 built in styles
- Assert.AreEqual(4, wb.NumberOfFonts);
- Assert.AreEqual(21, wb.NumCellStyles);
+ ClassicAssert.AreEqual(4, wb.NumberOfFonts);
+ ClassicAssert.AreEqual(21, wb.NumCellStyles);
// Create a test font and style, and use them
IFont f = wb.CreateFont();
@@ -44,24 +44,24 @@ public void TestDoesNoHarmIfNothingToDo()
row.CreateCell(0).CellStyle = (s);
// Should have one more than the default of each
- Assert.AreEqual(5, wb.NumberOfFonts);
- Assert.AreEqual(22, wb.NumCellStyles);
+ ClassicAssert.AreEqual(5, wb.NumberOfFonts);
+ ClassicAssert.AreEqual(22, wb.NumCellStyles);
// Optimise fonts
HSSFOptimiser.OptimiseFonts(wb);
- Assert.AreEqual(5, wb.NumberOfFonts);
- Assert.AreEqual(22, wb.NumCellStyles);
+ ClassicAssert.AreEqual(5, wb.NumberOfFonts);
+ ClassicAssert.AreEqual(22, wb.NumCellStyles);
- Assert.AreEqual(f, s.GetFont(wb));
+ ClassicAssert.AreEqual(f, s.GetFont(wb));
// Optimise styles
HSSFOptimiser.OptimiseCellStyles(wb);
- Assert.AreEqual(5, wb.NumberOfFonts);
- Assert.AreEqual(22, wb.NumCellStyles);
+ ClassicAssert.AreEqual(5, wb.NumberOfFonts);
+ ClassicAssert.AreEqual(22, wb.NumCellStyles);
- Assert.AreEqual(f, s.GetFont(wb));
+ ClassicAssert.AreEqual(f, s.GetFont(wb));
}
[Test]
public void TestOptimiseFonts()
@@ -96,25 +96,25 @@ public void TestOptimiseFonts()
// Use all three of the four in cell styles
- Assert.AreEqual(21, wb.NumCellStyles);
+ ClassicAssert.AreEqual(21, wb.NumCellStyles);
NPOI.SS.UserModel.ICellStyle cs1 = wb.CreateCellStyle();
cs1.SetFont(f1);
- Assert.AreEqual(5, cs1.FontIndex);
+ ClassicAssert.AreEqual(5, cs1.FontIndex);
NPOI.SS.UserModel.ICellStyle cs2 = wb.CreateCellStyle();
cs2.SetFont(f4);
- Assert.AreEqual(8, cs2.FontIndex);
+ ClassicAssert.AreEqual(8, cs2.FontIndex);
NPOI.SS.UserModel.ICellStyle cs3 = wb.CreateCellStyle();
cs3.SetFont(f5);
- Assert.AreEqual(9, cs3.FontIndex);
+ ClassicAssert.AreEqual(9, cs3.FontIndex);
NPOI.SS.UserModel.ICellStyle cs4 = wb.CreateCellStyle();
cs4.SetFont(f6);
- Assert.AreEqual(10, cs4.FontIndex);
+ ClassicAssert.AreEqual(10, cs4.FontIndex);
- Assert.AreEqual(25, wb.NumCellStyles);
+ ClassicAssert.AreEqual(25, wb.NumCellStyles);
// And three in rich text
@@ -134,38 +134,38 @@ public void TestOptimiseFonts()
// Check what we have now
- Assert.AreEqual(10, wb.NumberOfFonts);
- Assert.AreEqual(25, wb.NumCellStyles);
+ ClassicAssert.AreEqual(10, wb.NumberOfFonts);
+ ClassicAssert.AreEqual(25, wb.NumCellStyles);
// Optimise
HSSFOptimiser.OptimiseFonts(wb);
// Check font count
- Assert.AreEqual(8, wb.NumberOfFonts);
- Assert.AreEqual(25, wb.NumCellStyles);
+ ClassicAssert.AreEqual(8, wb.NumberOfFonts);
+ ClassicAssert.AreEqual(25, wb.NumCellStyles);
// Check font use in cell styles
- Assert.AreEqual(5, cs1.FontIndex);
- Assert.AreEqual(5, cs2.FontIndex); // duplicate of 1
- Assert.AreEqual(6, cs3.FontIndex); // duplicate of 2
- Assert.AreEqual(8, cs4.FontIndex); // two have gone
+ ClassicAssert.AreEqual(5, cs1.FontIndex);
+ ClassicAssert.AreEqual(5, cs2.FontIndex); // duplicate of 1
+ ClassicAssert.AreEqual(6, cs3.FontIndex); // duplicate of 2
+ ClassicAssert.AreEqual(8, cs4.FontIndex); // two have gone
// And in rich text
// RTR 1 had f1 and f2, unchanged
- Assert.AreEqual(5, (r.GetCell(0).RichStringCellValue as HSSFRichTextString).GetFontAtIndex(0));
- Assert.AreEqual(5, (r.GetCell(0).RichStringCellValue as HSSFRichTextString).GetFontAtIndex(1));
- Assert.AreEqual(6, (r.GetCell(0).RichStringCellValue as HSSFRichTextString).GetFontAtIndex(3));
- Assert.AreEqual(6, (r.GetCell(0).RichStringCellValue as HSSFRichTextString).GetFontAtIndex(4));
+ ClassicAssert.AreEqual(5, (r.GetCell(0).RichStringCellValue as HSSFRichTextString).GetFontAtIndex(0));
+ ClassicAssert.AreEqual(5, (r.GetCell(0).RichStringCellValue as HSSFRichTextString).GetFontAtIndex(1));
+ ClassicAssert.AreEqual(6, (r.GetCell(0).RichStringCellValue as HSSFRichTextString).GetFontAtIndex(3));
+ ClassicAssert.AreEqual(6, (r.GetCell(0).RichStringCellValue as HSSFRichTextString).GetFontAtIndex(4));
// RTR 2 had f3 (unchanged), f5 (=f2) and f6 (moved down)
- Assert.AreEqual(7, (r.GetCell(1).RichStringCellValue as HSSFRichTextString).GetFontAtIndex(0));
- Assert.AreEqual(7, (r.GetCell(1).RichStringCellValue as HSSFRichTextString).GetFontAtIndex(1));
- Assert.AreEqual(6, (r.GetCell(1).RichStringCellValue as HSSFRichTextString).GetFontAtIndex(3));
- Assert.AreEqual(6, (r.GetCell(1).RichStringCellValue as HSSFRichTextString).GetFontAtIndex(4));
- Assert.AreEqual(8, (r.GetCell(1).RichStringCellValue as HSSFRichTextString).GetFontAtIndex(6));
- Assert.AreEqual(8, (r.GetCell(1).RichStringCellValue as HSSFRichTextString).GetFontAtIndex(7));
+ ClassicAssert.AreEqual(7, (r.GetCell(1).RichStringCellValue as HSSFRichTextString).GetFontAtIndex(0));
+ ClassicAssert.AreEqual(7, (r.GetCell(1).RichStringCellValue as HSSFRichTextString).GetFontAtIndex(1));
+ ClassicAssert.AreEqual(6, (r.GetCell(1).RichStringCellValue as HSSFRichTextString).GetFontAtIndex(3));
+ ClassicAssert.AreEqual(6, (r.GetCell(1).RichStringCellValue as HSSFRichTextString).GetFontAtIndex(4));
+ ClassicAssert.AreEqual(8, (r.GetCell(1).RichStringCellValue as HSSFRichTextString).GetFontAtIndex(6));
+ ClassicAssert.AreEqual(8, (r.GetCell(1).RichStringCellValue as HSSFRichTextString).GetFontAtIndex(7));
}
[Test]
public void TestOptimiseStyles()
@@ -173,7 +173,7 @@ public void TestOptimiseStyles()
HSSFWorkbook wb = new HSSFWorkbook();
// Two fonts
- Assert.AreEqual(4, wb.NumberOfFonts);
+ ClassicAssert.AreEqual(4, wb.NumberOfFonts);
IFont f1 = wb.CreateFont();
f1.FontHeight = ((short)11);
@@ -183,11 +183,11 @@ public void TestOptimiseStyles()
f2.FontHeight = ((short)22);
f2.FontName = ("Also Testing");
- Assert.AreEqual(6, wb.NumberOfFonts);
+ ClassicAssert.AreEqual(6, wb.NumberOfFonts);
// Several styles
- Assert.AreEqual(21, wb.NumCellStyles);
+ ClassicAssert.AreEqual(21, wb.NumCellStyles);
NPOI.SS.UserModel.ICellStyle cs1 = wb.CreateCellStyle();
cs1.SetFont(f1);
@@ -209,7 +209,7 @@ public void TestOptimiseStyles()
NPOI.SS.UserModel.ICellStyle cs6 = wb.CreateCellStyle();
cs6.SetFont(f2);
- Assert.AreEqual(27, wb.NumCellStyles);
+ ClassicAssert.AreEqual(27, wb.NumCellStyles);
// Use them
@@ -225,9 +225,9 @@ public void TestOptimiseStyles()
r.CreateCell(6).CellStyle = (cs1);
r.CreateCell(7).CellStyle = (cs2);
- Assert.AreEqual(21, ((HSSFCell)r.GetCell(0)).CellValueRecord.XFIndex);
- Assert.AreEqual(26, ((HSSFCell)r.GetCell(5)).CellValueRecord.XFIndex);
- Assert.AreEqual(21, ((HSSFCell)r.GetCell(6)).CellValueRecord.XFIndex);
+ ClassicAssert.AreEqual(21, ((HSSFCell)r.GetCell(0)).CellValueRecord.XFIndex);
+ ClassicAssert.AreEqual(26, ((HSSFCell)r.GetCell(5)).CellValueRecord.XFIndex);
+ ClassicAssert.AreEqual(21, ((HSSFCell)r.GetCell(6)).CellValueRecord.XFIndex);
// Optimise
@@ -235,26 +235,26 @@ public void TestOptimiseStyles()
// Check
- Assert.AreEqual(6, wb.NumberOfFonts);
- Assert.AreEqual(25, wb.NumCellStyles);
+ ClassicAssert.AreEqual(6, wb.NumberOfFonts);
+ ClassicAssert.AreEqual(25, wb.NumCellStyles);
// cs1 -> 21
- Assert.AreEqual(21, ((HSSFCell)r.GetCell(0)).CellValueRecord.XFIndex);
+ ClassicAssert.AreEqual(21, ((HSSFCell)r.GetCell(0)).CellValueRecord.XFIndex);
// cs2 -> 22
- Assert.AreEqual(22, ((HSSFCell)r.GetCell(1)).CellValueRecord.XFIndex);
- Assert.AreEqual(22, r.GetCell(1).CellStyle.GetFont(wb).FontHeight);
+ ClassicAssert.AreEqual(22, ((HSSFCell)r.GetCell(1)).CellValueRecord.XFIndex);
+ ClassicAssert.AreEqual(22, r.GetCell(1).CellStyle.GetFont(wb).FontHeight);
// cs3 = cs1 -> 21
- Assert.AreEqual(21, ((HSSFCell)r.GetCell(2)).CellValueRecord.XFIndex);
+ ClassicAssert.AreEqual(21, ((HSSFCell)r.GetCell(2)).CellValueRecord.XFIndex);
// cs4 --> 24 -> 23
- Assert.AreEqual(23, ((HSSFCell)r.GetCell(3)).CellValueRecord.XFIndex);
+ ClassicAssert.AreEqual(23, ((HSSFCell)r.GetCell(3)).CellValueRecord.XFIndex);
// cs5 --> 25 -> 24
- Assert.AreEqual(24, ((HSSFCell)r.GetCell(4)).CellValueRecord.XFIndex);
+ ClassicAssert.AreEqual(24, ((HSSFCell)r.GetCell(4)).CellValueRecord.XFIndex);
// cs6 = cs2 -> 22
- Assert.AreEqual(22, ((HSSFCell)r.GetCell(5)).CellValueRecord.XFIndex);
+ ClassicAssert.AreEqual(22, ((HSSFCell)r.GetCell(5)).CellValueRecord.XFIndex);
// cs1 -> 21
- Assert.AreEqual(21, ((HSSFCell)r.GetCell(6)).CellValueRecord.XFIndex);
+ ClassicAssert.AreEqual(21, ((HSSFCell)r.GetCell(6)).CellValueRecord.XFIndex);
// cs2 -> 22
- Assert.AreEqual(22, ((HSSFCell)r.GetCell(7)).CellValueRecord.XFIndex);
+ ClassicAssert.AreEqual(22, ((HSSFCell)r.GetCell(7)).CellValueRecord.XFIndex);
// Add a new duplicate, and two that aren't used
@@ -275,18 +275,18 @@ public void TestOptimiseStyles()
csU2.SetFont(f4);
// Check before the optimise
- Assert.AreEqual(8, wb.NumberOfFonts);
- Assert.AreEqual(28, wb.NumCellStyles);
+ ClassicAssert.AreEqual(8, wb.NumberOfFonts);
+ ClassicAssert.AreEqual(28, wb.NumCellStyles);
// Optimise, should remove the two un-used ones and the one duplicate
HSSFOptimiser.OptimiseCellStyles(wb);
// Check
- Assert.AreEqual(8, wb.NumberOfFonts);
- Assert.AreEqual(25, wb.NumCellStyles);
+ ClassicAssert.AreEqual(8, wb.NumberOfFonts);
+ ClassicAssert.AreEqual(25, wb.NumCellStyles);
// csD -> cs1 -> 21
- Assert.AreEqual(21, ((HSSFCell)r.GetCell(8)).CellValueRecord.XFIndex);
+ ClassicAssert.AreEqual(21, ((HSSFCell)r.GetCell(8)).CellValueRecord.XFIndex);
}
[Test]
public void TestOptimiseStylesCheckActualStyles()
@@ -294,7 +294,7 @@ public void TestOptimiseStylesCheckActualStyles()
HSSFWorkbook wb = new HSSFWorkbook();
// Several styles
- Assert.AreEqual(21, wb.NumCellStyles);
+ ClassicAssert.AreEqual(21, wb.NumCellStyles);
HSSFCellStyle cs1 = (HSSFCellStyle)wb.CreateCellStyle();
cs1.BorderBottom=(BorderStyle.Thick);
@@ -305,7 +305,7 @@ public void TestOptimiseStylesCheckActualStyles()
HSSFCellStyle cs3 = (HSSFCellStyle)wb.CreateCellStyle(); // = cs1
cs3.BorderBottom=(BorderStyle.Thick);
- Assert.AreEqual(24, wb.NumCellStyles);
+ ClassicAssert.AreEqual(24, wb.NumCellStyles);
// Use them
HSSFSheet s = (HSSFSheet)wb.CreateSheet();
@@ -315,19 +315,19 @@ public void TestOptimiseStylesCheckActualStyles()
r.CreateCell(1).CellStyle=(cs2);
r.CreateCell(2).CellStyle=(cs3);
- Assert.AreEqual(21, ((HSSFCell)r.GetCell(0)).CellValueRecord.XFIndex);
- Assert.AreEqual(22, ((HSSFCell)r.GetCell(1)).CellValueRecord.XFIndex);
- Assert.AreEqual(23, ((HSSFCell)r.GetCell(2)).CellValueRecord.XFIndex);
+ ClassicAssert.AreEqual(21, ((HSSFCell)r.GetCell(0)).CellValueRecord.XFIndex);
+ ClassicAssert.AreEqual(22, ((HSSFCell)r.GetCell(1)).CellValueRecord.XFIndex);
+ ClassicAssert.AreEqual(23, ((HSSFCell)r.GetCell(2)).CellValueRecord.XFIndex);
// Optimise
HSSFOptimiser.OptimiseCellStyles(wb);
// Check
- Assert.AreEqual(23, wb.NumCellStyles);
+ ClassicAssert.AreEqual(23, wb.NumCellStyles);
- Assert.AreEqual(BorderStyle.Thick, r.GetCell(0).CellStyle.BorderBottom);
- Assert.AreEqual(BorderStyle.DashDot, r.GetCell(1).CellStyle.BorderBottom);
- Assert.AreEqual(BorderStyle.Thick, r.GetCell(2).CellStyle.BorderBottom);
+ ClassicAssert.AreEqual(BorderStyle.Thick, r.GetCell(0).CellStyle.BorderBottom);
+ ClassicAssert.AreEqual(BorderStyle.DashDot, r.GetCell(1).CellStyle.BorderBottom);
+ ClassicAssert.AreEqual(BorderStyle.Thick, r.GetCell(2).CellStyle.BorderBottom);
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/UserModel/TestHSSFPalette.cs b/testcases/main/HSSF/UserModel/TestHSSFPalette.cs
index e61e59458..34630fb93 100644
--- a/testcases/main/HSSF/UserModel/TestHSSFPalette.cs
+++ b/testcases/main/HSSF/UserModel/TestHSSFPalette.cs
@@ -25,7 +25,7 @@ namespace TestCases.HSSF.UserModel
using NPOI.Util;
using NPOI.HSSF.Util;
using TestCases.HSSF;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.SS.UserModel;
using SixLabors.ImageSharp.PixelFormats;
@@ -73,21 +73,21 @@ public void TestCustomPalette()
palette = book.GetCustomPalette();
HSSFColor color = palette.GetColor(HSSFColor.Coral.Index); //unmodified
- Assert.IsNotNull(color, "Unexpected null in custom palette (unmodified index)");
+ ClassicAssert.IsNotNull(color, "Unexpected null in custom palette (unmodified index)");
byte[] expectedRGB = HSSFColor.Coral.Triplet;
byte[] actualRGB = color.RGB;
String msg = "Expected palette position to remain unmodified";
- Assert.AreEqual(expectedRGB[0], actualRGB[0], msg);
- Assert.AreEqual(expectedRGB[1], actualRGB[1], msg);
- Assert.AreEqual(expectedRGB[2], actualRGB[2], msg);
+ ClassicAssert.AreEqual(expectedRGB[0], actualRGB[0], msg);
+ ClassicAssert.AreEqual(expectedRGB[1], actualRGB[1], msg);
+ ClassicAssert.AreEqual(expectedRGB[2], actualRGB[2], msg);
color = palette.GetColor((short)0x12);
- Assert.IsNotNull(color, "Unexpected null in custom palette (modified)");
+ ClassicAssert.IsNotNull(color, "Unexpected null in custom palette (modified)");
actualRGB = color.RGB;
msg = "Expected palette modification to be preserved across save";
- Assert.AreEqual((short)101, actualRGB[0], msg);
- Assert.AreEqual((short)230, actualRGB[1], msg);
- Assert.AreEqual((short)100, actualRGB[2], msg);
+ ClassicAssert.AreEqual((short)101, actualRGB[0], msg);
+ ClassicAssert.AreEqual((short)230, actualRGB[1], msg);
+ ClassicAssert.AreEqual((short)100, actualRGB[2], msg);
}
/**
@@ -107,49 +107,49 @@ public void TestPaletteFromCellColours()
ICell cellE = book.GetSheetAt(0).GetRow(4).GetCell(0);
// Plain
- Assert.AreEqual("I'm plain", cellA.StringCellValue);
- Assert.AreEqual(64, cellA.CellStyle.FillForegroundColor);
- Assert.AreEqual(64, cellA.CellStyle.FillBackgroundColor);
- Assert.AreEqual(HSSFColor.COLOR_NORMAL, cellA.CellStyle.GetFont(book).Color);
- Assert.AreEqual(0, (short)cellA.CellStyle.FillPattern);
- Assert.AreEqual("0:0:0", p.GetColor((short)64).GetHexString());
- Assert.AreEqual(null, p.GetColor((short)32767));
+ ClassicAssert.AreEqual("I'm plain", cellA.StringCellValue);
+ ClassicAssert.AreEqual(64, cellA.CellStyle.FillForegroundColor);
+ ClassicAssert.AreEqual(64, cellA.CellStyle.FillBackgroundColor);
+ ClassicAssert.AreEqual(HSSFColor.COLOR_NORMAL, cellA.CellStyle.GetFont(book).Color);
+ ClassicAssert.AreEqual(0, (short)cellA.CellStyle.FillPattern);
+ ClassicAssert.AreEqual("0:0:0", p.GetColor((short)64).GetHexString());
+ ClassicAssert.AreEqual(null, p.GetColor((short)32767));
// Red
- Assert.AreEqual("I'm red", cellB.StringCellValue);
- Assert.AreEqual(64, cellB.CellStyle.FillForegroundColor);
- Assert.AreEqual(64, cellB.CellStyle.FillBackgroundColor);
- Assert.AreEqual(10, cellB.CellStyle.GetFont(book).Color);
- Assert.AreEqual(0, (short)cellB.CellStyle.FillPattern);
- Assert.AreEqual("0:0:0", p.GetColor((short)64).GetHexString());
- Assert.AreEqual("FFFF:0:0", p.GetColor((short)10).GetHexString());
+ ClassicAssert.AreEqual("I'm red", cellB.StringCellValue);
+ ClassicAssert.AreEqual(64, cellB.CellStyle.FillForegroundColor);
+ ClassicAssert.AreEqual(64, cellB.CellStyle.FillBackgroundColor);
+ ClassicAssert.AreEqual(10, cellB.CellStyle.GetFont(book).Color);
+ ClassicAssert.AreEqual(0, (short)cellB.CellStyle.FillPattern);
+ ClassicAssert.AreEqual("0:0:0", p.GetColor((short)64).GetHexString());
+ ClassicAssert.AreEqual("FFFF:0:0", p.GetColor((short)10).GetHexString());
// Red + green bg
- Assert.AreEqual("I'm red with a green bg", cellC.StringCellValue);
- Assert.AreEqual(11, cellC.CellStyle.FillForegroundColor);
- Assert.AreEqual(64, cellC.CellStyle.FillBackgroundColor);
- Assert.AreEqual(10, cellC.CellStyle.GetFont(book).Color);
- Assert.AreEqual(1, (short)cellC.CellStyle.FillPattern);
- Assert.AreEqual("0:FFFF:0", p.GetColor((short)11).GetHexString());
- Assert.AreEqual("FFFF:0:0", p.GetColor((short)10).GetHexString());
+ ClassicAssert.AreEqual("I'm red with a green bg", cellC.StringCellValue);
+ ClassicAssert.AreEqual(11, cellC.CellStyle.FillForegroundColor);
+ ClassicAssert.AreEqual(64, cellC.CellStyle.FillBackgroundColor);
+ ClassicAssert.AreEqual(10, cellC.CellStyle.GetFont(book).Color);
+ ClassicAssert.AreEqual(1, (short)cellC.CellStyle.FillPattern);
+ ClassicAssert.AreEqual("0:FFFF:0", p.GetColor((short)11).GetHexString());
+ ClassicAssert.AreEqual("FFFF:0:0", p.GetColor((short)10).GetHexString());
// Pink with yellow
- Assert.AreEqual("I'm pink with a yellow pattern (none)", cellD.StringCellValue);
- Assert.AreEqual(13, cellD.CellStyle.FillForegroundColor);
- Assert.AreEqual(64, cellD.CellStyle.FillBackgroundColor);
- Assert.AreEqual(14, cellD.CellStyle.GetFont(book).Color);
- Assert.AreEqual(0, (short)cellD.CellStyle.FillPattern);
- Assert.AreEqual("FFFF:FFFF:0", p.GetColor((short)13).GetHexString());
- Assert.AreEqual("FFFF:0:FFFF", p.GetColor((short)14).GetHexString());
+ ClassicAssert.AreEqual("I'm pink with a yellow pattern (none)", cellD.StringCellValue);
+ ClassicAssert.AreEqual(13, cellD.CellStyle.FillForegroundColor);
+ ClassicAssert.AreEqual(64, cellD.CellStyle.FillBackgroundColor);
+ ClassicAssert.AreEqual(14, cellD.CellStyle.GetFont(book).Color);
+ ClassicAssert.AreEqual(0, (short)cellD.CellStyle.FillPattern);
+ ClassicAssert.AreEqual("FFFF:FFFF:0", p.GetColor((short)13).GetHexString());
+ ClassicAssert.AreEqual("FFFF:0:FFFF", p.GetColor((short)14).GetHexString());
// Pink with yellow - full
- Assert.AreEqual("I'm pink with a yellow pattern (full)", cellE.StringCellValue);
- Assert.AreEqual(13, cellE.CellStyle.FillForegroundColor);
- Assert.AreEqual(64, cellE.CellStyle.FillBackgroundColor);
- Assert.AreEqual(14, cellE.CellStyle.GetFont(book).Color);
- Assert.AreEqual(0, (short)cellE.CellStyle.FillPattern);
- Assert.AreEqual("FFFF:FFFF:0", p.GetColor((short)13).GetHexString());
- Assert.AreEqual("FFFF:0:FFFF", p.GetColor((short)14).GetHexString());
+ ClassicAssert.AreEqual("I'm pink with a yellow pattern (full)", cellE.StringCellValue);
+ ClassicAssert.AreEqual(13, cellE.CellStyle.FillForegroundColor);
+ ClassicAssert.AreEqual(64, cellE.CellStyle.FillBackgroundColor);
+ ClassicAssert.AreEqual(14, cellE.CellStyle.GetFont(book).Color);
+ ClassicAssert.AreEqual(0, (short)cellE.CellStyle.FillPattern);
+ ClassicAssert.AreEqual("FFFF:FFFF:0", p.GetColor((short)13).GetHexString());
+ ClassicAssert.AreEqual("FFFF:0:FFFF", p.GetColor((short)14).GetHexString());
}
[Test]
public void TestFindSimilar()
@@ -169,28 +169,28 @@ public void TestFindSimilar()
p.SetColorAtIndex((short)13, unchecked((byte)-4), (byte)0, (byte)0);
p.SetColorAtIndex((short)14, unchecked((byte)-8), (byte)0, (byte)0);
- Assert.AreEqual(
+ ClassicAssert.AreEqual(
"FFFF:0:0", p.GetColor((short)8).GetHexString()
);
// Now Check we get the right stuff back
- Assert.AreEqual(
+ ClassicAssert.AreEqual(
p.GetColor((short)8).GetHexString(),
p.FindSimilarColor(unchecked((byte)-1), (byte)0, (byte)0).GetHexString()
);
- Assert.AreEqual(
+ ClassicAssert.AreEqual(
p.GetColor((short)8).GetHexString(),
p.FindSimilarColor(unchecked((byte)-2), (byte)0, (byte)0).GetHexString()
);
- Assert.AreEqual(
+ ClassicAssert.AreEqual(
p.GetColor((short)8).GetHexString(),
p.FindSimilarColor(unchecked((byte)-1), (byte)1, (byte)0).GetHexString()
);
- Assert.AreEqual(
+ ClassicAssert.AreEqual(
p.GetColor((short)11).GetHexString(),
p.FindSimilarColor(unchecked((byte)-1), (byte)2, (byte)1).GetHexString()
);
- Assert.AreEqual(
+ ClassicAssert.AreEqual(
p.GetColor((short)12).GetHexString(),
p.FindSimilarColor(unchecked((byte)-1), (byte)2, (byte)10).GetHexString()
);
@@ -206,7 +206,7 @@ private class ColorComparator1 : ColorComparator
{
public void Compare(HSSFColor expected, HSSFColor palette)
{
- Assert.AreEqual(expected.GetHexString(), palette.GetHexString());
+ ClassicAssert.AreEqual(expected.GetHexString(), palette.GetHexString());
}
}
@@ -225,9 +225,9 @@ public void Compare(HSSFColor expected, HSSFColor palette)
{
byte[] s1 = expected.RGB;
byte[] s2 = palette.RGB;
- Assert.AreEqual(s1[0], s2[0]);
- Assert.AreEqual(s1[1], s2[1]);
- Assert.AreEqual(s1[2], s2[2]);
+ ClassicAssert.AreEqual(s1[0], s2[0]);
+ ClassicAssert.AreEqual(s1[1], s2[1]);
+ ClassicAssert.AreEqual(s1[2], s2[2]);
}
}
[Test]
@@ -281,15 +281,15 @@ public void Test48403()
HSSFPalette palette = wb.GetCustomPalette();
HSSFColor hssfColor = palette.FindColor(color.R, color.G, color.B);
- Assert.IsNull(hssfColor);
+ ClassicAssert.IsNull(hssfColor);
palette.SetColorAtIndex(
(short)(PaletteRecord.STANDARD_PALETTE_SIZE - 1),
(byte)color.R, (byte)color.G,
(byte)color.B);
hssfColor = palette.GetColor((short)(PaletteRecord.STANDARD_PALETTE_SIZE - 1));
- Assert.IsNotNull(hssfColor);
- Assert.AreEqual(55, hssfColor.Indexed);
+ ClassicAssert.IsNotNull(hssfColor);
+ ClassicAssert.AreEqual(55, hssfColor.Indexed);
CollectionAssert.AreEqual(new short[] { 0, 107, 107 }, hssfColor.GetTriplet());
wb.Close();
diff --git a/testcases/main/HSSF/UserModel/TestHSSFPatriarch.cs b/testcases/main/HSSF/UserModel/TestHSSFPatriarch.cs
index a04342652..d1353cc78 100644
--- a/testcases/main/HSSF/UserModel/TestHSSFPatriarch.cs
+++ b/testcases/main/HSSF/UserModel/TestHSSFPatriarch.cs
@@ -20,7 +20,7 @@ namespace TestCases.HSSF.UserModel
using System;
using NPOI.HSSF.UserModel;
using TestCases.HSSF;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.SS.UserModel;
/**
@@ -38,7 +38,7 @@ public void TestBasic()
IDrawing patr = sheet.CreateDrawingPatriarch();
- Assert.IsNotNull(patr);
+ ClassicAssert.IsNotNull(patr);
// assert something more interesting
}
@@ -74,7 +74,7 @@ public void Test44916()
// 4. Try to re-use patriarch later
existingPatr = sheet.DrawingPatriarch;
- Assert.IsNotNull(existingPatr);
+ ClassicAssert.IsNotNull(existingPatr);
}
}
diff --git a/testcases/main/HSSF/UserModel/TestHSSFPicture.cs b/testcases/main/HSSF/UserModel/TestHSSFPicture.cs
index 7d29c8bfa..e6aade582 100644
--- a/testcases/main/HSSF/UserModel/TestHSSFPicture.cs
+++ b/testcases/main/HSSF/UserModel/TestHSSFPicture.cs
@@ -24,7 +24,7 @@ namespace TestCases.HSSF.UserModel
using NPOI.HSSF.UserModel;
using NPOI.SS.UserModel;
using NPOI.Util;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using TestCases.SS.UserModel;
/**
@@ -79,92 +79,92 @@ public void AddPictures()
ISheet sh = wb.CreateSheet("Pictures");
IDrawing dr = sh.CreateDrawingPatriarch();
- Assert.AreEqual(0, ((HSSFPatriarch)dr).Children.Count);
+ ClassicAssert.AreEqual(0, ((HSSFPatriarch)dr).Children.Count);
IClientAnchor anchor = wb.GetCreationHelper().CreateClientAnchor();
//register a picture
byte[] data1 = new byte[] { 1, 2, 3 };
int idx1 = wb.AddPicture(data1, PictureType.JPEG);
- Assert.AreEqual(1, idx1);
+ ClassicAssert.AreEqual(1, idx1);
IPicture p1 = dr.CreatePicture(anchor, idx1);
- Assert.IsTrue(Arrays.Equals(data1, ((HSSFPicture)p1).PictureData.Data));
+ ClassicAssert.IsTrue(Arrays.Equals(data1, ((HSSFPicture)p1).PictureData.Data));
// register another one
byte[] data2 = new byte[] { 4, 5, 6 };
int idx2 = wb.AddPicture(data2, PictureType.JPEG);
- Assert.AreEqual(2, idx2);
+ ClassicAssert.AreEqual(2, idx2);
IPicture p2 = dr.CreatePicture(anchor, idx2);
- Assert.AreEqual(2, ((HSSFPatriarch)dr).Children.Count);
- Assert.IsTrue(Arrays.Equals(data2, ((HSSFPicture)p2).PictureData.Data));
+ ClassicAssert.AreEqual(2, ((HSSFPatriarch)dr).Children.Count);
+ ClassicAssert.IsTrue(Arrays.Equals(data2, ((HSSFPicture)p2).PictureData.Data));
// confirm that HSSFPatriarch.Children returns two picture shapes
- Assert.IsTrue(Arrays.Equals(data1, ((HSSFPicture)((HSSFPatriarch)dr).Children[(0)]).PictureData.Data));
- Assert.IsTrue(Arrays.Equals(data2, ((HSSFPicture)((HSSFPatriarch)dr).Children[(1)]).PictureData.Data));
+ ClassicAssert.IsTrue(Arrays.Equals(data1, ((HSSFPicture)((HSSFPatriarch)dr).Children[(0)]).PictureData.Data));
+ ClassicAssert.IsTrue(Arrays.Equals(data2, ((HSSFPicture)((HSSFPatriarch)dr).Children[(1)]).PictureData.Data));
// Write, read back and verify that our pictures are there
wb = HSSFTestDataSamples.WriteOutAndReadBack((HSSFWorkbook)wb);
IList lst2 = wb.GetAllPictures();
- Assert.AreEqual(2, lst2.Count);
- Assert.IsTrue(Arrays.Equals(data1, (lst2[(0)] as HSSFPictureData).Data));
- Assert.IsTrue(Arrays.Equals(data2, (lst2[(1)] as HSSFPictureData).Data));
+ ClassicAssert.AreEqual(2, lst2.Count);
+ ClassicAssert.IsTrue(Arrays.Equals(data1, (lst2[(0)] as HSSFPictureData).Data));
+ ClassicAssert.IsTrue(Arrays.Equals(data2, (lst2[(1)] as HSSFPictureData).Data));
// confirm that the pictures are in the Sheet's Drawing
sh = wb.GetSheet("Pictures");
dr = sh.CreateDrawingPatriarch();
- Assert.AreEqual(2, ((HSSFPatriarch)dr).Children.Count);
- Assert.IsTrue(Arrays.Equals(data1, ((HSSFPicture)((HSSFPatriarch)dr).Children[(0)]).PictureData.Data));
- Assert.IsTrue(Arrays.Equals(data2, ((HSSFPicture)((HSSFPatriarch)dr).Children[(1)]).PictureData.Data));
+ ClassicAssert.AreEqual(2, ((HSSFPatriarch)dr).Children.Count);
+ ClassicAssert.IsTrue(Arrays.Equals(data1, ((HSSFPicture)((HSSFPatriarch)dr).Children[(0)]).PictureData.Data));
+ ClassicAssert.IsTrue(Arrays.Equals(data2, ((HSSFPicture)((HSSFPatriarch)dr).Children[(1)]).PictureData.Data));
// add a third picture
byte[] data3 = new byte[] { 7, 8, 9 };
// picture index must increment across Write-read
int idx3 = wb.AddPicture(data3, PictureType.JPEG);
- Assert.AreEqual(3, idx3);
+ ClassicAssert.AreEqual(3, idx3);
IPicture p3 = dr.CreatePicture(anchor, idx3);
- Assert.IsTrue(Arrays.Equals(data3, ((HSSFPicture)p3).PictureData.Data));
- Assert.AreEqual(3, ((HSSFPatriarch)dr).Children.Count);
- Assert.IsTrue(Arrays.Equals(data1, ((HSSFPicture)((HSSFPatriarch)dr).Children[(0)]).PictureData.Data));
- Assert.IsTrue(Arrays.Equals(data2, ((HSSFPicture)((HSSFPatriarch)dr).Children[(1)]).PictureData.Data));
- Assert.IsTrue(Arrays.Equals(data3, ((HSSFPicture)((HSSFPatriarch)dr).Children[(2)]).PictureData.Data));
+ ClassicAssert.IsTrue(Arrays.Equals(data3, ((HSSFPicture)p3).PictureData.Data));
+ ClassicAssert.AreEqual(3, ((HSSFPatriarch)dr).Children.Count);
+ ClassicAssert.IsTrue(Arrays.Equals(data1, ((HSSFPicture)((HSSFPatriarch)dr).Children[(0)]).PictureData.Data));
+ ClassicAssert.IsTrue(Arrays.Equals(data2, ((HSSFPicture)((HSSFPatriarch)dr).Children[(1)]).PictureData.Data));
+ ClassicAssert.IsTrue(Arrays.Equals(data3, ((HSSFPicture)((HSSFPatriarch)dr).Children[(2)]).PictureData.Data));
// write and read again
wb = HSSFTestDataSamples.WriteOutAndReadBack((HSSFWorkbook)wb);
IList lst3 = wb.GetAllPictures();
// all three should be there
- Assert.AreEqual(3, lst3.Count);
- Assert.IsTrue(Arrays.Equals(data1, (lst3[(0)] as HSSFPictureData).Data));
- Assert.IsTrue(Arrays.Equals(data2, (lst3[(1)] as HSSFPictureData).Data));
- Assert.IsTrue(Arrays.Equals(data3, (lst3[(2)] as HSSFPictureData).Data));
+ ClassicAssert.AreEqual(3, lst3.Count);
+ ClassicAssert.IsTrue(Arrays.Equals(data1, (lst3[(0)] as HSSFPictureData).Data));
+ ClassicAssert.IsTrue(Arrays.Equals(data2, (lst3[(1)] as HSSFPictureData).Data));
+ ClassicAssert.IsTrue(Arrays.Equals(data3, (lst3[(2)] as HSSFPictureData).Data));
sh = wb.GetSheet("Pictures");
dr = sh.CreateDrawingPatriarch();
- Assert.AreEqual(3, ((HSSFPatriarch)dr).Children.Count);
+ ClassicAssert.AreEqual(3, ((HSSFPatriarch)dr).Children.Count);
// forth picture
byte[] data4 = new byte[] { 10, 11, 12 };
int idx4 = wb.AddPicture(data4, PictureType.JPEG);
- Assert.AreEqual(4, idx4);
+ ClassicAssert.AreEqual(4, idx4);
dr.CreatePicture(anchor, idx4);
- Assert.AreEqual(4, ((HSSFPatriarch)dr).Children.Count);
- Assert.IsTrue(Arrays.Equals(data1, ((HSSFPicture)((HSSFPatriarch)dr).Children[(0)]).PictureData.Data));
- Assert.IsTrue(Arrays.Equals(data2, ((HSSFPicture)((HSSFPatriarch)dr).Children[(1)]).PictureData.Data));
- Assert.IsTrue(Arrays.Equals(data3, ((HSSFPicture)((HSSFPatriarch)dr).Children[(2)]).PictureData.Data));
- Assert.IsTrue(Arrays.Equals(data4, ((HSSFPicture)((HSSFPatriarch)dr).Children[(3)]).PictureData.Data));
+ ClassicAssert.AreEqual(4, ((HSSFPatriarch)dr).Children.Count);
+ ClassicAssert.IsTrue(Arrays.Equals(data1, ((HSSFPicture)((HSSFPatriarch)dr).Children[(0)]).PictureData.Data));
+ ClassicAssert.IsTrue(Arrays.Equals(data2, ((HSSFPicture)((HSSFPatriarch)dr).Children[(1)]).PictureData.Data));
+ ClassicAssert.IsTrue(Arrays.Equals(data3, ((HSSFPicture)((HSSFPatriarch)dr).Children[(2)]).PictureData.Data));
+ ClassicAssert.IsTrue(Arrays.Equals(data4, ((HSSFPicture)((HSSFPatriarch)dr).Children[(3)]).PictureData.Data));
wb = HSSFTestDataSamples.WriteOutAndReadBack((HSSFWorkbook)wb);
IList lst4 = wb.GetAllPictures();
- Assert.AreEqual(4, lst4.Count);
- Assert.IsTrue(Arrays.Equals(data1, (lst4[(0)] as HSSFPictureData).Data));
- Assert.IsTrue(Arrays.Equals(data2, (lst4[(1)] as HSSFPictureData).Data));
- Assert.IsTrue(Arrays.Equals(data3, (lst4[(2)] as HSSFPictureData).Data));
- Assert.IsTrue(Arrays.Equals(data4, (lst4[(3)] as HSSFPictureData).Data));
+ ClassicAssert.AreEqual(4, lst4.Count);
+ ClassicAssert.IsTrue(Arrays.Equals(data1, (lst4[(0)] as HSSFPictureData).Data));
+ ClassicAssert.IsTrue(Arrays.Equals(data2, (lst4[(1)] as HSSFPictureData).Data));
+ ClassicAssert.IsTrue(Arrays.Equals(data3, (lst4[(2)] as HSSFPictureData).Data));
+ ClassicAssert.IsTrue(Arrays.Equals(data4, (lst4[(3)] as HSSFPictureData).Data));
sh = wb.GetSheet("Pictures");
dr = sh.CreateDrawingPatriarch();
- Assert.AreEqual(4, ((HSSFPatriarch)dr).Children.Count);
- Assert.IsTrue(Arrays.Equals(data1, ((HSSFPicture)((HSSFPatriarch)dr).Children[(0)]).PictureData.Data));
- Assert.IsTrue(Arrays.Equals(data2, ((HSSFPicture)((HSSFPatriarch)dr).Children[(1)]).PictureData.Data));
- Assert.IsTrue(Arrays.Equals(data3, ((HSSFPicture)((HSSFPatriarch)dr).Children[(2)]).PictureData.Data));
- Assert.IsTrue(Arrays.Equals(data4, ((HSSFPicture)((HSSFPatriarch)dr).Children[(3)]).PictureData.Data));
+ ClassicAssert.AreEqual(4, ((HSSFPatriarch)dr).Children.Count);
+ ClassicAssert.IsTrue(Arrays.Equals(data1, ((HSSFPicture)((HSSFPatriarch)dr).Children[(0)]).PictureData.Data));
+ ClassicAssert.IsTrue(Arrays.Equals(data2, ((HSSFPicture)((HSSFPatriarch)dr).Children[(1)]).PictureData.Data));
+ ClassicAssert.IsTrue(Arrays.Equals(data3, ((HSSFPicture)((HSSFPatriarch)dr).Children[(2)]).PictureData.Data));
+ ClassicAssert.IsTrue(Arrays.Equals(data4, ((HSSFPicture)((HSSFPatriarch)dr).Children[(3)]).PictureData.Data));
wb.Close();
}
@@ -182,18 +182,18 @@ public void BSEPictureRef()
//register a picture
byte[] data1 = new byte[] { 1, 2, 3 };
int idx1 = wb.AddPicture(data1, PictureType.JPEG);
- Assert.AreEqual(1, idx1);
+ ClassicAssert.AreEqual(1, idx1);
HSSFPicture p1 = dr.CreatePicture(anchor, idx1) as HSSFPicture;
EscherBSERecord bse = wb.Workbook.GetBSERecord(idx1);
- Assert.AreEqual(bse.Ref, 1);
+ ClassicAssert.AreEqual(bse.Ref, 1);
dr.CreatePicture(new HSSFClientAnchor(), idx1);
- Assert.AreEqual(bse.Ref, 2);
+ ClassicAssert.AreEqual(bse.Ref, 2);
HSSFShapeGroup gr = dr.CreateGroup(new HSSFClientAnchor());
gr.CreatePicture(new HSSFChildAnchor(), idx1);
- Assert.AreEqual(bse.Ref, 3);
+ ClassicAssert.AreEqual(bse.Ref, 3);
}
[Test]
public void ReadExistingImage()
@@ -201,10 +201,10 @@ public void ReadExistingImage()
HSSFWorkbook wb = HSSFTestDataSamples.OpenSampleWorkbook("drawings.xls");
HSSFSheet sheet = wb.GetSheet("picture") as HSSFSheet;
HSSFPatriarch Drawing = sheet.DrawingPatriarch as HSSFPatriarch;
- Assert.AreEqual(1, Drawing.Children.Count);
+ ClassicAssert.AreEqual(1, Drawing.Children.Count);
HSSFPicture picture = (HSSFPicture)Drawing.Children[0];
- Assert.AreEqual(picture.FileName, "test");
+ ClassicAssert.AreEqual(picture.FileName, "test");
wb.Close();
}
@@ -222,16 +222,16 @@ public void SetGetProperties()
int idx1 = wb.AddPicture(data1, PictureType.JPEG);
HSSFPicture p1 = dr.CreatePicture(anchor, idx1) as HSSFPicture;
- Assert.AreEqual(p1.FileName, "");
+ ClassicAssert.AreEqual(p1.FileName, "");
p1.FileName = ("aaa");
- Assert.AreEqual(p1.FileName, "aaa");
+ ClassicAssert.AreEqual(p1.FileName, "aaa");
wb = HSSFTestDataSamples.WriteOutAndReadBack(wb);
sh = wb.GetSheet("Pictures") as HSSFSheet;
dr = sh.DrawingPatriarch as HSSFPatriarch;
p1 = (HSSFPicture)dr.Children[0];
- Assert.AreEqual(p1.FileName, "aaa");
+ ClassicAssert.AreEqual(p1.FileName, "aaa");
wb.Close();
}
@@ -277,12 +277,12 @@ public void Bug49658()
wb = HSSFTestDataSamples.WriteOutAndReadBack(wb as HSSFWorkbook);
byte[] pictureDataOut = (wb.GetAllPictures()[0] as HSSFPictureData).Data;
- Assert.IsTrue(Arrays.Equals(pictureDataEmf, pictureDataOut));
+ ClassicAssert.IsTrue(Arrays.Equals(pictureDataEmf, pictureDataOut));
byte[] wmfNoHeader = new byte[pictureDataWmf.Length - 22];
Array.Copy(pictureDataWmf, 22, wmfNoHeader, 0, pictureDataWmf.Length - 22);
pictureDataOut = (wb.GetAllPictures()[2] as HSSFPictureData).Data;
- Assert.IsTrue(Arrays.Equals(wmfNoHeader, pictureDataOut));
+ ClassicAssert.IsTrue(Arrays.Equals(wmfNoHeader, pictureDataOut));
wb.Close();
}
diff --git a/testcases/main/HSSF/UserModel/TestHSSFPictureData.cs b/testcases/main/HSSF/UserModel/TestHSSFPictureData.cs
index 2f365088f..70785ef2a 100644
--- a/testcases/main/HSSF/UserModel/TestHSSFPictureData.cs
+++ b/testcases/main/HSSF/UserModel/TestHSSFPictureData.cs
@@ -21,7 +21,7 @@ namespace TestCases.HSSF.UserModel
using System;
using System.Collections;
using NPOI.HSSF.UserModel;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using System.IO;
using TestCases.HSSF;
using NPOI.SS.UserModel;
@@ -46,7 +46,7 @@ public void TestPictures()
HSSFWorkbook wb = HSSFTestDataSamples.OpenSampleWorkbook("SimpleWithImages.xls");
IList lst = wb.GetAllPictures();
- //Assert.AreEqual(2, lst.Count);
+ //ClassicAssert.AreEqual(2, lst.Count);
for (IEnumerator it = lst.GetEnumerator(); it.MoveNext(); )
{
@@ -57,17 +57,17 @@ public void TestPictures()
{
//try to read image data using javax.imageio.* (JDK 1.4+)
Image jpg = Image.Load(new MemoryStream(data));
- Assert.IsNotNull(jpg);
- Assert.AreEqual(192, jpg.Width);
- Assert.AreEqual(176, jpg.Height);
+ ClassicAssert.IsNotNull(jpg);
+ ClassicAssert.AreEqual(192, jpg.Width);
+ ClassicAssert.AreEqual(176, jpg.Height);
}
else if (ext.Equals("png"))
{
//try to read image data using javax.imageio.* (JDK 1.4+)
Image png = Image.Load(new MemoryStream(data));
- Assert.IsNotNull(png);
- Assert.AreEqual(300, png.Width);
- Assert.AreEqual(300, png.Height);
+ ClassicAssert.IsNotNull(png);
+ ClassicAssert.AreEqual(300, png.Width);
+ ClassicAssert.AreEqual(300, png.Height);
}
else
{
@@ -81,7 +81,7 @@ public void TestMacPicture()
HSSFWorkbook wb = HSSFTestDataSamples.OpenSampleWorkbook("53446.xls");
List lst = (List)wb.GetAllPictures();
- Assert.AreEqual(1, lst.Count);
+ ClassicAssert.AreEqual(1, lst.Count);
HSSFPictureData pict = lst[(0)];
String ext = pict.SuggestFileExtension();
@@ -95,11 +95,11 @@ public void TestMacPicture()
using (MemoryStream ms = new MemoryStream(data))
{
Image png = Image.Load(ms);
- Assert.IsNotNull(png);
- Assert.AreEqual(78, png.Width);
- Assert.AreEqual(76, png.Height);
- Assert.AreEqual((int)PictureType.PNG, pict.Format);
- Assert.AreEqual("image/png", pict.MimeType);
+ ClassicAssert.IsNotNull(png);
+ ClassicAssert.AreEqual(78, png.Width);
+ ClassicAssert.AreEqual(76, png.Height);
+ ClassicAssert.AreEqual((int)PictureType.PNG, pict.Format);
+ ClassicAssert.AreEqual("image/png", pict.MimeType);
}
}
@@ -113,7 +113,7 @@ public void TestNotNullPictures()
List lst = (List)wb.GetAllPictures();
foreach (HSSFPictureData pict in lst)
{
- Assert.IsNotNull(pict);
+ ClassicAssert.IsNotNull(pict);
}
}
}
diff --git a/testcases/main/HSSF/UserModel/TestHSSFRichTextString.cs b/testcases/main/HSSF/UserModel/TestHSSFRichTextString.cs
index ac9a47dd1..09b7f223d 100644
--- a/testcases/main/HSSF/UserModel/TestHSSFRichTextString.cs
+++ b/testcases/main/HSSF/UserModel/TestHSSFRichTextString.cs
@@ -21,7 +21,7 @@ namespace TestCases.HSSF.UserModel
using NPOI.HSSF.UserModel;
using System.IO;
using TestCases.HSSF;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.SS.UserModel;
@@ -33,42 +33,42 @@ public void TestApplyFont()
{
HSSFRichTextString r = new HSSFRichTextString("Testing");
- Assert.AreEqual(0, r.NumFormattingRuns);
+ ClassicAssert.AreEqual(0, r.NumFormattingRuns);
r.ApplyFont(2, 4, new HSSFFont((short)1, null));
- Assert.AreEqual(2, r.NumFormattingRuns);
- Assert.AreEqual(HSSFRichTextString.NO_FONT, r.GetFontAtIndex(0));
- Assert.AreEqual(HSSFRichTextString.NO_FONT, r.GetFontAtIndex(1));
- Assert.AreEqual(1, r.GetFontAtIndex(2));
- Assert.AreEqual(1, r.GetFontAtIndex(3));
- Assert.AreEqual(HSSFRichTextString.NO_FONT, r.GetFontAtIndex(4));
- Assert.AreEqual(HSSFRichTextString.NO_FONT, r.GetFontAtIndex(5));
- Assert.AreEqual(HSSFRichTextString.NO_FONT, r.GetFontAtIndex(6));
+ ClassicAssert.AreEqual(2, r.NumFormattingRuns);
+ ClassicAssert.AreEqual(HSSFRichTextString.NO_FONT, r.GetFontAtIndex(0));
+ ClassicAssert.AreEqual(HSSFRichTextString.NO_FONT, r.GetFontAtIndex(1));
+ ClassicAssert.AreEqual(1, r.GetFontAtIndex(2));
+ ClassicAssert.AreEqual(1, r.GetFontAtIndex(3));
+ ClassicAssert.AreEqual(HSSFRichTextString.NO_FONT, r.GetFontAtIndex(4));
+ ClassicAssert.AreEqual(HSSFRichTextString.NO_FONT, r.GetFontAtIndex(5));
+ ClassicAssert.AreEqual(HSSFRichTextString.NO_FONT, r.GetFontAtIndex(6));
r.ApplyFont(6, 7, new HSSFFont((short)2, null));
- Assert.AreEqual(HSSFRichTextString.NO_FONT, r.GetFontAtIndex(0));
- Assert.AreEqual(HSSFRichTextString.NO_FONT, r.GetFontAtIndex(1));
- Assert.AreEqual(1, r.GetFontAtIndex(2));
- Assert.AreEqual(1, r.GetFontAtIndex(3));
- Assert.AreEqual(HSSFRichTextString.NO_FONT, r.GetFontAtIndex(4));
- Assert.AreEqual(HSSFRichTextString.NO_FONT, r.GetFontAtIndex(5));
- Assert.AreEqual(2, r.GetFontAtIndex(6));
+ ClassicAssert.AreEqual(HSSFRichTextString.NO_FONT, r.GetFontAtIndex(0));
+ ClassicAssert.AreEqual(HSSFRichTextString.NO_FONT, r.GetFontAtIndex(1));
+ ClassicAssert.AreEqual(1, r.GetFontAtIndex(2));
+ ClassicAssert.AreEqual(1, r.GetFontAtIndex(3));
+ ClassicAssert.AreEqual(HSSFRichTextString.NO_FONT, r.GetFontAtIndex(4));
+ ClassicAssert.AreEqual(HSSFRichTextString.NO_FONT, r.GetFontAtIndex(5));
+ ClassicAssert.AreEqual(2, r.GetFontAtIndex(6));
r.ApplyFont(HSSFRichTextString.NO_FONT);
- Assert.AreEqual(HSSFRichTextString.NO_FONT, r.GetFontAtIndex(0));
- Assert.AreEqual(HSSFRichTextString.NO_FONT, r.GetFontAtIndex(1));
- Assert.AreEqual(HSSFRichTextString.NO_FONT, r.GetFontAtIndex(2));
- Assert.AreEqual(HSSFRichTextString.NO_FONT, r.GetFontAtIndex(3));
- Assert.AreEqual(HSSFRichTextString.NO_FONT, r.GetFontAtIndex(4));
- Assert.AreEqual(HSSFRichTextString.NO_FONT, r.GetFontAtIndex(5));
+ ClassicAssert.AreEqual(HSSFRichTextString.NO_FONT, r.GetFontAtIndex(0));
+ ClassicAssert.AreEqual(HSSFRichTextString.NO_FONT, r.GetFontAtIndex(1));
+ ClassicAssert.AreEqual(HSSFRichTextString.NO_FONT, r.GetFontAtIndex(2));
+ ClassicAssert.AreEqual(HSSFRichTextString.NO_FONT, r.GetFontAtIndex(3));
+ ClassicAssert.AreEqual(HSSFRichTextString.NO_FONT, r.GetFontAtIndex(4));
+ ClassicAssert.AreEqual(HSSFRichTextString.NO_FONT, r.GetFontAtIndex(5));
r.ApplyFont(new HSSFFont((short)1, null));
- Assert.AreEqual(1, r.GetFontAtIndex(0));
- Assert.AreEqual(1, r.GetFontAtIndex(1));
- Assert.AreEqual(1, r.GetFontAtIndex(2));
- Assert.AreEqual(1, r.GetFontAtIndex(3));
- Assert.AreEqual(1, r.GetFontAtIndex(4));
- Assert.AreEqual(1, r.GetFontAtIndex(5));
- Assert.AreEqual(1, r.GetFontAtIndex(6));
+ ClassicAssert.AreEqual(1, r.GetFontAtIndex(0));
+ ClassicAssert.AreEqual(1, r.GetFontAtIndex(1));
+ ClassicAssert.AreEqual(1, r.GetFontAtIndex(2));
+ ClassicAssert.AreEqual(1, r.GetFontAtIndex(3));
+ ClassicAssert.AreEqual(1, r.GetFontAtIndex(4));
+ ClassicAssert.AreEqual(1, r.GetFontAtIndex(5));
+ ClassicAssert.AreEqual(1, r.GetFontAtIndex(6));
}
[Test]
@@ -76,11 +76,11 @@ public void TestClearFormatting()
{
HSSFRichTextString r = new HSSFRichTextString("Testing");
- Assert.AreEqual(0, r.NumFormattingRuns);
+ ClassicAssert.AreEqual(0, r.NumFormattingRuns);
r.ApplyFont(2, 4, new HSSFFont((short)1, null));
- Assert.AreEqual(2, r.NumFormattingRuns);
+ ClassicAssert.AreEqual(2, r.NumFormattingRuns);
r.ClearFormatting();
- Assert.AreEqual(0, r.NumFormattingRuns);
+ ClassicAssert.AreEqual(0, r.NumFormattingRuns);
}
/**
* Test case proposed in Bug 40520: formated twice => will format whole String
@@ -96,9 +96,9 @@ public void Test40520_1()
r.ApplyFont(0, 7, font);
r.ApplyFont(5, 9, font);
- for (int i = 0; i < 7; i++) Assert.AreEqual(font, r.GetFontAtIndex(i));
- for (int i = 5; i < 9; i++) Assert.AreEqual(font, r.GetFontAtIndex(i));
- for (int i = 9; i < r.Length; i++) Assert.AreEqual(HSSFRichTextString.NO_FONT, r.GetFontAtIndex(i));
+ for (int i = 0; i < 7; i++) ClassicAssert.AreEqual(font, r.GetFontAtIndex(i));
+ for (int i = 5; i < 9; i++) ClassicAssert.AreEqual(font, r.GetFontAtIndex(i));
+ for (int i = 9; i < r.Length; i++) ClassicAssert.AreEqual(HSSFRichTextString.NO_FONT, r.GetFontAtIndex(i));
}
/**
@@ -112,12 +112,12 @@ public void Test40520_2()
HSSFRichTextString r = new HSSFRichTextString("f0_123456789012345678901234567890123456789012345678901234567890");
r.ApplyFont(0, 2, font);
- for (int i = 0; i < 2; i++) Assert.AreEqual(font, r.GetFontAtIndex(i));
- for (int i = 2; i < r.Length; i++) Assert.AreEqual(HSSFRichTextString.NO_FONT, r.GetFontAtIndex(i));
+ for (int i = 0; i < 2; i++) ClassicAssert.AreEqual(font, r.GetFontAtIndex(i));
+ for (int i = 2; i < r.Length; i++) ClassicAssert.AreEqual(HSSFRichTextString.NO_FONT, r.GetFontAtIndex(i));
r.ApplyFont(0, 2, font);
- for (int i = 0; i < 2; i++) Assert.AreEqual(font, r.GetFontAtIndex(i));
- for (int i = 2; i < r.Length; i++) Assert.AreEqual(HSSFRichTextString.NO_FONT, r.GetFontAtIndex(i));
+ for (int i = 0; i < 2; i++) ClassicAssert.AreEqual(font, r.GetFontAtIndex(i));
+ for (int i = 2; i < r.Length; i++) ClassicAssert.AreEqual(HSSFRichTextString.NO_FONT, r.GetFontAtIndex(i));
}
/**
@@ -136,10 +136,10 @@ public void Test40520_3()
r.ApplyFont(0, 2, font);
r.ApplyFont(0, 2, font);
- for (int i = 0; i < 2; i++) Assert.AreEqual(font, r.GetFontAtIndex(i));
- for (int i = 2; i < 5; i++) Assert.AreEqual(HSSFRichTextString.NO_FONT, r.GetFontAtIndex(i));
- for (int i = 5; i < 7; i++) Assert.AreEqual(font, r.GetFontAtIndex(i));
- for (int i = 7; i < r.Length; i++) Assert.AreEqual(HSSFRichTextString.NO_FONT, r.GetFontAtIndex(i));
+ for (int i = 0; i < 2; i++) ClassicAssert.AreEqual(font, r.GetFontAtIndex(i));
+ for (int i = 2; i < 5; i++) ClassicAssert.AreEqual(HSSFRichTextString.NO_FONT, r.GetFontAtIndex(i));
+ for (int i = 5; i < 7; i++) ClassicAssert.AreEqual(font, r.GetFontAtIndex(i));
+ for (int i = 7; i < r.Length; i++) ClassicAssert.AreEqual(HSSFRichTextString.NO_FONT, r.GetFontAtIndex(i));
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/UserModel/TestHSSFRow.cs b/testcases/main/HSSF/UserModel/TestHSSFRow.cs
index 643b8035a..4141bbf01 100644
--- a/testcases/main/HSSF/UserModel/TestHSSFRow.cs
+++ b/testcases/main/HSSF/UserModel/TestHSSFRow.cs
@@ -19,7 +19,7 @@ namespace TestCases.HSSF.UserModel
{
using System;
using NPOI.HSSF.UserModel;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using TestCases.HSSF;
using NPOI.SS.UserModel;
@@ -75,11 +75,11 @@ public void TestLastAndFirstColumns_bug46654()
{
Assert.Fail("Identified bug 46654a");
}
- Assert.AreEqual(COL_IX, row.FirstCellNum);
- Assert.AreEqual(COL_IX + 1, row.LastCellNum);
+ ClassicAssert.AreEqual(COL_IX, row.FirstCellNum);
+ ClassicAssert.AreEqual(COL_IX + 1, row.LastCellNum);
row.RemoveCell(cell);
- Assert.AreEqual(-1, row.FirstCellNum);
- Assert.AreEqual(-1, row.LastCellNum);
+ ClassicAssert.AreEqual(-1, row.FirstCellNum);
+ ClassicAssert.AreEqual(-1, row.LastCellNum);
workbook.Close();
}
@@ -92,17 +92,17 @@ public void TestMoveCell()
IRow rowB = sheet.CreateRow(1);
ICell cellA2 = rowB.CreateCell(0);
- Assert.AreEqual(0, rowB.FirstCellNum);
- Assert.AreEqual(0, rowB.FirstCellNum);
+ ClassicAssert.AreEqual(0, rowB.FirstCellNum);
+ ClassicAssert.AreEqual(0, rowB.FirstCellNum);
- Assert.AreEqual(-1, row.LastCellNum);
- Assert.AreEqual(-1, row.FirstCellNum);
+ ClassicAssert.AreEqual(-1, row.LastCellNum);
+ ClassicAssert.AreEqual(-1, row.FirstCellNum);
ICell cellB2 = row.CreateCell(1);
ICell cellB3 = row.CreateCell(2);
ICell cellB4 = row.CreateCell(3);
- Assert.AreEqual(1, row.FirstCellNum);
- Assert.AreEqual(4, row.LastCellNum);
+ ClassicAssert.AreEqual(1, row.FirstCellNum);
+ ClassicAssert.AreEqual(4, row.LastCellNum);
// Try to move to somewhere else that's used
try
@@ -127,14 +127,14 @@ public void TestMoveCell()
}
// Move somewhere spare
- Assert.IsNotNull(row.GetCell(1));
+ ClassicAssert.IsNotNull(row.GetCell(1));
row.MoveCell(cellB2, (short)5);
- Assert.IsNull(row.GetCell(1));
- Assert.IsNotNull(row.GetCell(5));
+ ClassicAssert.IsNull(row.GetCell(1));
+ ClassicAssert.IsNotNull(row.GetCell(5));
- Assert.AreEqual(5, cellB2.ColumnIndex);
- Assert.AreEqual(2, row.FirstCellNum);
- Assert.AreEqual(6, row.LastCellNum);
+ ClassicAssert.AreEqual(5, cellB2.ColumnIndex);
+ ClassicAssert.AreEqual(2, row.FirstCellNum);
+ ClassicAssert.AreEqual(6, row.LastCellNum);
workbook.Close();
}
@@ -146,28 +146,28 @@ public void TestMoveCell()
HSSFSheet sheet = workbook.CreateSheet() as HSSFSheet;
HSSFRow row = sheet.CreateRow(0) as HSSFRow;
- Assert.AreEqual(row.Height, sheet.DefaultRowHeight);
- Assert.IsFalse(row.RowRecord.BadFontHeight);
+ ClassicAssert.AreEqual(row.Height, sheet.DefaultRowHeight);
+ ClassicAssert.IsFalse(row.RowRecord.BadFontHeight);
row.Height=((short)123);
- Assert.AreEqual(123, row.Height);
- Assert.IsTrue(row.RowRecord.BadFontHeight);
+ ClassicAssert.AreEqual(123, row.Height);
+ ClassicAssert.IsTrue(row.RowRecord.BadFontHeight);
row.Height = ((short)-1);
- Assert.AreEqual(row.Height, sheet.DefaultRowHeight);
- Assert.IsFalse(row.RowRecord.BadFontHeight);
+ ClassicAssert.AreEqual(row.Height, sheet.DefaultRowHeight);
+ ClassicAssert.IsFalse(row.RowRecord.BadFontHeight);
row.Height=((short) 123);
- Assert.AreEqual(123, row.Height);
- Assert.IsTrue(row.RowRecord.BadFontHeight);
+ ClassicAssert.AreEqual(123, row.Height);
+ ClassicAssert.IsTrue(row.RowRecord.BadFontHeight);
row.HeightInPoints = (-1);
- Assert.AreEqual(row.Height, sheet.DefaultRowHeight);
- Assert.IsFalse(row.RowRecord.BadFontHeight);
+ ClassicAssert.AreEqual(row.Height, sheet.DefaultRowHeight);
+ ClassicAssert.IsFalse(row.RowRecord.BadFontHeight);
row.HeightInPoints = (432);
- Assert.AreEqual(432*20, row.Height);
- Assert.IsTrue(row.RowRecord.BadFontHeight);
+ ClassicAssert.AreEqual(432*20, row.Height);
+ ClassicAssert.IsTrue(row.RowRecord.BadFontHeight);
workbook.Close();
}
diff --git a/testcases/main/HSSF/UserModel/TestHSSFSheet.cs b/testcases/main/HSSF/UserModel/TestHSSFSheet.cs
index d1e9a1c3b..19f2598ad 100644
--- a/testcases/main/HSSF/UserModel/TestHSSFSheet.cs
+++ b/testcases/main/HSSF/UserModel/TestHSSFSheet.cs
@@ -26,7 +26,7 @@ namespace TestCases.HSSF.UserModel
using NPOI.SS.UserModel;
using NPOI.SS.Util;
using NPOI.Util;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using System;
using System.Collections;
using TestCases.HSSF;
@@ -61,7 +61,7 @@ public void TestSetRepeatingRowsAndColumnsBug29747()
HSSFSheet sheet2 = (HSSFSheet)wb.CreateSheet();
sheet2.RepeatingRows = (CellRangeAddress.ValueOf("1:2"));
NameRecord nameRecord = wb.Workbook.GetNameRecord(0);
- Assert.AreEqual(3, nameRecord.SheetNumber);
+ ClassicAssert.AreEqual(3, nameRecord.SheetNumber);
wb.Close();
}
@@ -89,11 +89,11 @@ public void TestBackupRecord()
HSSFSheet s = (HSSFSheet)wb.CreateSheet();
InternalSheet sheet = s.Sheet;
- Assert.IsTrue(sheet.GridsetRecord.Gridset);
+ ClassicAssert.IsTrue(sheet.GridsetRecord.Gridset);
#pragma warning disable 0618 // warning CS0618: 'NPOI.HSSF.UserModel.HSSFSheet.IsGridsPrinted' is obsolete: 'Please use IsPrintGridlines instead'
s.IsGridsPrinted = true; // <- this is marked obsolete, but using "s.IsPrintGridlines = true;" makes this test fail 8-(
#pragma warning restore 0618
- Assert.IsFalse(sheet.GridsetRecord.Gridset);
+ ClassicAssert.IsFalse(sheet.GridsetRecord.Gridset);
wb.Close();
}
@@ -109,11 +109,11 @@ public void TestVerticallyCenter()
InternalSheet sheet = s.Sheet;
VCenterRecord record = sheet.PageSettings.VCenter;
- Assert.IsFalse(record.VCenter);
- Assert.IsFalse(s.VerticallyCenter);
+ ClassicAssert.IsFalse(record.VCenter);
+ ClassicAssert.IsFalse(s.VerticallyCenter);
s.VerticallyCenter = (true);
- Assert.IsTrue(record.VCenter);
- Assert.IsTrue(s.VerticallyCenter);
+ ClassicAssert.IsTrue(record.VCenter);
+ ClassicAssert.IsTrue(s.VerticallyCenter);
wb.Close();
}
@@ -129,11 +129,11 @@ public void TestHorizontallyCenter()
InternalSheet sheet = s.Sheet;
HCenterRecord record = sheet.PageSettings.HCenter;
- Assert.IsFalse(record.HCenter);
- Assert.IsFalse(s.HorizontallyCenter);
+ ClassicAssert.IsFalse(record.HCenter);
+ ClassicAssert.IsFalse(s.HorizontallyCenter);
s.HorizontallyCenter = (true);
- Assert.IsTrue(record.HCenter);
- Assert.IsTrue(s.HorizontallyCenter);
+ ClassicAssert.IsTrue(record.HCenter);
+ ClassicAssert.IsTrue(s.HorizontallyCenter);
wb.Close();
}
@@ -152,14 +152,14 @@ public void TestWSBool()
(WSBoolRecord)sheet.FindFirstRecordBySid(WSBoolRecord.sid);
// Check defaults
- Assert.IsFalse(record.AlternateExpression);
- Assert.IsFalse(record.AlternateFormula);
- Assert.IsFalse(record.Autobreaks);
- Assert.IsFalse(record.Dialog);
- Assert.IsFalse(record.DisplayGuts);
- Assert.IsTrue(record.FitToPage);
- Assert.IsFalse(record.RowSumsBelow);
- Assert.IsFalse(record.RowSumsRight);
+ ClassicAssert.IsFalse(record.AlternateExpression);
+ ClassicAssert.IsFalse(record.AlternateFormula);
+ ClassicAssert.IsFalse(record.Autobreaks);
+ ClassicAssert.IsFalse(record.Dialog);
+ ClassicAssert.IsFalse(record.DisplayGuts);
+ ClassicAssert.IsTrue(record.FitToPage);
+ ClassicAssert.IsFalse(record.RowSumsBelow);
+ ClassicAssert.IsFalse(record.RowSumsRight);
// Alter
s.AlternativeExpression = (false);
@@ -172,22 +172,22 @@ public void TestWSBool()
s.RowSumsRight = true;
// Check
- Assert.IsFalse(record.AlternateExpression);
- Assert.IsFalse(record.AlternateFormula);
- Assert.IsTrue(record.Autobreaks);
- Assert.IsTrue(record.Dialog);
- Assert.IsTrue(record.DisplayGuts);
- Assert.IsFalse(record.FitToPage);
- Assert.IsTrue(record.RowSumsBelow);
- Assert.IsTrue(record.RowSumsRight);
- Assert.IsFalse(s.AlternativeExpression);
- Assert.IsFalse(s.AlternativeFormula);
- Assert.IsTrue(s.Autobreaks);
- Assert.IsTrue(s.Dialog);
- Assert.IsTrue(s.DisplayGuts);
- Assert.IsFalse(s.FitToPage);
- Assert.IsTrue(s.RowSumsBelow);
- Assert.IsTrue(s.RowSumsRight);
+ ClassicAssert.IsFalse(record.AlternateExpression);
+ ClassicAssert.IsFalse(record.AlternateFormula);
+ ClassicAssert.IsTrue(record.Autobreaks);
+ ClassicAssert.IsTrue(record.Dialog);
+ ClassicAssert.IsTrue(record.DisplayGuts);
+ ClassicAssert.IsFalse(record.FitToPage);
+ ClassicAssert.IsTrue(record.RowSumsBelow);
+ ClassicAssert.IsTrue(record.RowSumsRight);
+ ClassicAssert.IsFalse(s.AlternativeExpression);
+ ClassicAssert.IsFalse(s.AlternativeFormula);
+ ClassicAssert.IsTrue(s.Autobreaks);
+ ClassicAssert.IsTrue(s.Dialog);
+ ClassicAssert.IsTrue(s.DisplayGuts);
+ ClassicAssert.IsFalse(s.FitToPage);
+ ClassicAssert.IsTrue(s.RowSumsBelow);
+ ClassicAssert.IsTrue(s.RowSumsRight);
wb.Close();
}
@@ -200,19 +200,19 @@ public void TestPrintSetupLandscapeExisting()
{
HSSFWorkbook wb1 = HSSFTestDataSamples.OpenSampleWorkbook("SimpleWithPageBreaks.xls");
- Assert.AreEqual(3, wb1.NumberOfSheets);
+ ClassicAssert.AreEqual(3, wb1.NumberOfSheets);
NPOI.SS.UserModel.ISheet sheetL = wb1.GetSheetAt(0);
NPOI.SS.UserModel.ISheet sheetPM = wb1.GetSheetAt(1);
NPOI.SS.UserModel.ISheet sheetLS = wb1.GetSheetAt(2);
// Check two aspects of the print setup
- Assert.IsFalse(sheetL.PrintSetup.Landscape);
- Assert.IsTrue(sheetPM.PrintSetup.Landscape);
- Assert.IsTrue(sheetLS.PrintSetup.Landscape);
- Assert.AreEqual(1, sheetL.PrintSetup.Copies);
- Assert.AreEqual(1, sheetPM.PrintSetup.Copies);
- Assert.AreEqual(1, sheetLS.PrintSetup.Copies);
+ ClassicAssert.IsFalse(sheetL.PrintSetup.Landscape);
+ ClassicAssert.IsTrue(sheetPM.PrintSetup.Landscape);
+ ClassicAssert.IsTrue(sheetLS.PrintSetup.Landscape);
+ ClassicAssert.AreEqual(1, sheetL.PrintSetup.Copies);
+ ClassicAssert.AreEqual(1, sheetPM.PrintSetup.Copies);
+ ClassicAssert.AreEqual(1, sheetLS.PrintSetup.Copies);
// Change one on each
sheetL.PrintSetup.Landscape = (true);
@@ -220,12 +220,12 @@ public void TestPrintSetupLandscapeExisting()
sheetPM.PrintSetup.Copies = ((short)3);
// Check taken
- Assert.IsTrue(sheetL.PrintSetup.Landscape);
- Assert.IsFalse(sheetPM.PrintSetup.Landscape);
- Assert.IsTrue(sheetLS.PrintSetup.Landscape);
- Assert.AreEqual(1, sheetL.PrintSetup.Copies);
- Assert.AreEqual(3, sheetPM.PrintSetup.Copies);
- Assert.AreEqual(1, sheetLS.PrintSetup.Copies);
+ ClassicAssert.IsTrue(sheetL.PrintSetup.Landscape);
+ ClassicAssert.IsFalse(sheetPM.PrintSetup.Landscape);
+ ClassicAssert.IsTrue(sheetLS.PrintSetup.Landscape);
+ ClassicAssert.AreEqual(1, sheetL.PrintSetup.Copies);
+ ClassicAssert.AreEqual(3, sheetPM.PrintSetup.Copies);
+ ClassicAssert.AreEqual(1, sheetLS.PrintSetup.Copies);
// Save and re-load, and Check still there
IWorkbook wb2 = HSSFTestDataSamples.WriteOutAndReadBack(wb1);
@@ -235,12 +235,12 @@ public void TestPrintSetupLandscapeExisting()
sheetPM = wb1.GetSheetAt(1);
sheetLS = wb1.GetSheetAt(2);
- Assert.IsTrue(sheetL.PrintSetup.Landscape);
- Assert.IsFalse(sheetPM.PrintSetup.Landscape);
- Assert.IsTrue(sheetLS.PrintSetup.Landscape);
- Assert.AreEqual(1, sheetL.PrintSetup.Copies);
- Assert.AreEqual(3, sheetPM.PrintSetup.Copies);
- Assert.AreEqual(1, sheetLS.PrintSetup.Copies);
+ ClassicAssert.IsTrue(sheetL.PrintSetup.Landscape);
+ ClassicAssert.IsFalse(sheetPM.PrintSetup.Landscape);
+ ClassicAssert.IsTrue(sheetLS.PrintSetup.Landscape);
+ ClassicAssert.AreEqual(1, sheetL.PrintSetup.Copies);
+ ClassicAssert.AreEqual(3, sheetPM.PrintSetup.Copies);
+ ClassicAssert.AreEqual(1, sheetLS.PrintSetup.Copies);
wb2.Close();
}
@@ -255,19 +255,19 @@ public void TestGroupRows()
HSSFRow r4 = (HSSFRow)s.CreateRow(3);
HSSFRow r5 = (HSSFRow)s.CreateRow(4);
- Assert.AreEqual(0, r1.OutlineLevel);
- Assert.AreEqual(0, r2.OutlineLevel);
- Assert.AreEqual(0, r3.OutlineLevel);
- Assert.AreEqual(0, r4.OutlineLevel);
- Assert.AreEqual(0, r5.OutlineLevel);
+ ClassicAssert.AreEqual(0, r1.OutlineLevel);
+ ClassicAssert.AreEqual(0, r2.OutlineLevel);
+ ClassicAssert.AreEqual(0, r3.OutlineLevel);
+ ClassicAssert.AreEqual(0, r4.OutlineLevel);
+ ClassicAssert.AreEqual(0, r5.OutlineLevel);
s.GroupRow(2, 3);
- Assert.AreEqual(0, r1.OutlineLevel);
- Assert.AreEqual(0, r2.OutlineLevel);
- Assert.AreEqual(1, r3.OutlineLevel);
- Assert.AreEqual(1, r4.OutlineLevel);
- Assert.AreEqual(0, r5.OutlineLevel);
+ ClassicAssert.AreEqual(0, r1.OutlineLevel);
+ ClassicAssert.AreEqual(0, r2.OutlineLevel);
+ ClassicAssert.AreEqual(1, r3.OutlineLevel);
+ ClassicAssert.AreEqual(1, r4.OutlineLevel);
+ ClassicAssert.AreEqual(0, r5.OutlineLevel);
// Save and re-Open
IWorkbook wb2 = HSSFTestDataSamples.WriteOutAndReadBack(wb1);
@@ -280,11 +280,11 @@ public void TestGroupRows()
r4 = (HSSFRow)s.GetRow(3);
r5 = (HSSFRow)s.GetRow(4);
- Assert.AreEqual(0, r1.OutlineLevel);
- Assert.AreEqual(0, r2.OutlineLevel);
- Assert.AreEqual(1, r3.OutlineLevel);
- Assert.AreEqual(1, r4.OutlineLevel);
- Assert.AreEqual(0, r5.OutlineLevel);
+ ClassicAssert.AreEqual(0, r1.OutlineLevel);
+ ClassicAssert.AreEqual(0, r2.OutlineLevel);
+ ClassicAssert.AreEqual(1, r3.OutlineLevel);
+ ClassicAssert.AreEqual(1, r4.OutlineLevel);
+ ClassicAssert.AreEqual(0, r5.OutlineLevel);
wb2.Close();
}
@@ -301,22 +301,22 @@ public void TestGroupRowsExisting()
HSSFRow r5 = (HSSFRow)s.GetRow(4);
HSSFRow r6 = (HSSFRow)s.GetRow(5);
- Assert.AreEqual(0, r1.OutlineLevel);
- Assert.AreEqual(0, r2.OutlineLevel);
- Assert.AreEqual(0, r3.OutlineLevel);
- Assert.AreEqual(0, r4.OutlineLevel);
- Assert.AreEqual(0, r5.OutlineLevel);
- Assert.AreEqual(0, r6.OutlineLevel);
+ ClassicAssert.AreEqual(0, r1.OutlineLevel);
+ ClassicAssert.AreEqual(0, r2.OutlineLevel);
+ ClassicAssert.AreEqual(0, r3.OutlineLevel);
+ ClassicAssert.AreEqual(0, r4.OutlineLevel);
+ ClassicAssert.AreEqual(0, r5.OutlineLevel);
+ ClassicAssert.AreEqual(0, r6.OutlineLevel);
// This used to complain about lacking guts records
s.GroupRow(2, 4);
- Assert.AreEqual(0, r1.OutlineLevel);
- Assert.AreEqual(0, r2.OutlineLevel);
- Assert.AreEqual(1, r3.OutlineLevel);
- Assert.AreEqual(1, r4.OutlineLevel);
- Assert.AreEqual(1, r5.OutlineLevel);
- Assert.AreEqual(0, r6.OutlineLevel);
+ ClassicAssert.AreEqual(0, r1.OutlineLevel);
+ ClassicAssert.AreEqual(0, r2.OutlineLevel);
+ ClassicAssert.AreEqual(1, r3.OutlineLevel);
+ ClassicAssert.AreEqual(1, r4.OutlineLevel);
+ ClassicAssert.AreEqual(1, r5.OutlineLevel);
+ ClassicAssert.AreEqual(0, r6.OutlineLevel);
// Save and re-Open
HSSFWorkbook wb2;
@@ -337,12 +337,12 @@ public void TestGroupRowsExisting()
r5 = (HSSFRow)s.GetRow(4);
r6 = (HSSFRow)s.GetRow(5);
- Assert.AreEqual(0, r1.OutlineLevel);
- Assert.AreEqual(0, r2.OutlineLevel);
- Assert.AreEqual(1, r3.OutlineLevel);
- Assert.AreEqual(1, r4.OutlineLevel);
- Assert.AreEqual(1, r5.OutlineLevel);
- Assert.AreEqual(0, r6.OutlineLevel);
+ ClassicAssert.AreEqual(0, r1.OutlineLevel);
+ ClassicAssert.AreEqual(0, r2.OutlineLevel);
+ ClassicAssert.AreEqual(1, r3.OutlineLevel);
+ ClassicAssert.AreEqual(1, r4.OutlineLevel);
+ ClassicAssert.AreEqual(1, r5.OutlineLevel);
+ ClassicAssert.AreEqual(0, r6.OutlineLevel);
wb2.Close();
wb1.Close();
@@ -354,7 +354,7 @@ public void TestCreateDrawings()
ISheet sheet = workbook.CreateSheet();
HSSFPatriarch p1 = (HSSFPatriarch)sheet.CreateDrawingPatriarch();
HSSFPatriarch p2 = (HSSFPatriarch)sheet.CreateDrawingPatriarch();
- Assert.AreSame(p1, p2);
+ ClassicAssert.AreSame(p1, p2);
workbook.Close();
}
[Test]
@@ -364,18 +364,18 @@ public void TestGetDrawings()
HSSFWorkbook wb2c = HSSFTestDataSamples.OpenSampleWorkbook("WithTwoCharts.xls");
// 1 chart sheet -> data on 1st, chart on 2nd
- Assert.IsNotNull(((HSSFSheet)wb1c.GetSheetAt(0)).DrawingPatriarch);
- Assert.IsNotNull(((HSSFSheet)wb1c.GetSheetAt(1)).DrawingPatriarch);
- Assert.IsFalse((((HSSFSheet)wb1c.GetSheetAt(0)).DrawingPatriarch as HSSFPatriarch).ContainsChart());
- Assert.IsTrue((((HSSFSheet)wb1c.GetSheetAt(1)).DrawingPatriarch as HSSFPatriarch).ContainsChart());
+ ClassicAssert.IsNotNull(((HSSFSheet)wb1c.GetSheetAt(0)).DrawingPatriarch);
+ ClassicAssert.IsNotNull(((HSSFSheet)wb1c.GetSheetAt(1)).DrawingPatriarch);
+ ClassicAssert.IsFalse((((HSSFSheet)wb1c.GetSheetAt(0)).DrawingPatriarch as HSSFPatriarch).ContainsChart());
+ ClassicAssert.IsTrue((((HSSFSheet)wb1c.GetSheetAt(1)).DrawingPatriarch as HSSFPatriarch).ContainsChart());
// 2 chart sheet -> data on 1st, chart on 2nd+3rd
- Assert.IsNotNull(((HSSFSheet)wb2c.GetSheetAt(0)).DrawingPatriarch);
- Assert.IsNotNull(((HSSFSheet)wb2c.GetSheetAt(1)).DrawingPatriarch);
- Assert.IsNotNull(((HSSFSheet)wb2c.GetSheetAt(2)).DrawingPatriarch);
- Assert.IsFalse((((HSSFSheet)wb2c.GetSheetAt(0)).DrawingPatriarch as HSSFPatriarch).ContainsChart());
- Assert.IsTrue((((HSSFSheet)wb2c.GetSheetAt(1)).DrawingPatriarch as HSSFPatriarch).ContainsChart());
- Assert.IsTrue((((HSSFSheet)wb2c.GetSheetAt(2)).DrawingPatriarch as HSSFPatriarch).ContainsChart());
+ ClassicAssert.IsNotNull(((HSSFSheet)wb2c.GetSheetAt(0)).DrawingPatriarch);
+ ClassicAssert.IsNotNull(((HSSFSheet)wb2c.GetSheetAt(1)).DrawingPatriarch);
+ ClassicAssert.IsNotNull(((HSSFSheet)wb2c.GetSheetAt(2)).DrawingPatriarch);
+ ClassicAssert.IsFalse((((HSSFSheet)wb2c.GetSheetAt(0)).DrawingPatriarch as HSSFPatriarch).ContainsChart());
+ ClassicAssert.IsTrue((((HSSFSheet)wb2c.GetSheetAt(1)).DrawingPatriarch as HSSFPatriarch).ContainsChart());
+ ClassicAssert.IsTrue((((HSSFSheet)wb2c.GetSheetAt(2)).DrawingPatriarch as HSSFPatriarch).ContainsChart());
wb2c.Close();
wb1c.Close();
@@ -393,25 +393,25 @@ public void TestCloneWithProtect()
int expectedHashB = -14556;
HSSFWorkbook workbook = new HSSFWorkbook();
HSSFSheet hssfSheet = (HSSFSheet)workbook.CreateSheet();
- Assert.IsFalse(hssfSheet.ObjectProtect);
+ ClassicAssert.IsFalse(hssfSheet.ObjectProtect);
hssfSheet.ProtectSheet(passwordA);
- Assert.IsTrue(hssfSheet.ObjectProtect);
- Assert.AreEqual(expectedHashA, hssfSheet.Password);
- Assert.AreEqual(expectedHashA, hssfSheet.Sheet.ProtectionBlock.PasswordHash);
+ ClassicAssert.IsTrue(hssfSheet.ObjectProtect);
+ ClassicAssert.AreEqual(expectedHashA, hssfSheet.Password);
+ ClassicAssert.AreEqual(expectedHashA, hssfSheet.Sheet.ProtectionBlock.PasswordHash);
// Clone the sheet, and make sure the password hash is preserved
HSSFSheet sheet2 = (HSSFSheet)workbook.CloneSheet(0);
- Assert.IsTrue(hssfSheet.ObjectProtect);
- Assert.AreEqual(expectedHashA, sheet2.Sheet.ProtectionBlock.PasswordHash);
+ ClassicAssert.IsTrue(hssfSheet.ObjectProtect);
+ ClassicAssert.AreEqual(expectedHashA, sheet2.Sheet.ProtectionBlock.PasswordHash);
// change the password on the first sheet
hssfSheet.ProtectSheet(passwordB);
- Assert.IsTrue(hssfSheet.ObjectProtect);
- Assert.AreEqual(expectedHashB, hssfSheet.Sheet.ProtectionBlock.PasswordHash);
- Assert.AreEqual(expectedHashB, hssfSheet.Password);
+ ClassicAssert.IsTrue(hssfSheet.ObjectProtect);
+ ClassicAssert.AreEqual(expectedHashB, hssfSheet.Sheet.ProtectionBlock.PasswordHash);
+ ClassicAssert.AreEqual(expectedHashB, hssfSheet.Password);
// but the cloned sheet's password should remain unchanged
- Assert.AreEqual(expectedHashA, sheet2.Password);
+ ClassicAssert.AreEqual(expectedHashA, sheet2.Password);
workbook.Close();
}
@@ -423,14 +423,14 @@ public void TestCloneWithProtect()
HSSFSheet s = (HSSFSheet)wb.CreateSheet();
s.ProtectSheet("abcdefghij");
//WorksheetProtectionBlock pb = s.Sheet.ProtectionBlock;
- //Assert.IsTrue(pb.IsSheetProtected, "Protection should be on");
- //Assert.IsTrue(pb.IsObjectProtected, "object Protection should be on");
- //Assert.IsTrue(pb.IsScenarioProtected, "scenario Protection should be on");
- //Assert.AreEqual(expected, pb.PasswordHash, "well known value for top secret hash should be " + StringUtil.ToHexString(expected).Substring(4));
- Assert.IsTrue(s.Protect, "Protection should be on");
- Assert.IsTrue(s.ObjectProtect, "object Protection should be on");
- Assert.IsTrue(s.ScenarioProtect, "scenario Protection should be on");
- Assert.AreEqual(expected, s.Password, "well known value for top secret hash should be " + StringUtil.ToHexString(expected).Substring(4));
+ //ClassicAssert.IsTrue(pb.IsSheetProtected, "Protection should be on");
+ //ClassicAssert.IsTrue(pb.IsObjectProtected, "object Protection should be on");
+ //ClassicAssert.IsTrue(pb.IsScenarioProtected, "scenario Protection should be on");
+ //ClassicAssert.AreEqual(expected, pb.PasswordHash, "well known value for top secret hash should be " + StringUtil.ToHexString(expected).Substring(4));
+ ClassicAssert.IsTrue(s.Protect, "Protection should be on");
+ ClassicAssert.IsTrue(s.ObjectProtect, "object Protection should be on");
+ ClassicAssert.IsTrue(s.ScenarioProtect, "scenario Protection should be on");
+ ClassicAssert.AreEqual(expected, s.Password, "well known value for top secret hash should be " + StringUtil.ToHexString(expected).Substring(4));
wb.Close();
@@ -471,7 +471,7 @@ private void ConfirmRecordClass(Record[] recs, int index, Type cls)
throw new AssertionException("Expected (" + cls.Name + ") at index "
+ index + " but array length is " + recs.Length + ".");
}
- Assert.AreEqual(cls, recs[index].GetType());
+ ClassicAssert.AreEqual(cls, recs[index].GetType());
}
/**
@@ -512,7 +512,7 @@ public void TestDvProtectionOrder_bug47363b()
((HSSFSheet)sheet).Sheet.VisitContainedRecords(rc, 0);
int nRecsWithoutProtection = rc.Records.Length;
- Assert.AreEqual(4, nRecsWithProtection - nRecsWithoutProtection);
+ ClassicAssert.AreEqual(4, nRecsWithProtection - nRecsWithoutProtection);
workbook.Close();
}
@@ -523,15 +523,15 @@ public void TestZoom()
{
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = (HSSFSheet)wb.CreateSheet();
- Assert.AreEqual(-1, sheet.Sheet.FindFirstRecordLocBySid(SCLRecord.sid));
+ ClassicAssert.AreEqual(-1, sheet.Sheet.FindFirstRecordLocBySid(SCLRecord.sid));
sheet.SetZoom(75);
- Assert.IsTrue(sheet.Sheet.FindFirstRecordLocBySid(SCLRecord.sid) > 0);
+ ClassicAssert.IsTrue(sheet.Sheet.FindFirstRecordLocBySid(SCLRecord.sid) > 0);
SCLRecord sclRecord = (SCLRecord)sheet.Sheet.FindFirstRecordBySid(SCLRecord.sid);
- Assert.AreEqual(75, 100 * sclRecord.Numerator / sclRecord.Denominator);
+ ClassicAssert.AreEqual(75, 100 * sclRecord.Numerator / sclRecord.Denominator);
int sclLoc = sheet.Sheet.FindFirstRecordLocBySid(SCLRecord.sid);
int window2Loc = sheet.Sheet.FindFirstRecordLocBySid(WindowTwoRecord.sid);
- Assert.IsTrue(sclLoc == window2Loc + 1);
+ ClassicAssert.IsTrue(sclLoc == window2Loc + 1);
// verify limits
try
@@ -541,7 +541,7 @@ public void TestZoom()
}
catch (ArgumentException e)
{
- Assert.AreEqual("Numerator must be greater than 0 and less than 65536", e.Message);
+ ClassicAssert.AreEqual("Numerator must be greater than 0 and less than 65536", e.Message);
}
try
{
@@ -550,7 +550,7 @@ public void TestZoom()
}
catch (ArgumentException e)
{
- Assert.AreEqual("Numerator must be greater than 0 and less than 65536", e.Message);
+ ClassicAssert.AreEqual("Numerator must be greater than 0 and less than 65536", e.Message);
}
try
{
@@ -559,7 +559,7 @@ public void TestZoom()
}
catch (ArgumentException e)
{
- Assert.AreEqual("Denominator must be greater than 0 and less than 65536", e.Message);
+ ClassicAssert.AreEqual("Denominator must be greater than 0 and less than 65536", e.Message);
}
try
{
@@ -568,7 +568,7 @@ public void TestZoom()
}
catch (ArgumentException e)
{
- Assert.AreEqual("Denominator must be greater than 0 and less than 65536", e.Message);
+ ClassicAssert.AreEqual("Denominator must be greater than 0 and less than 65536", e.Message);
}
wb.Close();
@@ -586,30 +586,30 @@ public void TestPageBreakFiles()
HSSFWorkbook wb1 = HSSFTestDataSamples.OpenSampleWorkbook("SimpleWithPageBreaks.xls");
NPOI.SS.UserModel.ISheet sheet = wb1.GetSheetAt(0);
- Assert.IsNotNull(sheet);
+ ClassicAssert.IsNotNull(sheet);
- Assert.AreEqual(1, sheet.RowBreaks.Length, "1 row page break");
- Assert.AreEqual(1, sheet.ColumnBreaks.Length, "1 column page break");
+ ClassicAssert.AreEqual(1, sheet.RowBreaks.Length, "1 row page break");
+ ClassicAssert.AreEqual(1, sheet.ColumnBreaks.Length, "1 column page break");
- Assert.IsTrue(sheet.IsRowBroken(22), "No row page break");
- Assert.IsTrue(sheet.IsColumnBroken((short)4), "No column page break");
+ ClassicAssert.IsTrue(sheet.IsRowBroken(22), "No row page break");
+ ClassicAssert.IsTrue(sheet.IsColumnBroken((short)4), "No column page break");
sheet.SetRowBreak(10);
sheet.SetColumnBreak((short)13);
- Assert.AreEqual(2, sheet.RowBreaks.Length, "row breaks number");
- Assert.AreEqual(2, sheet.ColumnBreaks.Length, "column breaks number");
+ ClassicAssert.AreEqual(2, sheet.RowBreaks.Length, "row breaks number");
+ ClassicAssert.AreEqual(2, sheet.ColumnBreaks.Length, "column breaks number");
HSSFWorkbook wb2 = HSSFTestDataSamples.WriteOutAndReadBack(wb1);
wb1.Close();
sheet = wb2.GetSheetAt(0);
- Assert.IsTrue(sheet.IsRowBroken(22), "No row page break");
- Assert.IsTrue(sheet.IsColumnBroken((short)4), "No column page break");
+ ClassicAssert.IsTrue(sheet.IsRowBroken(22), "No row page break");
+ ClassicAssert.IsTrue(sheet.IsColumnBroken((short)4), "No column page break");
- Assert.AreEqual(2, sheet.RowBreaks.Length, "row breaks number");
- Assert.AreEqual(2, sheet.ColumnBreaks.Length, "column breaks number");
+ ClassicAssert.AreEqual(2, sheet.RowBreaks.Length, "row breaks number");
+ ClassicAssert.AreEqual(2, sheet.ColumnBreaks.Length, "column breaks number");
wb2.Close();
}
@@ -618,8 +618,8 @@ public void TestDBCSName()
{
HSSFWorkbook wb = HSSFTestDataSamples.OpenSampleWorkbook("DBCSSheetName.xls");
wb.GetSheetAt(1);
- Assert.AreEqual(wb.GetSheetName(1), "\u090f\u0915", "DBCS Sheet Name 2");
- Assert.AreEqual(wb.GetSheetName(0), "\u091c\u093e", "DBCS Sheet Name 1");
+ ClassicAssert.AreEqual(wb.GetSheetName(1), "\u090f\u0915", "DBCS Sheet Name 2");
+ ClassicAssert.AreEqual(wb.GetSheetName(0), "\u091c\u093e", "DBCS Sheet Name 1");
wb.Close();
}
@@ -634,13 +634,13 @@ public void TestTopRow()
HSSFWorkbook wb = HSSFTestDataSamples.OpenSampleWorkbook("SimpleWithPageBreaks.xls");
NPOI.SS.UserModel.ISheet sheet = wb.GetSheetAt(0);
- Assert.IsNotNull(sheet);
+ ClassicAssert.IsNotNull(sheet);
short toprow = (short)100;
short leftcol = (short)50;
sheet.ShowInPane(toprow, leftcol);
- Assert.AreEqual(toprow, sheet.TopRow, "NPOI.SS.UserModel.Sheet.GetTopRow()");
- Assert.AreEqual(leftcol, sheet.LeftCol, "NPOI.SS.UserModel.Sheet.GetLeftCol()");
+ ClassicAssert.AreEqual(toprow, sheet.TopRow, "NPOI.SS.UserModel.Sheet.GetTopRow()");
+ ClassicAssert.AreEqual(leftcol, sheet.LeftCol, "NPOI.SS.UserModel.Sheet.GetLeftCol()");
wb.Close();
}
@@ -656,9 +656,9 @@ public void Test35084()
r.CreateCell(1).CellFormula = ("A1*2");
NPOI.SS.UserModel.ISheet s1 = wb.CloneSheet(0);
r = s1.GetRow(0);
- Assert.AreEqual(r.GetCell(0).NumericCellValue, 1, 1); // sanity Check
- Assert.IsNotNull(r.GetCell(1));
- Assert.AreEqual(r.GetCell(1).CellFormula, "A1*2");
+ ClassicAssert.AreEqual(r.GetCell(0).NumericCellValue, 1, 1); // sanity Check
+ ClassicAssert.IsNotNull(r.GetCell(1));
+ ClassicAssert.AreEqual(r.GetCell(1).CellFormula, "A1*2");
wb.Close();
}
@@ -713,28 +713,28 @@ public void TestAutoSizeColumn()
// autoSize the first column and check its size before the merged region (1,0,1,1) is set:
// it has to be based on the 2nd row width
sheet.AutoSizeColumn(0);
- Assert.IsTrue(sheet.GetColumnWidth(0) >= minWithRow1And2, "Column autosized with only one row: wrong width");
- Assert.IsTrue(sheet.GetColumnWidth(0) <= maxWithRow1And2, "Column autosized with only one row: wrong width");
+ ClassicAssert.IsTrue(sheet.GetColumnWidth(0) >= minWithRow1And2, "Column autosized with only one row: wrong width");
+ ClassicAssert.IsTrue(sheet.GetColumnWidth(0) <= maxWithRow1And2, "Column autosized with only one row: wrong width");
//Create a region over the 2nd row and auto size the first column
sheet.AddMergedRegion(new CellRangeAddress(1, 1, 0, 1));
- Assert.IsNotNull(sheet.GetMergedRegion(0));
+ ClassicAssert.IsNotNull(sheet.GetMergedRegion(0));
sheet.AutoSizeColumn(0);
HSSFWorkbook wb2 = HSSFTestDataSamples.WriteOutAndReadBack(wb1);
// Check that the autoSized column width has ignored the 2nd row
// because it is included in a merged region (Excel like behavior)
NPOI.SS.UserModel.ISheet sheet2 = wb2.GetSheet(sheetName);
- Assert.IsTrue(sheet2.GetColumnWidth(0) >= minWithRow1Only, $"sheet column width:{sheet2.GetColumnWidth(0)}, minWithRow1Only:{minWithRow1Only}");
- Assert.IsTrue(sheet2.GetColumnWidth(0) <= maxWithRow1Only, $"sheet column width:{sheet2.GetColumnWidth(0)}, maxWithRow1Only:{maxWithRow1Only}");
+ ClassicAssert.IsTrue(sheet2.GetColumnWidth(0) >= minWithRow1Only, $"sheet column width:{sheet2.GetColumnWidth(0)}, minWithRow1Only:{minWithRow1Only}");
+ ClassicAssert.IsTrue(sheet2.GetColumnWidth(0) <= maxWithRow1Only, $"sheet column width:{sheet2.GetColumnWidth(0)}, maxWithRow1Only:{maxWithRow1Only}");
// Remove the 2nd row merged region and Check that the 2nd row value is used to the AutoSizeColumn width
sheet2.RemoveMergedRegion(1);
sheet2.AutoSizeColumn(0);
HSSFWorkbook wb3 = HSSFTestDataSamples.WriteOutAndReadBack(wb2);
NPOI.SS.UserModel.ISheet sheet3 = wb3.GetSheet(sheetName);
- Assert.IsTrue(sheet3.GetColumnWidth(0) >= minWithRow1And2);
- Assert.IsTrue(sheet3.GetColumnWidth(0) <= maxWithRow1And2);
+ ClassicAssert.IsTrue(sheet3.GetColumnWidth(0) >= minWithRow1And2);
+ ClassicAssert.IsTrue(sheet3.GetColumnWidth(0) <= maxWithRow1And2);
wb3.Close();
wb2.Close();
@@ -758,8 +758,8 @@ public void TestAutoSizeRow()
sheet.AutoSizeRow(row.RowNum);
- Assert.AreNotEqual(100, row.Height);
- Assert.AreEqual(540, row.Height);
+ ClassicAssert.AreNotEqual(100, row.Height);
+ ClassicAssert.AreEqual(540, row.Height);
workbook.Close();
}
@@ -778,13 +778,13 @@ public void TestForceRecalculation()
IRow row = sheet.GetRow(0);
row.CreateCell(0).SetCellValue(5);
row.CreateCell(1).SetCellValue(8);
- Assert.IsFalse(sheet.ForceFormulaRecalculation);
- Assert.IsFalse(sheet2.ForceFormulaRecalculation);
+ ClassicAssert.IsFalse(sheet.ForceFormulaRecalculation);
+ ClassicAssert.IsFalse(sheet2.ForceFormulaRecalculation);
// Save and manually verify that on column C we have 0, value in template
HSSFTestDataSamples.WriteOutAndReadBack(wb1).Close();
sheet.ForceFormulaRecalculation = (/*setter*/true);
- Assert.IsTrue(sheet.ForceFormulaRecalculation);
+ ClassicAssert.IsTrue(sheet.ForceFormulaRecalculation);
// Save and manually verify that on column C we have now 13, calculated value
@@ -795,8 +795,8 @@ public void TestForceRecalculation()
// And check correct sheet Settings found
sheet = wb2.GetSheetAt(0);
sheet2 = wb2.GetSheetAt(1);
- Assert.IsTrue(sheet.ForceFormulaRecalculation);
- Assert.IsFalse(sheet2.ForceFormulaRecalculation);
+ ClassicAssert.IsTrue(sheet.ForceFormulaRecalculation);
+ ClassicAssert.IsFalse(sheet2.ForceFormulaRecalculation);
// Now turn if back off again
sheet.ForceFormulaRecalculation = (/*setter*/false);
@@ -804,26 +804,26 @@ public void TestForceRecalculation()
HSSFWorkbook wb3 = HSSFTestDataSamples.WriteOutAndReadBack(wb2);
wb2.Close();
- Assert.IsFalse(wb3.GetSheetAt(0).ForceFormulaRecalculation);
- Assert.IsFalse(wb3.GetSheetAt(1).ForceFormulaRecalculation);
- Assert.IsFalse(wb3.GetSheetAt(2).ForceFormulaRecalculation);
+ ClassicAssert.IsFalse(wb3.GetSheetAt(0).ForceFormulaRecalculation);
+ ClassicAssert.IsFalse(wb3.GetSheetAt(1).ForceFormulaRecalculation);
+ ClassicAssert.IsFalse(wb3.GetSheetAt(2).ForceFormulaRecalculation);
// Now add a new sheet, and check things work
// with old ones unset, new one Set
ISheet s4 = wb3.CreateSheet();
s4.ForceFormulaRecalculation = (/*setter*/true);
- Assert.IsFalse(sheet.ForceFormulaRecalculation);
- Assert.IsFalse(sheet2.ForceFormulaRecalculation);
- Assert.IsTrue(s4.ForceFormulaRecalculation);
+ ClassicAssert.IsFalse(sheet.ForceFormulaRecalculation);
+ ClassicAssert.IsFalse(sheet2.ForceFormulaRecalculation);
+ ClassicAssert.IsTrue(s4.ForceFormulaRecalculation);
HSSFWorkbook wb4 = HSSFTestDataSamples.WriteOutAndReadBack(wb3);
wb3.Close();
- Assert.IsFalse(wb4.GetSheetAt(0).ForceFormulaRecalculation);
- Assert.IsFalse(wb4.GetSheetAt(1).ForceFormulaRecalculation);
- Assert.IsFalse(wb4.GetSheetAt(2).ForceFormulaRecalculation);
- Assert.IsTrue(wb4.GetSheetAt(3).ForceFormulaRecalculation);
+ ClassicAssert.IsFalse(wb4.GetSheetAt(0).ForceFormulaRecalculation);
+ ClassicAssert.IsFalse(wb4.GetSheetAt(1).ForceFormulaRecalculation);
+ ClassicAssert.IsFalse(wb4.GetSheetAt(2).ForceFormulaRecalculation);
+ ClassicAssert.IsTrue(wb4.GetSheetAt(3).ForceFormulaRecalculation);
wb4.Close();
}
@@ -842,7 +842,7 @@ public void TestForceRecalculation()
{
int idx = i - 'A';
double w = sh.GetColumnWidth(idx);
- Assert.AreEqual(ref1[idx], w);
+ ClassicAssert.AreEqual(ref1[idx], w);
}
//the second sheet doesn't have overridden column widths
@@ -854,7 +854,7 @@ public void TestForceRecalculation()
double w = sh.GetColumnWidth(idx);
//getDefaultColumnWidth returns width measured in characters
//getColumnWidth returns width measured in 1/256th units
- Assert.AreEqual(def_width * 256, w);
+ ClassicAssert.AreEqual(def_width * 256, w);
}
wb1.Close();
@@ -862,15 +862,15 @@ public void TestForceRecalculation()
HSSFWorkbook wb2 = new HSSFWorkbook();
sh = wb2.CreateSheet();
sh.DefaultColumnWidth = (/*setter*/10);
- Assert.AreEqual(10, sh.DefaultColumnWidth);
- Assert.AreEqual(256 * 10, sh.GetColumnWidth(0));
- Assert.AreEqual(256 * 10, sh.GetColumnWidth(1));
- Assert.AreEqual(256 * 10, sh.GetColumnWidth(2));
+ ClassicAssert.AreEqual(10, sh.DefaultColumnWidth);
+ ClassicAssert.AreEqual(256 * 10, sh.GetColumnWidth(0));
+ ClassicAssert.AreEqual(256 * 10, sh.GetColumnWidth(1));
+ ClassicAssert.AreEqual(256 * 10, sh.GetColumnWidth(2));
for (char i = 'D'; i <= 'F'; i++)
{
short w = (256 * 12);
sh.SetColumnWidth(i, w);
- Assert.AreEqual(w, sh.GetColumnWidth(i));
+ ClassicAssert.AreEqual(w, sh.GetColumnWidth(i));
}
//serialize and read again
@@ -878,21 +878,21 @@ public void TestForceRecalculation()
wb2.Close();
sh = wb3.GetSheetAt(0);
- Assert.AreEqual(10, sh.DefaultColumnWidth);
+ ClassicAssert.AreEqual(10, sh.DefaultColumnWidth);
//columns A-C have default width
- Assert.AreEqual(256 * 10, sh.GetColumnWidth(0));
- Assert.AreEqual(256 * 10, sh.GetColumnWidth(1));
- Assert.AreEqual(256 * 10, sh.GetColumnWidth(2));
+ ClassicAssert.AreEqual(256 * 10, sh.GetColumnWidth(0));
+ ClassicAssert.AreEqual(256 * 10, sh.GetColumnWidth(1));
+ ClassicAssert.AreEqual(256 * 10, sh.GetColumnWidth(2));
//columns D-F have custom width
for (char i = 'D'; i <= 'F'; i++)
{
short w = (256 * 12);
- Assert.AreEqual(w, sh.GetColumnWidth(i));
+ ClassicAssert.AreEqual(w, sh.GetColumnWidth(i));
}
// check for 16-bit signed/unsigned error:
sh.SetColumnWidth(0, 40000);
- Assert.AreEqual(40000, sh.GetColumnWidth(0));
+ ClassicAssert.AreEqual(40000, sh.GetColumnWidth(0));
wb3.Close();
}
@@ -902,10 +902,10 @@ public void TestDefaultColumnWidth()
HSSFWorkbook wb1 = HSSFTestDataSamples.OpenSampleWorkbook("12843-1.xls");
ISheet sheet = wb1.GetSheetAt(7);
// shall not be NPE
- Assert.AreEqual(8, sheet.DefaultColumnWidth);
- Assert.AreEqual(8 * 256, sheet.GetColumnWidth(0));
+ ClassicAssert.AreEqual(8, sheet.DefaultColumnWidth);
+ ClassicAssert.AreEqual(8 * 256, sheet.GetColumnWidth(0));
- Assert.AreEqual(0xFF, sheet.DefaultRowHeight);
+ ClassicAssert.AreEqual(0xFF, sheet.DefaultRowHeight);
wb1.Close();
@@ -914,11 +914,11 @@ public void TestDefaultColumnWidth()
for (int i = 1; i <= 2; i++)
{
double dw = wb2.GetSheetAt(i).DefaultColumnWidth;
- Assert.AreEqual(8, dw);
+ ClassicAssert.AreEqual(8, dw);
double cw = wb2.GetSheetAt(i).GetColumnWidth(0);
- Assert.AreEqual(8 * 256, cw);
+ ClassicAssert.AreEqual(8 * 256, cw);
- Assert.AreEqual(0xFF, sheet.DefaultRowHeight);
+ ClassicAssert.AreEqual(0xFF, sheet.DefaultRowHeight);
}
wb2.Close();
@@ -935,13 +935,13 @@ public void TestMissingRowRecords_bug41187()
NPOI.SS.UserModel.ISheet sheet = wb.GetSheetAt(0);
IRow row = sheet.GetRow(0);
- Assert.IsNotNull(row, "Identified bug 41187 a");
+ ClassicAssert.IsNotNull(row, "Identified bug 41187 a");
- Assert.AreNotEqual((short)0, row.Height, "Identified bug 41187 b");
+ ClassicAssert.AreNotEqual((short)0, row.Height, "Identified bug 41187 b");
- Assert.AreEqual("Hi Excel!", row.GetCell(0).RichStringCellValue.String);
+ ClassicAssert.AreEqual("Hi Excel!", row.GetCell(0).RichStringCellValue.String);
// Check row height for 'default' flag
- Assert.AreEqual((short)0xFF, row.Height);
+ ClassicAssert.AreEqual((short)0xFF, row.Height);
HSSFTestDataSamples.WriteOutAndReadBack(wb);
@@ -973,7 +973,7 @@ public void TestCloneSheetWithDrawings()
DrawingManager2 dm2 = wb2.Workbook.DrawingManager;
//Check EscherDggRecord - a workbook-level registry of drawing objects
- Assert.AreEqual(dm1.GetDgg().MaxDrawingGroupId + 1, dm2.GetDgg().MaxDrawingGroupId);
+ ClassicAssert.AreEqual(dm1.GetDgg().MaxDrawingGroupId + 1, dm2.GetDgg().MaxDrawingGroupId);
HSSFSheet sheet2 = (HSSFSheet)wb2.GetSheetAt(1);
@@ -982,7 +982,7 @@ public void TestCloneSheetWithDrawings()
EscherDgRecord dg2 = (EscherDgRecord)(sheet2.DrawingPatriarch as HSSFPatriarch).GetBoundAggregate().FindFirstWithId(EscherDgRecord.RECORD_ID);
int dg_id_1 = dg1.Options >> 4;
int dg_id_2 = dg2.Options >> 4;
- Assert.AreEqual(dg_id_1 + 1, dg_id_2);
+ ClassicAssert.AreEqual(dg_id_1 + 1, dg_id_2);
//TODO: Check shapeId in the Cloned sheet
@@ -1007,7 +1007,7 @@ public void TestLongSheetNames()
}
catch (ArgumentException e)
{
- Assert.IsTrue(e.Message.StartsWith("sheetName 'A123456789B123456789C123456789Dyyyy' is invalid"));
+ ClassicAssert.IsTrue(e.Message.StartsWith("sheetName 'A123456789B123456789C123456789Dyyyy' is invalid"));
}
wb.Close();
}
@@ -1022,34 +1022,34 @@ public void TestReadColumnStyles()
IWorkbook wbComplex = HSSFTestDataSamples.OpenSampleWorkbook("ColumnStyle1dpColoured.xls");
// Presence / absence Checks
- Assert.IsNull(wbNone.GetSheetAt(0).GetColumnStyle(0));
- Assert.IsNull(wbNone.GetSheetAt(0).GetColumnStyle(1));
+ ClassicAssert.IsNull(wbNone.GetSheetAt(0).GetColumnStyle(0));
+ ClassicAssert.IsNull(wbNone.GetSheetAt(0).GetColumnStyle(1));
- Assert.IsNull(wbSimple.GetSheetAt(0).GetColumnStyle(0));
- Assert.IsNotNull(wbSimple.GetSheetAt(0).GetColumnStyle(1));
+ ClassicAssert.IsNull(wbSimple.GetSheetAt(0).GetColumnStyle(0));
+ ClassicAssert.IsNotNull(wbSimple.GetSheetAt(0).GetColumnStyle(1));
- Assert.IsNull(wbComplex.GetSheetAt(0).GetColumnStyle(0));
- Assert.IsNotNull(wbComplex.GetSheetAt(0).GetColumnStyle(1));
+ ClassicAssert.IsNull(wbComplex.GetSheetAt(0).GetColumnStyle(0));
+ ClassicAssert.IsNotNull(wbComplex.GetSheetAt(0).GetColumnStyle(1));
// Details Checks
ICellStyle bs = wbSimple.GetSheetAt(0).GetColumnStyle(1);
- Assert.AreEqual(62, bs.Index);
- Assert.AreEqual("#,##0.0_ ;\\-#,##0.0\\ ", bs.GetDataFormatString());
- Assert.AreEqual("Calibri", bs.GetFont(wbSimple).FontName);
- Assert.AreEqual(11 * 20, bs.GetFont(wbSimple).FontHeight);
- Assert.AreEqual(8, bs.GetFont(wbSimple).Color);
- Assert.IsFalse(bs.GetFont(wbSimple).IsItalic);
- Assert.IsFalse(bs.GetFont(wbSimple).IsBold);
+ ClassicAssert.AreEqual(62, bs.Index);
+ ClassicAssert.AreEqual("#,##0.0_ ;\\-#,##0.0\\ ", bs.GetDataFormatString());
+ ClassicAssert.AreEqual("Calibri", bs.GetFont(wbSimple).FontName);
+ ClassicAssert.AreEqual(11 * 20, bs.GetFont(wbSimple).FontHeight);
+ ClassicAssert.AreEqual(8, bs.GetFont(wbSimple).Color);
+ ClassicAssert.IsFalse(bs.GetFont(wbSimple).IsItalic);
+ ClassicAssert.IsFalse(bs.GetFont(wbSimple).IsBold);
ICellStyle cs = wbComplex.GetSheetAt(0).GetColumnStyle(1);
- Assert.AreEqual(62, cs.Index);
- Assert.AreEqual("#,##0.0_ ;\\-#,##0.0\\ ", cs.GetDataFormatString());
- Assert.AreEqual("Arial", cs.GetFont(wbComplex).FontName);
- Assert.AreEqual(8 * 20, cs.GetFont(wbComplex).FontHeight);
- Assert.AreEqual(10, cs.GetFont(wbComplex).Color);
- Assert.IsFalse(cs.GetFont(wbComplex).IsItalic);
- Assert.IsTrue(cs.GetFont(wbComplex).IsBold);
+ ClassicAssert.AreEqual(62, cs.Index);
+ ClassicAssert.AreEqual("#,##0.0_ ;\\-#,##0.0\\ ", cs.GetDataFormatString());
+ ClassicAssert.AreEqual("Arial", cs.GetFont(wbComplex).FontName);
+ ClassicAssert.AreEqual(8 * 20, cs.GetFont(wbComplex).FontHeight);
+ ClassicAssert.AreEqual(10, cs.GetFont(wbComplex).Color);
+ ClassicAssert.IsFalse(cs.GetFont(wbComplex).IsItalic);
+ ClassicAssert.IsTrue(cs.GetFont(wbComplex).IsBold);
wbComplex.Close();
wbSimple.Close();
@@ -1061,9 +1061,9 @@ public void TestArabic()
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet s = (HSSFSheet)wb.CreateSheet();
- Assert.IsFalse(s.IsRightToLeft);
+ ClassicAssert.IsFalse(s.IsRightToLeft);
s.IsRightToLeft = true;
- Assert.IsTrue(s.IsRightToLeft);
+ ClassicAssert.IsTrue(s.IsRightToLeft);
wb.Close();
}
@@ -1075,37 +1075,37 @@ public void TestAutoFilter()
InternalWorkbook iwb = wb1.Workbook;
InternalSheet ish = sh.Sheet;
- Assert.IsNull(iwb.GetSpecificBuiltinRecord(NameRecord.BUILTIN_FILTER_DB, 1));
- Assert.IsNull(ish.FindFirstRecordBySid(AutoFilterInfoRecord.sid));
+ ClassicAssert.IsNull(iwb.GetSpecificBuiltinRecord(NameRecord.BUILTIN_FILTER_DB, 1));
+ ClassicAssert.IsNull(ish.FindFirstRecordBySid(AutoFilterInfoRecord.sid));
CellRangeAddress range = CellRangeAddress.ValueOf("A1:B10");
sh.SetAutoFilter(range);
NameRecord name = iwb.GetSpecificBuiltinRecord(NameRecord.BUILTIN_FILTER_DB, 1);
- Assert.IsNotNull(name);
+ ClassicAssert.IsNotNull(name);
// The built-in name for auto-filter must consist of a single Area3d Ptg.
Ptg[] ptg = name.NameDefinition;
- Assert.AreEqual(1, ptg.Length, "The built-in name for auto-filter must consist of a single Area3d Ptg");
- Assert.IsTrue(ptg[0] is Area3DPtg, "The built-in name for auto-filter must consist of a single Area3d Ptg");
+ ClassicAssert.AreEqual(1, ptg.Length, "The built-in name for auto-filter must consist of a single Area3d Ptg");
+ ClassicAssert.IsTrue(ptg[0] is Area3DPtg, "The built-in name for auto-filter must consist of a single Area3d Ptg");
Area3DPtg aref = (Area3DPtg)ptg[0];
- Assert.AreEqual(range.FirstColumn, aref.FirstColumn);
- Assert.AreEqual(range.FirstRow, aref.FirstRow);
- Assert.AreEqual(range.LastColumn, aref.LastColumn);
- Assert.AreEqual(range.LastRow, aref.LastRow);
+ ClassicAssert.AreEqual(range.FirstColumn, aref.FirstColumn);
+ ClassicAssert.AreEqual(range.FirstRow, aref.FirstRow);
+ ClassicAssert.AreEqual(range.LastColumn, aref.LastColumn);
+ ClassicAssert.AreEqual(range.LastRow, aref.LastRow);
// verify AutoFilterInfoRecord
AutoFilterInfoRecord afilter = (AutoFilterInfoRecord)ish.FindFirstRecordBySid(AutoFilterInfoRecord.sid);
- Assert.IsNotNull(afilter);
- Assert.AreEqual(2, afilter.NumEntries); //filter covers two columns
+ ClassicAssert.IsNotNull(afilter);
+ ClassicAssert.AreEqual(2, afilter.NumEntries); //filter covers two columns
HSSFPatriarch dr = (HSSFPatriarch)sh.DrawingPatriarch;
- Assert.IsNotNull(dr);
+ ClassicAssert.IsNotNull(dr);
HSSFSimpleShape comboBoxShape = (HSSFSimpleShape)dr.Children[0];
- Assert.AreEqual(comboBoxShape.ShapeType, HSSFSimpleShape.OBJECT_TYPE_COMBO_BOX);
+ ClassicAssert.AreEqual(comboBoxShape.ShapeType, HSSFSimpleShape.OBJECT_TYPE_COMBO_BOX);
- Assert.IsNull(ish.FindFirstRecordBySid(ObjRecord.sid)); // ObjRecord will appear after serializetion
+ ClassicAssert.IsNull(ish.FindFirstRecordBySid(ObjRecord.sid)); // ObjRecord will appear after serializetion
HSSFWorkbook wb2 = HSSFTestDataSamples.WriteOutAndReadBack(wb1);
wb1.Close();
@@ -1114,10 +1114,10 @@ public void TestAutoFilter()
ish = sh.Sheet;
ObjRecord objRecord = (ObjRecord)ish.FindFirstRecordBySid(ObjRecord.sid);
IList subRecords = objRecord.SubRecords;
- Assert.AreEqual(3, subRecords.Count);
- Assert.IsTrue(subRecords[0] is CommonObjectDataSubRecord);
- Assert.IsTrue(subRecords[1] is FtCblsSubRecord); // must be present, see Bug 51481
- Assert.IsTrue(subRecords[2] is LbsDataSubRecord);
+ ClassicAssert.AreEqual(3, subRecords.Count);
+ ClassicAssert.IsTrue(subRecords[0] is CommonObjectDataSubRecord);
+ ClassicAssert.IsTrue(subRecords[1] is FtCblsSubRecord); // must be present, see Bug 51481
+ ClassicAssert.IsTrue(subRecords[2] is LbsDataSubRecord);
wb2.Close();
}
@@ -1127,7 +1127,7 @@ public void TestGetSetColumnHiddenShort()
IWorkbook workbook = new HSSFWorkbook();
ISheet sheet = workbook.CreateSheet("Sheet 1");
sheet.SetColumnHidden((short)2, true);
- Assert.IsTrue(sheet.IsColumnHidden((short)2));
+ ClassicAssert.IsTrue(sheet.IsColumnHidden((short)2));
workbook.Close();
}
@@ -1139,11 +1139,11 @@ public void TestColumnWidthShort()
//default column width measured in characters
sheet.DefaultColumnWidth = ((short)10);
- Assert.AreEqual(10, sheet.DefaultColumnWidth);
+ ClassicAssert.AreEqual(10, sheet.DefaultColumnWidth);
//columns A-C have default width
- Assert.AreEqual(256 * 10, sheet.GetColumnWidth((short)0));
- Assert.AreEqual(256 * 10, sheet.GetColumnWidth((short)1));
- Assert.AreEqual(256 * 10, sheet.GetColumnWidth((short)2));
+ ClassicAssert.AreEqual(256 * 10, sheet.GetColumnWidth((short)0));
+ ClassicAssert.AreEqual(256 * 10, sheet.GetColumnWidth((short)1));
+ ClassicAssert.AreEqual(256 * 10, sheet.GetColumnWidth((short)2));
//set custom width for D-F
for (char i = 'D'; i <= 'F'; i++)
@@ -1151,23 +1151,23 @@ public void TestColumnWidthShort()
//Sheet#setColumnWidth accepts the width in units of 1/256th of a character width
int w = 256 * 12;
sheet.SetColumnWidth((short)i, w);
- Assert.AreEqual(w, sheet.GetColumnWidth((short)i));
+ ClassicAssert.AreEqual(w, sheet.GetColumnWidth((short)i));
}
//reset the default column width, columns A-C change, D-F still have custom width
sheet.DefaultColumnWidth = ((short)20);
- Assert.AreEqual(20, sheet.DefaultColumnWidth);
- Assert.AreEqual(256 * 20, sheet.GetColumnWidth((short)0));
- Assert.AreEqual(256 * 20, sheet.GetColumnWidth((short)1));
- Assert.AreEqual(256 * 20, sheet.GetColumnWidth((short)2));
+ ClassicAssert.AreEqual(20, sheet.DefaultColumnWidth);
+ ClassicAssert.AreEqual(256 * 20, sheet.GetColumnWidth((short)0));
+ ClassicAssert.AreEqual(256 * 20, sheet.GetColumnWidth((short)1));
+ ClassicAssert.AreEqual(256 * 20, sheet.GetColumnWidth((short)2));
for (char i = 'D'; i <= 'F'; i++)
{
int w = 256 * 12;
- Assert.AreEqual(w, sheet.GetColumnWidth((short)i));
+ ClassicAssert.AreEqual(w, sheet.GetColumnWidth((short)i));
}
// check for 16-bit signed/unsigned error:
sheet.SetColumnWidth((short)10, 40000);
- Assert.AreEqual(40000, sheet.GetColumnWidth((short)10));
+ ClassicAssert.AreEqual(40000, sheet.GetColumnWidth((short)10));
//The maximum column width for an individual cell is 255 characters
try
@@ -1177,25 +1177,25 @@ public void TestColumnWidthShort()
}
catch (ArgumentException e)
{
- Assert.AreEqual("The maximum column width for an individual cell is 255 characters.", e.Message);
+ ClassicAssert.AreEqual("The maximum column width for an individual cell is 255 characters.", e.Message);
}
//serialize and read again
HSSFWorkbook wb2 = HSSFTestDataSamples.WriteOutAndReadBack(wb1);
sheet = wb2.GetSheetAt(0);
- Assert.AreEqual(20, sheet.DefaultColumnWidth);
+ ClassicAssert.AreEqual(20, sheet.DefaultColumnWidth);
//columns A-C have default width
- Assert.AreEqual(256 * 20, sheet.GetColumnWidth((short)0));
- Assert.AreEqual(256 * 20, sheet.GetColumnWidth((short)1));
- Assert.AreEqual(256 * 20, sheet.GetColumnWidth((short)2));
+ ClassicAssert.AreEqual(256 * 20, sheet.GetColumnWidth((short)0));
+ ClassicAssert.AreEqual(256 * 20, sheet.GetColumnWidth((short)1));
+ ClassicAssert.AreEqual(256 * 20, sheet.GetColumnWidth((short)2));
//columns D-F have custom width
for (char i = 'D'; i <= 'F'; i++)
{
short w = (256 * 12);
- Assert.AreEqual(w, sheet.GetColumnWidth((short)i));
+ ClassicAssert.AreEqual(w, sheet.GetColumnWidth((short)i));
}
- Assert.AreEqual(40000, sheet.GetColumnWidth((short)10));
+ ClassicAssert.AreEqual(40000, sheet.GetColumnWidth((short)10));
wb2.Close();
}
@@ -1214,7 +1214,7 @@ public void TestShowInPane()
}
catch (ArgumentException e)
{
- Assert.AreEqual("Maximum row number is 65535", e.Message);
+ ClassicAssert.AreEqual("Maximum row number is 65535", e.Message);
}
wb.Close();
@@ -1228,7 +1228,7 @@ public void TestDrawingRecords()
/* TODO: NPE?
sheet.dumpDrawingRecords(false);
sheet.dumpDrawingRecords(true);*/
- Assert.IsNull(sheet.DrawingEscherAggregate);
+ ClassicAssert.IsNull(sheet.DrawingEscherAggregate);
wb.Close();
}
@@ -1240,15 +1240,15 @@ public void TestBug55723b()
ISheet sheet = wb.CreateSheet();
// stored with a special name
- Assert.IsNull(wb.Workbook.GetSpecificBuiltinRecord(NameRecord.BUILTIN_FILTER_DB, 1));
+ ClassicAssert.IsNull(wb.Workbook.GetSpecificBuiltinRecord(NameRecord.BUILTIN_FILTER_DB, 1));
CellRangeAddress range = CellRangeAddress.ValueOf("A:B");
IAutoFilter filter = sheet.SetAutoFilter(range);
- Assert.IsNotNull(filter);
+ ClassicAssert.IsNotNull(filter);
// stored with a special name
NameRecord record = wb.Workbook.GetSpecificBuiltinRecord(NameRecord.BUILTIN_FILTER_DB, 1);
- Assert.IsNotNull(record);
+ ClassicAssert.IsNotNull(record);
wb.Close();
}
@@ -1272,12 +1272,12 @@ public void Test58746()
wb.SetSheetOrder("third", 0);
// verify results
- Assert.AreEqual("third", wb.GetSheetAt(0).SheetName);
- Assert.AreEqual("first", wb.GetSheetAt(1).SheetName);
- Assert.AreEqual("second", wb.GetSheetAt(2).SheetName);
+ ClassicAssert.AreEqual("third", wb.GetSheetAt(0).SheetName);
+ ClassicAssert.AreEqual("first", wb.GetSheetAt(1).SheetName);
+ ClassicAssert.AreEqual("second", wb.GetSheetAt(2).SheetName);
- Assert.AreEqual("first!A1", wb.GetSheetAt(0).GetRow(0).GetCell(0).CellFormula);
- Assert.AreEqual("second!A1", wb.GetSheetAt(0).GetRow(0).GetCell(1).CellFormula);
+ ClassicAssert.AreEqual("first!A1", wb.GetSheetAt(0).GetRow(0).GetCell(0).CellFormula);
+ ClassicAssert.AreEqual("second!A1", wb.GetSheetAt(0).GetRow(0).GetCell(1).CellFormula);
wb.Close();
}
@@ -1290,7 +1290,7 @@ public void Bug59135()
HSSFWorkbook wb2 = HSSFTestDataSamples.WriteOutAndReadBack(wb1);
wb1.Close();
- Assert.AreEqual(unchecked((short)0xb86b), (wb2.GetSheetAt(0) as HSSFSheet).Password);
+ ClassicAssert.AreEqual(unchecked((short)0xb86b), (wb2.GetSheetAt(0) as HSSFSheet).Password);
wb2.Close();
HSSFWorkbook wb3 = new HSSFWorkbook();
@@ -1298,7 +1298,7 @@ public void Bug59135()
HSSFWorkbook wb4 = HSSFTestDataSamples.WriteOutAndReadBack(wb3);
wb3.Close();
- Assert.AreEqual(unchecked((short)0xbecc), (wb4.GetSheetAt(0) as HSSFSheet).Password);
+ ClassicAssert.AreEqual(unchecked((short)0xbecc), (wb4.GetSheetAt(0) as HSSFSheet).Password);
wb4.Close();
}
}
diff --git a/testcases/main/HSSF/UserModel/TestHSSFSheetCopy.cs b/testcases/main/HSSF/UserModel/TestHSSFSheetCopy.cs
index 1b50ef396..53306c2e8 100644
--- a/testcases/main/HSSF/UserModel/TestHSSFSheetCopy.cs
+++ b/testcases/main/HSSF/UserModel/TestHSSFSheetCopy.cs
@@ -3,7 +3,7 @@
using NPOI.HSSF.UserModel;
using NPOI.SS.UserModel;
using NPOI.SS.Util;
-using NUnit.Framework;
+using NUnit.Framework;using NUnit.Framework.Legacy;
namespace TestCases.HSSF.UserModel
{
@@ -19,11 +19,11 @@ public void TestBasicCopySheet()
sheetA.CreateRow(1).CreateCell(0).SetCellValue("Test case item 2");
ISheet sheetB = sheetA.CopySheet("Sheet B", false);
//Ensure cell values were copied
- Assert.AreEqual(sheetA.GetRow(0).GetCell(0).StringCellValue, sheetB.GetRow(0).GetCell(0).StringCellValue);
- Assert.AreEqual(sheetA.GetRow(1).GetCell(0).StringCellValue, sheetB.GetRow(1).GetCell(0).StringCellValue);
+ ClassicAssert.AreEqual(sheetA.GetRow(0).GetCell(0).StringCellValue, sheetB.GetRow(0).GetCell(0).StringCellValue);
+ ClassicAssert.AreEqual(sheetA.GetRow(1).GetCell(0).StringCellValue, sheetB.GetRow(1).GetCell(0).StringCellValue);
//Now test to make sure the copy is independent. Changes to the copy should not affect the original.
sheetB.GetRow(1).GetCell(0).SetCellValue("This was changed");
- Assert.AreNotEqual(sheetA.GetRow(1).GetCell(0).StringCellValue, sheetB.GetRow(1).GetCell(0).StringCellValue);
+ ClassicAssert.AreNotEqual(sheetA.GetRow(1).GetCell(0).StringCellValue, sheetB.GetRow(1).GetCell(0).StringCellValue);
}
[Test]
@@ -41,10 +41,10 @@ public void TestBasicCopyTo()
sheetA.CopyTo(bookB, "Copied Sheet A", false, false);
sheetA.CopyTo(bookC, "Copied Sheet A", false, false);
//Ensure the sheet was copied to the 2nd sheet of Book B, not the 1st sheet.
- Assert.AreNotEqual(sheetA.GetRow(0).GetCell(0).StringCellValue, bookB.GetSheetAt(0).GetRow(0).GetCell(0).StringCellValue);
- Assert.AreEqual(sheetA.GetRow(0).GetCell(0).StringCellValue, bookB.GetSheetAt(1).GetRow(0).GetCell(0).StringCellValue);
+ ClassicAssert.AreNotEqual(sheetA.GetRow(0).GetCell(0).StringCellValue, bookB.GetSheetAt(0).GetRow(0).GetCell(0).StringCellValue);
+ ClassicAssert.AreEqual(sheetA.GetRow(0).GetCell(0).StringCellValue, bookB.GetSheetAt(1).GetRow(0).GetCell(0).StringCellValue);
//Ensure the sheet was copied to the 1st sheet in Book C
- Assert.AreEqual(sheetA.GetRow(0).GetCell(0).StringCellValue, bookC.GetSheetAt(0).GetRow(0).GetCell(0).StringCellValue);
+ ClassicAssert.AreEqual(sheetA.GetRow(0).GetCell(0).StringCellValue, bookC.GetSheetAt(0).GetRow(0).GetCell(0).StringCellValue);
}
[Test]
@@ -86,16 +86,16 @@ public void TestColorStyleCopy()
//Check that the fill color got copied
byte[] srcColor = bookA.Workbook.CustomPalette.GetColor(0x9);
byte[] destColor = bookB.Workbook.CustomPalette.GetColor(copiedCell.CellStyle.FillForegroundColor);
- Assert.IsTrue(srcColor[0]==destColor[0] && srcColor[1]==destColor[1] && srcColor[2]==destColor[2]);
+ ClassicAssert.IsTrue(srcColor[0]==destColor[0] && srcColor[1]==destColor[1] && srcColor[2]==destColor[2]);
//Check that the font color got copied
srcColor = bookA.Workbook.CustomPalette.GetColor(0x8);
destColor = bookB.Workbook.CustomPalette.GetColor(copiedCell.CellStyle.GetFont(bookB).Color);
- Assert.IsTrue(srcColor[0] == destColor[0] && srcColor[1] == destColor[1] && srcColor[2] == destColor[2]);
+ ClassicAssert.IsTrue(srcColor[0] == destColor[0] && srcColor[1] == destColor[1] && srcColor[2] == destColor[2]);
//Check that the fill color of the cell originally in the destination book is still intact
srcColor = bookB.Workbook.CustomPalette.GetColor(0x8);
- Assert.IsTrue(srcColor[0] == 192 && srcColor[1] == 168 && srcColor[2] == 0);
+ ClassicAssert.IsTrue(srcColor[0] == 192 && srcColor[1] == 168 && srcColor[2] == 0);
//Check that the font made it over okay
- Assert.AreEqual(copiedCell.CellStyle.GetFont(bookB).FontName, myFont.FontName);
+ ClassicAssert.AreEqual(copiedCell.CellStyle.GetFont(bookB).FontName, myFont.FontName);
}
[Test]
@@ -112,7 +112,7 @@ public void TestImageCopy()
ms.Position = 0;
HSSFWorkbook sanityCheck = new HSSFWorkbook(ms);
//Assert that only one image got copied, because only one image was used on the first page
- Assert.IsTrue(sanityCheck.GetAllPictures().Count == 1);
+ ClassicAssert.IsTrue(sanityCheck.GetAllPictures().Count == 1);
}
HSSFSheet sheet2 = srcBook.GetSheetAt(1) as HSSFSheet;
sheet2.CopyTo(destBook, "Second Sheet", true, true);
@@ -122,7 +122,7 @@ public void TestImageCopy()
ms.Position = 0;
HSSFWorkbook sanityCheck = new HSSFWorkbook(ms);
//2nd sheet copied, make sure we have two images now, because sheet 2 had one image
- Assert.IsTrue(sanityCheck.GetAllPictures().Count == 2);
+ ClassicAssert.IsTrue(sanityCheck.GetAllPictures().Count == 2);
}
}
@@ -142,10 +142,10 @@ public void CopySheetToWorkbookShouldCopyFormulasOver()
srcSheet.CopyTo(destWorkbook, srcSheet.SheetName, true, true);
var destSheet = destWorkbook.GetSheet("Sheet1");
- Assert.NotNull(destSheet);
+ ClassicAssert.NotNull(destSheet);
- Assert.AreEqual(1, destSheet.GetRow(0)?.GetCell(0).NumericCellValue);
- Assert.AreEqual("A1+1", destSheet.GetRow(0)?.GetCell(1).CellFormula);
+ ClassicAssert.AreEqual(1, destSheet.GetRow(0)?.GetCell(0).NumericCellValue);
+ ClassicAssert.AreEqual("A1+1", destSheet.GetRow(0)?.GetCell(1).CellFormula);
destSheet.GetRow(0)?.GetCell(0).SetCellValue(10);
var evaluator = destWorkbook.GetCreationHelper()
@@ -155,7 +155,7 @@ public void CopySheetToWorkbookShouldCopyFormulasOver()
evaluator.EvaluateFormulaCell(destCell);
var destCellValue = evaluator.Evaluate(destCell);
- Assert.AreEqual(11, destCellValue.NumberValue);
+ ClassicAssert.AreEqual(11, destCellValue.NumberValue);
}
[Test]
@@ -173,10 +173,10 @@ public void CopySheetToWorkbookShouldCopyMergedRegionsOver()
srcSheet.CopyTo(destWorkbook, srcSheet.SheetName, true, true);
var destSheet = destWorkbook.GetSheet("Sheet1");
- Assert.NotNull(destSheet);
- Assert.AreEqual(2, destSheet.MergedRegions.Count);
+ ClassicAssert.NotNull(destSheet);
+ ClassicAssert.AreEqual(2, destSheet.MergedRegions.Count);
- Assert.IsTrue(
+ ClassicAssert.IsTrue(
new string[]
{
"A1:B4",
diff --git a/testcases/main/HSSF/UserModel/TestHSSFSheetOrder.cs b/testcases/main/HSSF/UserModel/TestHSSFSheetOrder.cs
index 95ce0ed2f..84bc5191e 100644
--- a/testcases/main/HSSF/UserModel/TestHSSFSheetOrder.cs
+++ b/testcases/main/HSSF/UserModel/TestHSSFSheetOrder.cs
@@ -23,7 +23,7 @@ namespace TestCases.HSSF.UserModel
using System.IO;
using NPOI.HSSF.Model;
using NPOI.HSSF.UserModel;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
* Tests HSSFWorkbook method setSheetOrder()
*
@@ -53,16 +53,16 @@ public void TestBackupRecord()
}
// Check the initial order
- Assert.AreEqual(0, wb.GetSheetIndex("Sheet 0"));
- Assert.AreEqual(1, wb.GetSheetIndex("Sheet 1"));
- Assert.AreEqual(2, wb.GetSheetIndex("Sheet 2"));
- Assert.AreEqual(3, wb.GetSheetIndex("Sheet 3"));
- Assert.AreEqual(4, wb.GetSheetIndex("Sheet 4"));
- Assert.AreEqual(5, wb.GetSheetIndex("Sheet 5"));
- Assert.AreEqual(6, wb.GetSheetIndex("Sheet 6"));
- Assert.AreEqual(7, wb.GetSheetIndex("Sheet 7"));
- Assert.AreEqual(8, wb.GetSheetIndex("Sheet 8"));
- Assert.AreEqual(9, wb.GetSheetIndex("Sheet 9"));
+ ClassicAssert.AreEqual(0, wb.GetSheetIndex("Sheet 0"));
+ ClassicAssert.AreEqual(1, wb.GetSheetIndex("Sheet 1"));
+ ClassicAssert.AreEqual(2, wb.GetSheetIndex("Sheet 2"));
+ ClassicAssert.AreEqual(3, wb.GetSheetIndex("Sheet 3"));
+ ClassicAssert.AreEqual(4, wb.GetSheetIndex("Sheet 4"));
+ ClassicAssert.AreEqual(5, wb.GetSheetIndex("Sheet 5"));
+ ClassicAssert.AreEqual(6, wb.GetSheetIndex("Sheet 6"));
+ ClassicAssert.AreEqual(7, wb.GetSheetIndex("Sheet 7"));
+ ClassicAssert.AreEqual(8, wb.GetSheetIndex("Sheet 8"));
+ ClassicAssert.AreEqual(9, wb.GetSheetIndex("Sheet 9"));
// Change
wb.Workbook.SetSheetOrder("Sheet 6", 0);
@@ -70,16 +70,16 @@ public void TestBackupRecord()
wb.Workbook.SetSheetOrder("Sheet 1", 9);
// Check they're currently right
- Assert.AreEqual(0, wb.GetSheetIndex("Sheet 6"));
- Assert.AreEqual(1, wb.GetSheetIndex("Sheet 0"));
- Assert.AreEqual(2, wb.GetSheetIndex("Sheet 2"));
- Assert.AreEqual(3, wb.GetSheetIndex("Sheet 4"));
- Assert.AreEqual(4, wb.GetSheetIndex("Sheet 5"));
- Assert.AreEqual(5, wb.GetSheetIndex("Sheet 7"));
- Assert.AreEqual(6, wb.GetSheetIndex("Sheet 3"));
- Assert.AreEqual(7, wb.GetSheetIndex("Sheet 8"));
- Assert.AreEqual(8, wb.GetSheetIndex("Sheet 9"));
- Assert.AreEqual(9, wb.GetSheetIndex("Sheet 1"));
+ ClassicAssert.AreEqual(0, wb.GetSheetIndex("Sheet 6"));
+ ClassicAssert.AreEqual(1, wb.GetSheetIndex("Sheet 0"));
+ ClassicAssert.AreEqual(2, wb.GetSheetIndex("Sheet 2"));
+ ClassicAssert.AreEqual(3, wb.GetSheetIndex("Sheet 4"));
+ ClassicAssert.AreEqual(4, wb.GetSheetIndex("Sheet 5"));
+ ClassicAssert.AreEqual(5, wb.GetSheetIndex("Sheet 7"));
+ ClassicAssert.AreEqual(6, wb.GetSheetIndex("Sheet 3"));
+ ClassicAssert.AreEqual(7, wb.GetSheetIndex("Sheet 8"));
+ ClassicAssert.AreEqual(8, wb.GetSheetIndex("Sheet 9"));
+ ClassicAssert.AreEqual(9, wb.GetSheetIndex("Sheet 1"));
// Read it in and see if it is correct.
MemoryStream baos = new MemoryStream();
@@ -87,22 +87,22 @@ public void TestBackupRecord()
MemoryStream bais = new MemoryStream(baos.ToArray());
HSSFWorkbook wbr = new HSSFWorkbook(bais);
- Assert.AreEqual(0, wbr.GetSheetIndex("Sheet 6"));
- Assert.AreEqual(1, wbr.GetSheetIndex("Sheet 0"));
- Assert.AreEqual(2, wbr.GetSheetIndex("Sheet 2"));
- Assert.AreEqual(3, wbr.GetSheetIndex("Sheet 4"));
- Assert.AreEqual(4, wbr.GetSheetIndex("Sheet 5"));
- Assert.AreEqual(5, wbr.GetSheetIndex("Sheet 7"));
- Assert.AreEqual(6, wbr.GetSheetIndex("Sheet 3"));
- Assert.AreEqual(7, wbr.GetSheetIndex("Sheet 8"));
- Assert.AreEqual(8, wbr.GetSheetIndex("Sheet 9"));
- Assert.AreEqual(9, wbr.GetSheetIndex("Sheet 1"));
+ ClassicAssert.AreEqual(0, wbr.GetSheetIndex("Sheet 6"));
+ ClassicAssert.AreEqual(1, wbr.GetSheetIndex("Sheet 0"));
+ ClassicAssert.AreEqual(2, wbr.GetSheetIndex("Sheet 2"));
+ ClassicAssert.AreEqual(3, wbr.GetSheetIndex("Sheet 4"));
+ ClassicAssert.AreEqual(4, wbr.GetSheetIndex("Sheet 5"));
+ ClassicAssert.AreEqual(5, wbr.GetSheetIndex("Sheet 7"));
+ ClassicAssert.AreEqual(6, wbr.GetSheetIndex("Sheet 3"));
+ ClassicAssert.AreEqual(7, wbr.GetSheetIndex("Sheet 8"));
+ ClassicAssert.AreEqual(8, wbr.GetSheetIndex("Sheet 9"));
+ ClassicAssert.AreEqual(9, wbr.GetSheetIndex("Sheet 1"));
// Now get the index by the sheet, not the name
for (int i = 0; i < 10; i++)
{
NPOI.SS.UserModel.ISheet s = wbr.GetSheetAt(i);
- Assert.AreEqual(i, wbr.GetSheetIndex(s));
+ ClassicAssert.AreEqual(i, wbr.GetSheetIndex(s));
}
}
}
diff --git a/testcases/main/HSSF/UserModel/TestHSSFSheetSetOrder.cs b/testcases/main/HSSF/UserModel/TestHSSFSheetSetOrder.cs
index ce43d0105..e4e7f5917 100644
--- a/testcases/main/HSSF/UserModel/TestHSSFSheetSetOrder.cs
+++ b/testcases/main/HSSF/UserModel/TestHSSFSheetSetOrder.cs
@@ -22,7 +22,7 @@ namespace TestCases.HSSF.UserModel
using System;
using NPOI.HSSF.UserModel;
using NPOI.HSSF.Model;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
/**
* Tests HSSFWorkbook method setSheetOrder()
diff --git a/testcases/main/HSSF/UserModel/TestHSSFSheetShiftRows.cs b/testcases/main/HSSF/UserModel/TestHSSFSheetShiftRows.cs
index 6960f91bd..f64c80cf4 100644
--- a/testcases/main/HSSF/UserModel/TestHSSFSheetShiftRows.cs
+++ b/testcases/main/HSSF/UserModel/TestHSSFSheetShiftRows.cs
@@ -17,7 +17,7 @@ limitations under the License.
namespace TestCases.HSSF.UserModel
{
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using TestCases.HSSF;
using TestCases.SS.UserModel;
diff --git a/testcases/main/HSSF/UserModel/TestHSSFSheetUpdateArrayFormulas.cs b/testcases/main/HSSF/UserModel/TestHSSFSheetUpdateArrayFormulas.cs
index 1a2667045..64af70790 100644
--- a/testcases/main/HSSF/UserModel/TestHSSFSheetUpdateArrayFormulas.cs
+++ b/testcases/main/HSSF/UserModel/TestHSSFSheetUpdateArrayFormulas.cs
@@ -18,7 +18,7 @@ limitations under the License.
namespace TestCases.HSSF.UserModel
{
using System;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using NPOI.HSSF.Record;
using NPOI.HSSF.Record.Aggregates;
using NPOI.HSSF.UserModel;
@@ -47,20 +47,20 @@ public void TestHSSFSetArrayFormula_SingleCell()
CellRangeAddress range = new CellRangeAddress(2, 2, 2, 2);
ICell[] cells = sheet.SetArrayFormula("SUM(C11:C12*D11:D12)", range).FlattenedCells;
- Assert.AreEqual(1, cells.Length);
+ ClassicAssert.AreEqual(1, cells.Length);
// sheet.SetArrayFormula Creates rows and cells for the designated range
- Assert.IsNotNull(sheet.GetRow(2));
+ ClassicAssert.IsNotNull(sheet.GetRow(2));
ICell cell = sheet.GetRow(2).GetCell(2);
- Assert.IsNotNull(cell);
+ ClassicAssert.IsNotNull(cell);
- Assert.IsTrue(cell.IsPartOfArrayFormulaGroup);
+ ClassicAssert.IsTrue(cell.IsPartOfArrayFormulaGroup);
//retrieve the range and check it is the same
- Assert.AreEqual(range.FormatAsString(), cell.ArrayFormulaRange.FormatAsString());
+ ClassicAssert.AreEqual(range.FormatAsString(), cell.ArrayFormulaRange.FormatAsString());
FormulaRecordAggregate agg = (FormulaRecordAggregate)(((HSSFCell)cell).CellValueRecord);
- Assert.AreEqual(range.FormatAsString(), agg.GetArrayFormulaRange().FormatAsString());
- Assert.IsTrue(agg.IsPartOfArrayFormula);
+ ClassicAssert.AreEqual(range.FormatAsString(), agg.GetArrayFormulaRange().FormatAsString());
+ ClassicAssert.IsTrue(agg.IsPartOfArrayFormula);
workbook.Close();
}
@@ -83,15 +83,15 @@ public void TestAddRemoveArrayFormulas_recordUpdates()
ConfirmRecordClass(recs, ix + 2, typeof(FormulaRecord));
ConfirmRecordClass(recs, ix + 3, typeof(FormulaRecord));
// just one array record
- Assert.IsTrue(FindRecordOfType(recs, typeof(ArrayRecord), ix + 1) < 0);
+ ClassicAssert.IsTrue(FindRecordOfType(recs, typeof(ArrayRecord), ix + 1) < 0);
s.RemoveArrayFormula(cr.TopLeftCell);
// Make sure the array formula has been Removed properly
recs = RecordInspector.GetRecords(s, 0);
- Assert.IsTrue(FindRecordOfType(recs, typeof(ArrayRecord), 0) < 0);
- Assert.IsTrue(FindRecordOfType(recs, typeof(FormulaRecord), 0) < 0);
+ ClassicAssert.IsTrue(FindRecordOfType(recs, typeof(ArrayRecord), 0) < 0);
+ ClassicAssert.IsTrue(FindRecordOfType(recs, typeof(FormulaRecord), 0) < 0);
RowRecordsAggregate rra = ((HSSFSheet)s).Sheet.RowsAggregate;
SharedValueManager svm = TestSharedValueManager.ExtractFromRRA(rra);
if (svm.GetArrayRecord(4, 1) != null)
@@ -108,7 +108,7 @@ private static void ConfirmRecordClass(Record[] recs, int index, Type cls)
Assert.Fail("Expected (" + cls.Name + ") at index "
+ index + " but array length is " + recs.Length + ".");
}
- Assert.AreEqual(cls, recs[index].GetType());
+ ClassicAssert.AreEqual(cls, recs[index].GetType());
}
/**
* @return -1 if not found
diff --git a/testcases/main/HSSF/UserModel/TestHSSFTextbox.cs b/testcases/main/HSSF/UserModel/TestHSSFTextbox.cs
index 53a4539cb..ceeddf366 100644
--- a/testcases/main/HSSF/UserModel/TestHSSFTextbox.cs
+++ b/testcases/main/HSSF/UserModel/TestHSSFTextbox.cs
@@ -18,7 +18,7 @@ namespace TestCases.HSSF.UserModel
{
using System;
using NPOI.HSSF.UserModel;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using System.IO;
using TestCases.HSSF;
using NPOI.SS.UserModel;
@@ -49,8 +49,8 @@ public void TestAlignment()
textbox.HorizontalAlignment = HorizontalTextAlignment.Center;
textbox.VerticalAlignment = VerticalTextAlignment.Center;
- Assert.AreEqual(HorizontalTextAlignment.Center, textbox.HorizontalAlignment);
- Assert.AreEqual(VerticalTextAlignment.Center, textbox.VerticalAlignment);
+ ClassicAssert.AreEqual(HorizontalTextAlignment.Center, textbox.HorizontalAlignment);
+ ClassicAssert.AreEqual(VerticalTextAlignment.Center, textbox.VerticalAlignment);
}
/**
@@ -66,12 +66,12 @@ public void TestSetDeafultTextFormat()
HSSFTextbox textbox1 = patriarch.CreateTextbox(new HSSFClientAnchor(0, 0, 0, 0, 1, 1, 3, 3)) as HSSFTextbox;
HSSFRichTextString rt1 = new HSSFRichTextString("Hello, World!");
- Assert.AreEqual(0, rt1.NumFormattingRuns);
+ ClassicAssert.AreEqual(0, rt1.NumFormattingRuns);
textbox1.String=(rt1);
HSSFRichTextString rt2 = (HSSFRichTextString)textbox1.String;
- Assert.AreEqual(1, rt2.NumFormattingRuns);
- Assert.AreEqual(HSSFRichTextString.NO_FONT, rt2.GetFontOfFormattingRun(0));
+ ClassicAssert.AreEqual(1, rt2.NumFormattingRuns);
+ ClassicAssert.AreEqual(HSSFRichTextString.NO_FONT, rt2.GetFontOfFormattingRun(0));
}
}
diff --git a/testcases/main/HSSF/UserModel/TestHSSFWorkbook.cs b/testcases/main/HSSF/UserModel/TestHSSFWorkbook.cs
index a3ac4928b..a5f7812a3 100644
--- a/testcases/main/HSSF/UserModel/TestHSSFWorkbook.cs
+++ b/testcases/main/HSSF/UserModel/TestHSSFWorkbook.cs
@@ -28,7 +28,7 @@ namespace TestCases.HSSF.UserModel
using NPOI.SS.UserModel;
using NPOI.SS.Util;
using NPOI.Util;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using System;
using System.Collections;
using System.Collections.Generic;
@@ -69,23 +69,23 @@ public void TestHidden()
WindowOneRecord w1 = wb.Workbook.WindowOne;
- Assert.AreEqual(false, wb.IsHidden);
- Assert.AreEqual(false, w1.Hidden);
+ ClassicAssert.AreEqual(false, wb.IsHidden);
+ ClassicAssert.AreEqual(false, w1.Hidden);
wb.IsHidden = (true);
- Assert.AreEqual(true, wb.IsHidden);
- Assert.AreEqual(true, w1.Hidden);
+ ClassicAssert.AreEqual(true, wb.IsHidden);
+ ClassicAssert.AreEqual(true, w1.Hidden);
HSSFWorkbook wbBack = HSSFTestDataSamples.WriteOutAndReadBack(wb);
w1 = wbBack.Workbook.WindowOne;
wbBack.IsHidden = (true);
- Assert.AreEqual(true, wbBack.IsHidden);
- Assert.AreEqual(true, w1.Hidden);
+ ClassicAssert.AreEqual(true, wbBack.IsHidden);
+ ClassicAssert.AreEqual(true, w1.Hidden);
wbBack.IsHidden = (false);
- Assert.AreEqual(false, wbBack.IsHidden);
- Assert.AreEqual(false, w1.Hidden);
+ ClassicAssert.AreEqual(false, wbBack.IsHidden);
+ ClassicAssert.AreEqual(false, w1.Hidden);
wbBack.Close();
wb.Close();
@@ -97,16 +97,16 @@ public void ReadWriteWithCharts()
ISheet s;
// Single chart, two sheets
HSSFWorkbook b1 = HSSFTestDataSamples.OpenSampleWorkbook("44010-SingleChart.xls");
- Assert.AreEqual(2, b1.NumberOfSheets);
- Assert.AreEqual("Graph2", b1.GetSheetName(1));
+ ClassicAssert.AreEqual(2, b1.NumberOfSheets);
+ ClassicAssert.AreEqual("Graph2", b1.GetSheetName(1));
s = b1.GetSheetAt(1);
- Assert.AreEqual(0, s.FirstRowNum);
- Assert.AreEqual(8, s.LastRowNum);
+ ClassicAssert.AreEqual(0, s.FirstRowNum);
+ ClassicAssert.AreEqual(8, s.LastRowNum);
// Has chart on 1st sheet??
// FIXME
- Assert.IsNotNull(b1.GetSheetAt(0).DrawingPatriarch);
- Assert.IsNull(b1.GetSheetAt(1).DrawingPatriarch);
- Assert.IsFalse((b1.GetSheetAt(0).DrawingPatriarch as HSSFPatriarch).ContainsChart());
+ ClassicAssert.IsNotNull(b1.GetSheetAt(0).DrawingPatriarch);
+ ClassicAssert.IsNull(b1.GetSheetAt(1).DrawingPatriarch);
+ ClassicAssert.IsFalse((b1.GetSheetAt(0).DrawingPatriarch as HSSFPatriarch).ContainsChart());
b1.Close();
// We've now called getDrawingPatriarch() so
// everything will be all screwy
@@ -114,26 +114,26 @@ public void ReadWriteWithCharts()
HSSFWorkbook b2 = HSSFTestDataSamples.OpenSampleWorkbook("44010-SingleChart.xls");
HSSFWorkbook b3 = HSSFTestDataSamples.WriteOutAndReadBack(b2);
b2.Close();
- Assert.AreEqual(2, b3.NumberOfSheets);
+ ClassicAssert.AreEqual(2, b3.NumberOfSheets);
s = b3.GetSheetAt(1) as HSSFSheet;
- Assert.AreEqual(0, s.FirstRowNum);
- Assert.AreEqual(8, s.LastRowNum);
+ ClassicAssert.AreEqual(0, s.FirstRowNum);
+ ClassicAssert.AreEqual(8, s.LastRowNum);
b3.Close();
// Two charts, three sheets
HSSFWorkbook b4 = HSSFTestDataSamples.OpenSampleWorkbook("44010-TwoCharts.xls");
- Assert.AreEqual(3, b4.NumberOfSheets);
+ ClassicAssert.AreEqual(3, b4.NumberOfSheets);
s = b4.GetSheetAt(1) as HSSFSheet;
- Assert.AreEqual(0, s.FirstRowNum);
- Assert.AreEqual(8, s.LastRowNum);
+ ClassicAssert.AreEqual(0, s.FirstRowNum);
+ ClassicAssert.AreEqual(8, s.LastRowNum);
s = b4.GetSheetAt(2) as HSSFSheet;
- Assert.AreEqual(0, s.FirstRowNum);
- Assert.AreEqual(8, s.LastRowNum);
+ ClassicAssert.AreEqual(0, s.FirstRowNum);
+ ClassicAssert.AreEqual(8, s.LastRowNum);
// Has chart on 1st sheet??
// FIXME
- Assert.IsNotNull(b4.GetSheetAt(0).DrawingPatriarch);
- Assert.IsNull(b4.GetSheetAt(1).DrawingPatriarch);
- Assert.IsNull(b4.GetSheetAt(2).DrawingPatriarch);
- Assert.IsFalse((b4.GetSheetAt(0).DrawingPatriarch as HSSFPatriarch).ContainsChart());
+ ClassicAssert.IsNotNull(b4.GetSheetAt(0).DrawingPatriarch);
+ ClassicAssert.IsNull(b4.GetSheetAt(1).DrawingPatriarch);
+ ClassicAssert.IsNull(b4.GetSheetAt(2).DrawingPatriarch);
+ ClassicAssert.IsFalse((b4.GetSheetAt(0).DrawingPatriarch as HSSFPatriarch).ContainsChart());
b4.Close();
// We've now called getDrawingPatriarch() so
// everything will be all screwy
@@ -141,13 +141,13 @@ public void ReadWriteWithCharts()
HSSFWorkbook b5 = HSSFTestDataSamples.OpenSampleWorkbook("44010-TwoCharts.xls");
HSSFWorkbook b6 = HSSFTestDataSamples.WriteOutAndReadBack(b5);
b5.Close();
- Assert.AreEqual(3, b6.NumberOfSheets);
+ ClassicAssert.AreEqual(3, b6.NumberOfSheets);
s = b6.GetSheetAt(1) as HSSFSheet;
- Assert.AreEqual(0, s.FirstRowNum);
- Assert.AreEqual(8, s.LastRowNum);
+ ClassicAssert.AreEqual(0, s.FirstRowNum);
+ ClassicAssert.AreEqual(8, s.LastRowNum);
s = b6.GetSheetAt(2) as HSSFSheet;
- Assert.AreEqual(0, s.FirstRowNum);
- Assert.AreEqual(8, s.LastRowNum);
+ ClassicAssert.AreEqual(0, s.FirstRowNum);
+ ClassicAssert.AreEqual(8, s.LastRowNum);
b6.Close();
}
@@ -202,14 +202,14 @@ private static List arrayToList(int[] array)
private static void assertCollectionsEquals(List expected, List actual)
{
- Assert.AreEqual(expected.Count, actual.Count, "size");
+ ClassicAssert.AreEqual(expected.Count, actual.Count, "size");
foreach (int e in expected)
{
- Assert.IsTrue(actual.Contains(e));
+ ClassicAssert.IsTrue(actual.Contains(e));
}
foreach (int a in actual)
{
- Assert.IsTrue(expected.Contains(a));
+ ClassicAssert.IsTrue(expected.Contains(a));
}
}
[Test]
@@ -227,30 +227,30 @@ public void SelectMultiple()
wb.SetSelectedTabs(selected);
CollectionAssert.AreEqual(selected, wb.GetSelectedTabs());
- Assert.AreEqual(true, sheet0.IsSelected);
- Assert.AreEqual(false, sheet1.IsSelected);
- Assert.AreEqual(true, sheet2.IsSelected);
- Assert.AreEqual(true, sheet3.IsSelected);
- Assert.AreEqual(false, sheet4.IsSelected);
- Assert.AreEqual(false, sheet5.IsSelected);
+ ClassicAssert.AreEqual(true, sheet0.IsSelected);
+ ClassicAssert.AreEqual(false, sheet1.IsSelected);
+ ClassicAssert.AreEqual(true, sheet2.IsSelected);
+ ClassicAssert.AreEqual(true, sheet3.IsSelected);
+ ClassicAssert.AreEqual(false, sheet4.IsSelected);
+ ClassicAssert.AreEqual(false, sheet5.IsSelected);
selected = arrayToList(new int[] { 1, 3, 5 });
wb.SetSelectedTabs(selected);
// previous selection should be cleared
CollectionAssert.AreEqual(selected, wb.GetSelectedTabs());
- Assert.AreEqual(false, sheet0.IsSelected);
- Assert.AreEqual(true, sheet1.IsSelected);
- Assert.AreEqual(false, sheet2.IsSelected);
- Assert.AreEqual(true, sheet3.IsSelected);
- Assert.AreEqual(false, sheet4.IsSelected);
- Assert.AreEqual(true, sheet5.IsSelected);
- Assert.AreEqual(true, sheet0.IsActive);
- Assert.AreEqual(false, sheet2.IsActive);
+ ClassicAssert.AreEqual(false, sheet0.IsSelected);
+ ClassicAssert.AreEqual(true, sheet1.IsSelected);
+ ClassicAssert.AreEqual(false, sheet2.IsSelected);
+ ClassicAssert.AreEqual(true, sheet3.IsSelected);
+ ClassicAssert.AreEqual(false, sheet4.IsSelected);
+ ClassicAssert.AreEqual(true, sheet5.IsSelected);
+ ClassicAssert.AreEqual(true, sheet0.IsActive);
+ ClassicAssert.AreEqual(false, sheet2.IsActive);
wb.SetActiveSheet(2);
- Assert.AreEqual(false, sheet0.IsActive);
- Assert.AreEqual(true, sheet2.IsActive);
+ ClassicAssert.AreEqual(false, sheet0.IsActive);
+ ClassicAssert.AreEqual(true, sheet2.IsActive);
/*{ // helpful if viewing this workbook in excel:
@@ -352,8 +352,8 @@ private static void ConfirmActiveSelected(ISheet sheet, bool expected)
private static void ConfirmActiveSelected(ISheet sheet,
bool expectedActive, bool expectedSelected)
{
- Assert.AreEqual(expectedActive, sheet.IsActive, "active");
- Assert.AreEqual(expectedSelected, sheet.IsSelected, "selected");
+ ClassicAssert.AreEqual(expectedActive, sheet.IsActive, "active");
+ ClassicAssert.AreEqual(expectedSelected, sheet.IsSelected, "selected");
}
/**
@@ -379,7 +379,7 @@ public void SheetSerializeSizeMisMatch_bug45066()
catch (InvalidOperationException e)
{
// Expected badly behaved sheet record to cause exception
- Assert.IsTrue(e.Message.StartsWith("Actual serialized sheet size"));
+ ClassicAssert.IsTrue(e.Message.StartsWith("Actual serialized sheet size"));
}
}
@@ -391,11 +391,11 @@ public void SheetSerializeSizeMisMatch_bug45066()
public void NamesToDeleteSheets()
{
HSSFWorkbook b = OpenSample("30978-deleted.xls");
- Assert.AreEqual(3, b.NumberOfNames);
+ ClassicAssert.AreEqual(3, b.NumberOfNames);
// Sheet 2 is deleted
- Assert.AreEqual("Sheet1", b.GetSheetName(0));
- Assert.AreEqual("Sheet3", b.GetSheetName(1));
+ ClassicAssert.AreEqual("Sheet1", b.GetSheetName(0));
+ ClassicAssert.AreEqual("Sheet3", b.GetSheetName(1));
Area3DPtg ptg;
NameRecord nr;
@@ -405,69 +405,69 @@ public void NamesToDeleteSheets()
// First at low level
nr = b.Workbook.GetNameRecord(0);
- Assert.AreEqual("On2", nr.NameText);
- Assert.AreEqual(0, nr.SheetNumber);
- Assert.AreEqual(1, nr.ExternSheetNumber);
- Assert.AreEqual(1, nr.NameDefinition.Length);
+ ClassicAssert.AreEqual("On2", nr.NameText);
+ ClassicAssert.AreEqual(0, nr.SheetNumber);
+ ClassicAssert.AreEqual(1, nr.ExternSheetNumber);
+ ClassicAssert.AreEqual(1, nr.NameDefinition.Length);
ptg = (Area3DPtg)nr.NameDefinition[0];
- Assert.AreEqual(1, ptg.ExternSheetIndex);
- Assert.AreEqual(0, ptg.FirstColumn);
- Assert.AreEqual(0, ptg.FirstRow);
- Assert.AreEqual(0, ptg.LastColumn);
- Assert.AreEqual(2, ptg.LastRow);
+ ClassicAssert.AreEqual(1, ptg.ExternSheetIndex);
+ ClassicAssert.AreEqual(0, ptg.FirstColumn);
+ ClassicAssert.AreEqual(0, ptg.FirstRow);
+ ClassicAssert.AreEqual(0, ptg.LastColumn);
+ ClassicAssert.AreEqual(2, ptg.LastRow);
// Now at high level
n = b.GetNameAt(0);
- Assert.AreEqual("On2", n.NameName);
- Assert.AreEqual("", n.SheetName);
- Assert.AreEqual("#REF!$A$1:$A$3", n.RefersToFormula);
+ ClassicAssert.AreEqual("On2", n.NameName);
+ ClassicAssert.AreEqual("", n.SheetName);
+ ClassicAssert.AreEqual("#REF!$A$1:$A$3", n.RefersToFormula);
/* ======= Name pointing to 1st sheet ====== */
// First at low level
nr = b.Workbook.GetNameRecord(1);
- Assert.AreEqual("OnOne", nr.NameText);
- Assert.AreEqual(0, nr.SheetNumber);
- Assert.AreEqual(0, nr.ExternSheetNumber);
- Assert.AreEqual(1, nr.NameDefinition.Length);
+ ClassicAssert.AreEqual("OnOne", nr.NameText);
+ ClassicAssert.AreEqual(0, nr.SheetNumber);
+ ClassicAssert.AreEqual(0, nr.ExternSheetNumber);
+ ClassicAssert.AreEqual(1, nr.NameDefinition.Length);
ptg = (Area3DPtg)nr.NameDefinition[0];
- Assert.AreEqual(0, ptg.ExternSheetIndex);
- Assert.AreEqual(0, ptg.FirstColumn);
- Assert.AreEqual(2, ptg.FirstRow);
- Assert.AreEqual(0, ptg.LastColumn);
- Assert.AreEqual(3, ptg.LastRow);
+ ClassicAssert.AreEqual(0, ptg.ExternSheetIndex);
+ ClassicAssert.AreEqual(0, ptg.FirstColumn);
+ ClassicAssert.AreEqual(2, ptg.FirstRow);
+ ClassicAssert.AreEqual(0, ptg.LastColumn);
+ ClassicAssert.AreEqual(3, ptg.LastRow);
// Now at high level
n = b.GetNameAt(1);
- Assert.AreEqual("OnOne", n.NameName);
- Assert.AreEqual("Sheet1", n.SheetName);
- Assert.AreEqual("Sheet1!$A$3:$A$4", n.RefersToFormula);
+ ClassicAssert.AreEqual("OnOne", n.NameName);
+ ClassicAssert.AreEqual("Sheet1", n.SheetName);
+ ClassicAssert.AreEqual("Sheet1!$A$3:$A$4", n.RefersToFormula);
/* ======= Name pointing to 3rd sheet ====== */
// First at low level
nr = b.Workbook.GetNameRecord(2);
- Assert.AreEqual("OnSheet3", nr.NameText);
- Assert.AreEqual(0, nr.SheetNumber);
- Assert.AreEqual(2, nr.ExternSheetNumber);
- Assert.AreEqual(1, nr.NameDefinition.Length);
+ ClassicAssert.AreEqual("OnSheet3", nr.NameText);
+ ClassicAssert.AreEqual(0, nr.SheetNumber);
+ ClassicAssert.AreEqual(2, nr.ExternSheetNumber);
+ ClassicAssert.AreEqual(1, nr.NameDefinition.Length);
ptg = (Area3DPtg)nr.NameDefinition[0];
- Assert.AreEqual(2, ptg.ExternSheetIndex);
- Assert.AreEqual(0, ptg.FirstColumn);
- Assert.AreEqual(0, ptg.FirstRow);
- Assert.AreEqual(0, ptg.LastColumn);
- Assert.AreEqual(1, ptg.LastRow);
+ ClassicAssert.AreEqual(2, ptg.ExternSheetIndex);
+ ClassicAssert.AreEqual(0, ptg.FirstColumn);
+ ClassicAssert.AreEqual(0, ptg.FirstRow);
+ ClassicAssert.AreEqual(0, ptg.LastColumn);
+ ClassicAssert.AreEqual(1, ptg.LastRow);
// Now at high level
n = b.GetNameAt(2);
- Assert.AreEqual("OnSheet3", n.NameName);
- Assert.AreEqual("Sheet3", n.SheetName);
- Assert.AreEqual("Sheet3!$A$1:$A$2", n.RefersToFormula);
+ ClassicAssert.AreEqual("OnSheet3", n.NameName);
+ ClassicAssert.AreEqual("Sheet3", n.SheetName);
+ ClassicAssert.AreEqual("Sheet3!$A$1:$A$2", n.RefersToFormula);
b.Close();
}
@@ -531,10 +531,10 @@ public void FindBuiltInNameRecord()
// The second print titles name record has SheetNumber==4
HSSFWorkbook wb1 = HSSFTestDataSamples.OpenSampleWorkbook("testRRaC.xls");
NameRecord nr;
- Assert.AreEqual(3, wb1.Workbook.NumNames);
+ ClassicAssert.AreEqual(3, wb1.Workbook.NumNames);
nr = wb1.Workbook.GetNameRecord(2);
// TODO - render full row and full column refs properly
- Assert.AreEqual("Sheet2!$A$1:$IV$1", HSSFFormulaParser.ToFormulaString(wb1, nr.NameDefinition)); // 1:1
+ ClassicAssert.AreEqual("Sheet2!$A$1:$IV$1", HSSFFormulaParser.ToFormulaString(wb1, nr.NameDefinition)); // 1:1
try
{
@@ -553,9 +553,9 @@ public void FindBuiltInNameRecord()
HSSFWorkbook wb2 = HSSFTestDataSamples.WriteOutAndReadBack(wb1);
wb1.Close();
- Assert.AreEqual(3, wb2.Workbook.NumNames);
+ ClassicAssert.AreEqual(3, wb2.Workbook.NumNames);
nr = wb2.Workbook.GetNameRecord(2);
- Assert.AreEqual("Sheet2!E:F,Sheet2!$A$9:$IV$12", HSSFFormulaParser.ToFormulaString(wb2, nr.NameDefinition)); // E:F,9:12
+ ClassicAssert.AreEqual("Sheet2!E:F,Sheet2!$A$9:$IV$12", HSSFFormulaParser.ToFormulaString(wb2, nr.NameDefinition)); // E:F,9:12
wb2.Close();
}
/**
@@ -574,7 +574,7 @@ public void Bug47920()
POIFSFileSystem fs2 = new POIFSFileSystem(new MemoryStream(bytes));
ClassID clsid2 = fs2.Root.StorageClsid;
- Assert.IsTrue(clsid1.Equals(clsid2));
+ ClassicAssert.IsTrue(clsid1.Equals(clsid2));
fs2.Close();
wb.Close();
@@ -645,7 +645,7 @@ public void DifferentPOIFS()
IWorkbook workbook = new HSSFWorkbook(dir, false);
ISheet sheet = workbook.GetSheetAt(0);
ICell cell = sheet.GetRow(0).GetCell(0);
- Assert.AreEqual("replaceMe", cell.RichStringCellValue.String);
+ ClassicAssert.AreEqual("replaceMe", cell.RichStringCellValue.String);
}
// Now re-check with preserving
@@ -654,7 +654,7 @@ public void DifferentPOIFS()
IWorkbook workbook = new HSSFWorkbook(dir, true);
ISheet sheet = workbook.GetSheetAt(0);
ICell cell = sheet.GetRow(0).GetCell(0);
- Assert.AreEqual("replaceMe", cell.RichStringCellValue.String);
+ ClassicAssert.AreEqual("replaceMe", cell.RichStringCellValue.String);
}
}
@@ -688,7 +688,7 @@ public void WordDocEmbeddedInXls()
}
}
}
- Assert.IsTrue(found);
+ ClassicAssert.IsTrue(found);
}
}
@@ -708,13 +708,13 @@ public void WriteWorkbookFromNPOIFS()
{
// Start as NPOIFS
HSSFWorkbook wb = new HSSFWorkbook(fs.Root, true);
- Assert.AreEqual(3, wb.NumberOfSheets);
- Assert.AreEqual("Root xls", wb.GetSheetAt(0).GetRow(0).GetCell(0).StringCellValue);
+ ClassicAssert.AreEqual(3, wb.NumberOfSheets);
+ ClassicAssert.AreEqual("Root xls", wb.GetSheetAt(0).GetRow(0).GetCell(0).StringCellValue);
// Will switch to POIFS
wb = HSSFTestDataSamples.WriteOutAndReadBack(wb);
- Assert.AreEqual(3, wb.NumberOfSheets);
- Assert.AreEqual("Root xls", wb.GetSheetAt(0).GetRow(0).GetCell(0).StringCellValue);
+ ClassicAssert.AreEqual(3, wb.NumberOfSheets);
+ ClassicAssert.AreEqual("Root xls", wb.GetSheetAt(0).GetRow(0).GetCell(0).StringCellValue);
}
finally
{
@@ -739,7 +739,7 @@ public void CellStylesLimit()
ICellStyle style = wb.CreateCellStyle();
}
- Assert.AreEqual(MAX_STYLES, wb.NumCellStyles);
+ ClassicAssert.AreEqual(MAX_STYLES, wb.NumCellStyles);
try
{
ICellStyle style = wb.CreateCellStyle();
@@ -747,10 +747,10 @@ public void CellStylesLimit()
}
catch (InvalidOperationException e)
{
- Assert.AreEqual("The maximum number of cell styles was exceeded. " +
+ ClassicAssert.AreEqual("The maximum number of cell styles was exceeded. " +
"You can define up to 4000 styles in a .xls workbook", e.Message);
}
- Assert.AreEqual(MAX_STYLES, wb.NumCellStyles);
+ ClassicAssert.AreEqual(MAX_STYLES, wb.NumCellStyles);
}
[Test]
public void SetSheetOrderHSSF()
@@ -795,18 +795,18 @@ public void SetSheetOrderHSSF()
wb.SetSheetOrder("other sheet", 0);
// names
- Assert.AreEqual("'first sheet'!D1", wb.GetName("name1").RefersToFormula);
- Assert.AreEqual("'other sheet'!C1", wb.GetName("name2").RefersToFormula);
+ ClassicAssert.AreEqual("'first sheet'!D1", wb.GetName("name1").RefersToFormula);
+ ClassicAssert.AreEqual("'other sheet'!C1", wb.GetName("name2").RefersToFormula);
// cells
- Assert.AreEqual("SUM('other sheet'!C1,'first sheet'!C1)", c2.CellFormula);
- Assert.AreEqual("'first sheet'!D3", c3.CellFormula);
- Assert.AreEqual("'other sheet'!D3", c4.CellFormula);
+ ClassicAssert.AreEqual("SUM('other sheet'!C1,'first sheet'!C1)", c2.CellFormula);
+ ClassicAssert.AreEqual("'first sheet'!D3", c3.CellFormula);
+ ClassicAssert.AreEqual("'other sheet'!D3", c4.CellFormula);
// conditional formatting
IConditionalFormatting cf = sheetCF.GetConditionalFormattingAt(0);
- Assert.AreEqual("'first sheet'!D1", cf.GetRule(0).Formula1);
- Assert.AreEqual("'other sheet'!D1", cf.GetRule(0).Formula2);
+ ClassicAssert.AreEqual("'first sheet'!D1", cf.GetRule(0).Formula1);
+ ClassicAssert.AreEqual("'other sheet'!D1", cf.GetRule(0).Formula2);
}
private bool HasEntry(DirectoryNode dirNode, String entryName)
@@ -832,21 +832,21 @@ public void ClonePictures()
for (int pictureIndex = 1; pictureIndex <= 4; pictureIndex++)
{
EscherBSERecord bse = iwb.GetBSERecord(pictureIndex);
- Assert.AreEqual(1, bse.Ref);
+ ClassicAssert.AreEqual(1, bse.Ref);
}
wb.CloneSheet(0);
for (int pictureIndex = 1; pictureIndex <= 4; pictureIndex++)
{
EscherBSERecord bse = iwb.GetBSERecord(pictureIndex);
- Assert.AreEqual(2, bse.Ref);
+ ClassicAssert.AreEqual(2, bse.Ref);
}
wb.CloneSheet(0);
for (int pictureIndex = 1; pictureIndex <= 4; pictureIndex++)
{
EscherBSERecord bse = iwb.GetBSERecord(pictureIndex);
- Assert.AreEqual(3, bse.Ref);
+ ClassicAssert.AreEqual(3, bse.Ref);
}
wb.Close();
}
@@ -866,7 +866,7 @@ public void EmptyDirectoryNode()
}
catch (ArgumentException ex)
{
- Assert.IsTrue(ex.Message.StartsWith("The supplied POIFSFileSystem does not contain a BIFF8"));
+ ClassicAssert.IsTrue(ex.Message.StartsWith("The supplied POIFSFileSystem does not contain a BIFF8"));
}
finally
{
@@ -908,9 +908,9 @@ public void SelectedSheetshort()
ConfirmActiveSelected(sheet3, false);
ConfirmActiveSelected(sheet4, false);
- Assert.AreEqual(0, wb.FirstVisibleTab);
+ ClassicAssert.AreEqual(0, wb.FirstVisibleTab);
wb.FirstVisibleTab = 2;
- Assert.AreEqual(2, wb.FirstVisibleTab);
+ ClassicAssert.AreEqual(2, wb.FirstVisibleTab);
wb.Close();
}
@@ -927,19 +927,19 @@ public void Names()
}
catch (InvalidOperationException e)
{
- Assert.IsTrue(e.Message.Contains("no defined names"), e.Message);
+ ClassicAssert.IsTrue(e.Message.Contains("no defined names"), e.Message);
}
HSSFName name = (HSSFName)wb.CreateName();
- Assert.IsNotNull(name);
+ ClassicAssert.IsNotNull(name);
- Assert.IsNull(wb.GetName("somename"));
+ ClassicAssert.IsNull(wb.GetName("somename"));
name.NameName = ("myname");
- Assert.IsNotNull(wb.GetName("myname"));
+ ClassicAssert.IsNotNull(wb.GetName("myname"));
- Assert.AreEqual(0, wb.GetNameIndex(name));
- Assert.AreEqual(0, wb.GetNameIndex("myname"));
+ ClassicAssert.AreEqual(0, wb.GetNameIndex(name));
+ ClassicAssert.AreEqual(0, wb.GetNameIndex("myname"));
try
{
@@ -948,7 +948,7 @@ public void Names()
}
catch (ArgumentOutOfRangeException e)
{
- Assert.IsTrue(e.Message.Contains("outside the allowable range"), e.Message);
+ ClassicAssert.IsTrue(e.Message.Contains("outside the allowable range"), e.Message);
}
try
@@ -958,7 +958,7 @@ public void Names()
}
catch (ArgumentOutOfRangeException e)
{
- Assert.IsTrue(e.Message.Contains("outside the allowable range"), e.Message);
+ ClassicAssert.IsTrue(e.Message.Contains("outside the allowable range"), e.Message);
}
}
[Test]
@@ -974,13 +974,13 @@ public void WriteProtection()
{
HSSFWorkbook wb = new HSSFWorkbook();
- Assert.IsFalse(wb.IsWriteProtected);
+ ClassicAssert.IsFalse(wb.IsWriteProtected);
wb.WriteProtectWorkbook("mypassword", "myuser");
- Assert.IsTrue(wb.IsWriteProtected);
+ ClassicAssert.IsTrue(wb.IsWriteProtected);
wb.UnwriteProtectWorkbook();
- Assert.IsFalse(wb.IsWriteProtected);
+ ClassicAssert.IsFalse(wb.IsWriteProtected);
}
[Test]
public void Bug50298()
@@ -1010,7 +1010,7 @@ public void Bug50298()
int expected = wb.Workbook.Size;
int written = wb.Workbook.Serialize(0, new byte[expected * 2]);
- Assert.AreEqual(expected, written, "Did not have the expected size when writing the workbook: written: " + written + ", but expected: " + expected);
+ ClassicAssert.AreEqual(expected, written, "Did not have the expected size when writing the workbook: written: " + written + ", but expected: " + expected);
HSSFWorkbook read = HSSFTestDataSamples.WriteOutAndReadBack(wb);
assertSheetOrder(read, "Invoice", "Invoice1", "Digest", "Deferred", "Received");
@@ -1053,7 +1053,7 @@ public void Bug50298a()
int expected = wb.Workbook.Size;
int written = wb.Workbook.Serialize(0, new byte[expected * 2]);
- Assert.AreEqual(expected, written, "Did not have the expected size when writing the workbook: written: " + written + ", but expected: " + expected);
+ ClassicAssert.AreEqual(expected, written, "Did not have the expected size when writing the workbook: written: " + written + ", but expected: " + expected);
HSSFWorkbook read = HSSFTestDataSamples.WriteOutAndReadBack(wb);
assertSheetOrder(wb, "Invoice", "Deferred", "Received", "Digest");
@@ -1081,25 +1081,25 @@ public void Bug54500()
assertSheetOrder(wb, "Sheet1", "Sheet2", "Sheet3", "ASheet");
HSSFName name = wb.GetName(nameName) as HSSFName;
- Assert.IsNotNull(name);
- Assert.AreEqual("ASheet!A1", name.RefersToFormula);
+ ClassicAssert.IsNotNull(name);
+ ClassicAssert.AreEqual("ASheet!A1", name.RefersToFormula);
MemoryStream stream = new MemoryStream();
wb.Write(stream, false);
assertSheetOrder(wb, "Sheet1", "Sheet2", "Sheet3", "ASheet");
- Assert.AreEqual("ASheet!A1", name.RefersToFormula);
+ ClassicAssert.AreEqual("ASheet!A1", name.RefersToFormula);
wb.RemoveSheetAt(1);
assertSheetOrder(wb, "Sheet1", "Sheet3", "ASheet");
- Assert.AreEqual("ASheet!A1", name.RefersToFormula);
+ ClassicAssert.AreEqual("ASheet!A1", name.RefersToFormula);
MemoryStream stream2 = new MemoryStream();
wb.Write(stream2, false);
assertSheetOrder(wb, "Sheet1", "Sheet3", "ASheet");
- Assert.AreEqual("ASheet!A1", name.RefersToFormula);
+ ClassicAssert.AreEqual("ASheet!A1", name.RefersToFormula);
HSSFWorkbook wb2 = new HSSFWorkbook(new ByteArrayInputStream(stream.ToArray()));
ExpectName(wb2, nameName, "ASheet!A1");
@@ -1113,8 +1113,8 @@ public void Bug54500()
private void ExpectName(HSSFWorkbook wb, String name, String expect)
{
HSSFName hssfName = wb.GetName(name) as HSSFName;
- Assert.IsNotNull(hssfName);
- Assert.AreEqual(expect, hssfName.RefersToFormula);
+ ClassicAssert.IsNotNull(hssfName);
+ ClassicAssert.AreEqual(expect, hssfName.RefersToFormula);
}
[Test]
@@ -1135,7 +1135,7 @@ public void Best49423()
if (anchor is HSSFClientAnchor)
{ // absolute coordinates
HSSFClientAnchor clientAnchor = (HSSFClientAnchor)anchor;
- Assert.IsNotNull(clientAnchor);
+ ClassicAssert.IsNotNull(clientAnchor);
//System.out.Println(clientAnchor.Row1 + "," + clientAnchor.Row2);
found = true;
}
@@ -1143,14 +1143,14 @@ public void Best49423()
{
// shape is grouped and the anchor is expressed in the coordinate system of the group
HSSFChildAnchor childAnchor = (HSSFChildAnchor)anchor;
- Assert.IsNotNull(childAnchor);
+ ClassicAssert.IsNotNull(childAnchor);
//System.out.Println(childAnchor.Dy1 + "," + childAnchor.Dy2);
found = true;
}
}
}
- Assert.IsTrue(found, "Should find some images via Client or Child anchors, but did not find any at all");
+ ClassicAssert.IsTrue(found, "Should find some images via Client or Child anchors, but did not find any at all");
workbook.Close();
}
@@ -1198,9 +1198,9 @@ public void TestRewriteFileBug58480()
}
finally
{
- Assert.IsTrue(file.Exists);
+ ClassicAssert.IsTrue(file.Exists);
file.Delete();
- Assert.IsTrue(!File.Exists(file.FullName));
+ ClassicAssert.IsTrue(!File.Exists(file.FullName));
}
}
@@ -1348,7 +1348,7 @@ public void InPlaceWrite()
// Open from the temp file in read-write mode
HSSFWorkbook wb = new HSSFWorkbook(new NPOIFSFileSystem(file, false));
- Assert.AreEqual(3, wb.NumberOfSheets);
+ ClassicAssert.AreEqual(3, wb.NumberOfSheets);
// Change
wb.RemoveSheetAt(2);
@@ -1360,8 +1360,8 @@ public void InPlaceWrite()
wb.Close();
wb = new HSSFWorkbook(new NPOIFSFileSystem(file));
- Assert.AreEqual(1, wb.NumberOfSheets);
- Assert.AreEqual("Changed!", wb.GetSheetAt(0).GetRow(0).GetCell(0).ToString());
+ ClassicAssert.AreEqual(1, wb.NumberOfSheets);
+ ClassicAssert.AreEqual("Changed!", wb.GetSheetAt(0).GetRow(0).GetCell(0).ToString());
wb.Close();
}
@@ -1380,7 +1380,7 @@ public void TestWriteToNewFile()
// Read and check
wb = new HSSFWorkbook(new NPOIFSFileSystem(file));
- Assert.AreEqual(3, wb.NumberOfSheets);
+ ClassicAssert.AreEqual(3, wb.NumberOfSheets);
wb.Close();
}
diff --git a/testcases/main/HSSF/UserModel/TestLinkTable.cs b/testcases/main/HSSF/UserModel/TestLinkTable.cs
index b6f321f28..773265256 100644
--- a/testcases/main/HSSF/UserModel/TestLinkTable.cs
+++ b/testcases/main/HSSF/UserModel/TestLinkTable.cs
@@ -2,7 +2,7 @@ namespace TestCases.HSSF.UserModel
{
using System;
using NPOI.HSSF.UserModel;
- using NUnit.Framework;
+ using NUnit.Framework;using NUnit.Framework.Legacy;
using TestCases.HSSF;
/**
@@ -39,7 +39,7 @@ public void TestLinkTableWithoutExternalBookRecord_bug45046()
throw;
}
// some other sanity Checks
- Assert.AreEqual(3, wb.NumberOfSheets);
+ ClassicAssert.AreEqual(3, wb.NumberOfSheets);
String formula = wb.GetSheetAt(0).GetRow(4).GetCell(13).CellFormula;
if ("ipcSummenproduktIntern($P5,N$6,$A$9,N$5)".Equals(formula))
@@ -49,7 +49,7 @@ public void TestLinkTableWithoutExternalBookRecord_bug45046()
// This is observable in version 3.0
}
- Assert.AreEqual("ipcSummenproduktIntern($C5,N$2,$A$9,N$1)", formula);
+ ClassicAssert.AreEqual("ipcSummenproduktIntern($C5,N$2,$A$9,N$1)", formula);
}
[Test]
public void TestMultipleExternSheetRecords_bug45698()
@@ -69,7 +69,7 @@ public void TestMultipleExternSheetRecords_bug45698()
throw;
}
// some other sanity Checks
- Assert.AreEqual(7, wb.NumberOfSheets);
+ ClassicAssert.AreEqual(7, wb.NumberOfSheets);
}
[Test]
public void TestExtraSheetRefs_bug45978()
@@ -115,7 +115,7 @@ It is not Clear exactly what externSheetIndex #4 would refer to. Excel seems to
}
throw e;
}
- Assert.AreEqual("Data!$A2", cellFormula);
+ ClassicAssert.AreEqual("Data!$A2", cellFormula);
}
}
}
\ No newline at end of file
diff --git a/testcases/main/HSSF/UserModel/TestMatrixFormulasFromBinarySpreadsheet.cs b/testcases/main/HSSF/UserModel/TestMatrixFormulasFromBinarySpreadsheet.cs
index 3081a048d..d104de217 100644
--- a/testcases/main/HSSF/UserModel/TestMatrixFormulasFromBinarySpreadsheet.cs
+++ b/testcases/main/HSSF/UserModel/TestMatrixFormulasFromBinarySpreadsheet.cs
@@ -1,7 +1,7 @@
using NPOI.HSSF.UserModel;
using NPOI.SS.Formula.Eval;
using NPOI.SS.UserModel;
-using NUnit.Framework;
+using NUnit.Framework;using NUnit.Framework.Legacy;
using System;
using System.Collections.Generic;
using System.Text;
@@ -76,7 +76,7 @@ private static void processFunctionGroup(List