示例#1
0
        public void Serializable()
        {
            var ex        = new AuthorizationException("Test", new ScorpioException("InnerException"));
            var formatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
            var stream    = new MemoryStream();

            formatter.Serialize(stream, ex);
            stream.Seek(0, SeekOrigin.Begin);
            var act = formatter.Deserialize(stream);

            act.ShouldBeOfType <AuthorizationException>().InnerException.ShouldBeOfType <ScorpioException>().Message.ShouldBe("InnerException");
        }
示例#2
0
        public void InnerException()
        {
            var ex = new AuthorizationException("Test", new ScorpioException("InnerException"));

            ex.InnerException.ShouldBeOfType <ScorpioException>().Message.ShouldBe("InnerException");
        }
示例#3
0
        public void LogLevel()
        {
            var ex = new AuthorizationException();

            ex.LogLevel.ShouldBe(Microsoft.Extensions.Logging.LogLevel.Warning);
        }