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);
        }
        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.That(result, Is.InstanceOf <SessionInvalidException>());
            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);
        }