public void DBExceptionConstructorTest1() { const string message = "Testmessage"; DBException target = new DBException(message); Assert.IsNotNull(target, "DBException Object created."); Assert.AreEqual(message, target.Message, "Messages are equal."); }
public void DBExceptionConstructorTest2() { const string message = "Testmessage"; Exception innnerException = new Exception("Inner exception"); DBException target = new DBException(message, innnerException); Assert.IsNotNull(target, "DBException Object created."); Assert.AreEqual(message, target.Message, "Messages are equal."); Assert.AreSame(innnerException, target.InnerException, "Inner exception equal."); }
public void DBExceptionSerializeTest() { const string message = "Error Serial test DBException"; DBException testException = new DBException(message); const string fileName = "Exception.test"; Assert.IsTrue(Serializer.Serialize(fileName, testException), "Serialized"); DBException result = (Serializer.Deserialize<DBException>(fileName)); Assert.IsInstanceOfType(result, typeof(DBException), "Deserialized"); Assert.IsTrue(message.Equals(result.ExceptionMessage), "Exception message equal"); }
public void DBExceptionConstructorTest() { DBException target = new DBException(); Assert.IsNotNull(target, "DBException Object created."); }