public void InvalidCsvExceptionTest1() { var e = new InvalidCsvException(); Assert.IsNotNull(e); Assert.IsNotNull(e.Message); }
public void InvalidCsvExceptionTest2() { string message = "Message"; var e = new InvalidCsvException(message); Assert.IsNotNull(e); Assert.AreEqual(message, e.Message); }
public void InvalidCsvExceptionTest3() { string message = "Message"; var inner = new Exception(); var e = new InvalidCsvException(message, inner); Assert.IsNotNull(e); Assert.AreSame(inner, e.InnerException); Assert.AreEqual(message, e.Message); }
public void ToStringTest() { string message = "Message"; int lineNumber = 4711; int charIndex = 42; var e = new InvalidCsvException(message, lineNumber, charIndex); string s = e.ToString(); Assert.IsNotNull(s); TestContext.WriteLine(s); }
public void InvalidCsvExceptionTest4() { string message = "Message"; int lineNumber = 4711; int charIndex = 42; var e = new InvalidCsvException(message, lineNumber, charIndex); Assert.IsNotNull(e); Assert.AreEqual(message, e.Message); Assert.AreEqual(lineNumber, e.CsvLineNumber); Assert.AreEqual(charIndex, e.CsvCharIndex); }
public void GetObjectDataTest() { string message = "Message"; int lineNumber = 4711; int charIndex = 42; var e = new InvalidCsvException(message, lineNumber, charIndex); using var memStream = new MemoryStream(); var bf = new BinaryFormatter(); bf.Serialize(memStream, e); memStream.Position = 0; var e2 = (InvalidCsvException)bf.Deserialize(memStream); Assert.AreEqual(e.Message, e2.Message); Assert.AreEqual(e.CsvLineNumber, e2.CsvLineNumber); Assert.AreEqual(e.CsvCharIndex, e2.CsvCharIndex); }