Exemple #1
0
        public void Message()
        {
            var ex = new PermissionNotFondException("TestPermission", "Message");

            ex.PermissionName.ShouldBe("TestPermission");
            ex.Message.ShouldBe("Message");
        }
Exemple #2
0
        public void InnerException()
        {
            var ex = new PermissionNotFondException("Test", "Message", new ScorpioException("InnerException"));

            ex.PermissionName.ShouldBe("Test");
            ex.Message.ShouldBe("Message");
            ex.InnerException.ShouldBeOfType <ScorpioException>().Message.ShouldBe("InnerException");
        }
Exemple #3
0
        public void Serializable()
        {
            var ex        = new PermissionNotFondException("Test", "Message", 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 <PermissionNotFondException>().InnerException.ShouldBeOfType <ScorpioException>().Message.ShouldBe("InnerException");
        }
Exemple #4
0
        public void PermissionName()
        {
            var ex = new PermissionNotFondException("TestPermission");

            ex.PermissionName.ShouldBe("TestPermission");
        }