コード例 #1
0
    public void Constructors()
    {
      Assert.Throws<ArgumentNullException>(() => new TranslatorException(null));

      var innerException = new Exception();
      var error = new Error(1, "text");
      var exception = new TranslatorException(error, innerException);
      Assert.True(ReferenceEquals(exception.InnerException, innerException));
      Assert.Equal("text", exception.Message);
      Assert.True(ReferenceEquals(error, exception.Error));
    }
コード例 #2
0
        public void Constructors()
        {
            Assert.Throws <ArgumentNullException>(() => new TranslatorException(null));

            var innerException = new Exception();
            var error          = new Error(1, "text");
            var exception      = new TranslatorException(error, innerException);

            Assert.True(ReferenceEquals(exception.InnerException, innerException));
            Assert.Equal("text", exception.Message);
            Assert.True(ReferenceEquals(error, exception.Error));
        }