Exemple #1
0
        public void TestDefaultConstructor()
        {
            RequestUriTooLongException testException = new RequestUriTooLongException();

            string testExceptionString = testException.ToString();

            Assert.IsNotNull(testExceptionString);
        }
    public void TestInnerException() {
      Exception inner = new Exception("This is a test");
      RequestUriTooLongException testException = new RequestUriTooLongException(
        "Hello World", inner
      );

      Assert.AreSame(inner, testException.InnerException);
    }
Exemple #3
0
        public void TestInnerException()
        {
            Exception inner = new Exception("This is a test");
            RequestUriTooLongException testException = new RequestUriTooLongException(
                "Hello World", inner
                );

            Assert.AreSame(inner, testException.InnerException);
        }
    public void TestSerialization() {
      BinaryFormatter formatter = new BinaryFormatter();

      using(MemoryStream memory = new MemoryStream()) {
        RequestUriTooLongException exception1 = new RequestUriTooLongException(
          "Hello World"
        );

        formatter.Serialize(memory, exception1);
        memory.Position = 0;
        object exception2 = formatter.Deserialize(memory);

        Assert.IsInstanceOf<RequestUriTooLongException>(exception2);
        Assert.AreEqual(
          exception1.Message, ((RequestUriTooLongException)exception2).Message
        );
      }
    }
Exemple #5
0
        public void TestSerialization()
        {
            BinaryFormatter formatter = new BinaryFormatter();

            using (MemoryStream memory = new MemoryStream()) {
                RequestUriTooLongException exception1 = new RequestUriTooLongException(
                    "Hello World"
                    );

                formatter.Serialize(memory, exception1);
                memory.Position = 0;
                object exception2 = formatter.Deserialize(memory);

                Assert.IsInstanceOf <RequestUriTooLongException>(exception2);
                Assert.AreEqual(
                    exception1.Message, ((RequestUriTooLongException)exception2).Message
                    );
            }
        }
    public void TestDefaultConstructor() {
      RequestUriTooLongException testException = new RequestUriTooLongException();

      string testExceptionString = testException.ToString();
      Assert.IsNotNull(testExceptionString);
    }