public void CreateWithMessage()
 {
     TestHelpers.EnsureLanguageIsValid();
     string message = "An error has occured";
     SessionInvalidException exception = new SessionInvalidException(message);
     Assert.AreEqual(message, exception.Message);
 }
 public void PassThroughSerialisation()
 {
     TestHelpers.EnsureLanguageIsValid();
     SessionInvalidException exception = new SessionInvalidException();
     object result = TestHelpers.RunSerialisationTest(exception);
     Assert.IsNotNull(result);
     Assert.IsInstanceOfType(typeof(SessionInvalidException), result);
     Assert.AreEqual("The session token is either invalid or is for a session that has expired.", (result as SessionInvalidException).Message);
 }
 public void CreateWithMessageAndException()
 {
     TestHelpers.EnsureLanguageIsValid();
     string message = "An error has occured";
     Exception innerException = new Exception("An inner exception");
     SessionInvalidException exception = new SessionInvalidException(message, innerException);
     Assert.AreEqual(message, exception.Message);
     Assert.AreEqual(innerException, exception.InnerException);
 }
 public void CreateDefault()
 {
     TestHelpers.EnsureLanguageIsValid();
     SessionInvalidException exception = new SessionInvalidException();
     Assert.AreEqual("The session token is either invalid or is for a session that has expired.", exception.Message);
 }