コード例 #1
0
        public void TestConstructor_MessageProvided()
        {
            BattleshipException battleshipEx = new BattleshipException("Test");

            Assert.AreEqual("Test", battleshipEx.Message);
            Assert.AreEqual(null, battleshipEx.InnerException);
        }
コード例 #2
0
        public void TestConstructor_NoParameters()
        {
            BattleshipException battleshipEx = new BattleshipException();

            Assert.AreEqual("Error in the application.", battleshipEx.Message);
            Assert.AreEqual(null, battleshipEx.InnerException);
        }
コード例 #3
0
        public void TestConstructor_MessageAndInnerExceptionProvided()
        {
            Exception           innerEx      = new InvalidOperationException();
            BattleshipException battleshipEx =
                new BattleshipException("Test", innerEx);

            Assert.AreEqual("Test", battleshipEx.Message);
            Assert.AreSame(innerEx, battleshipEx.InnerException);
        }