コード例 #1
0
        public void AddOut_Should_Throw_On_Empty_Label()
        {
            var table = new TestTable();

            table
                .Invoking(t => t.AddOut("", 0x0000))
                .ShouldThrow<ArgumentException>();
        }
コード例 #2
0
        public void AddIn_Should_Throw_On_Empty_Label()
        {
            var table = new TestTable();

            table
            .Invoking(t => t.AddIn(0x0000, ""))
            .ShouldThrow <ArgumentException>();
        }
コード例 #3
0
        public void AddIn_Should_Throw_On_Null_Label()
        {
            var table = new TestTable();

            table
                .Invoking(t => t.AddIn(0x0000, null))
                .ShouldThrow<ArgumentNullException>();
        }
コード例 #4
0
        public void AddIn_Should_Throw_On_Null_Label()
        {
            var table = new TestTable();

            table
            .Invoking(t => t.AddIn(0x0000, null))
            .ShouldThrow <ArgumentNullException>();
        }
コード例 #5
0
        public void LoadPacketCodes_Should_Not_Throw()
        {
            var table = new TestTable();

            table
            .Invoking(t => t.LoadPacketCodes())
            .ShouldNotThrow();
        }
コード例 #6
0
        public void TryGetOutgoingCode_Should_Throw_On_Empty_Label()
        {
            var table = new TestTable();

            table
            .Invoking(TryGetEmptyCode)
            .ShouldThrow <ArgumentException>();
        }
コード例 #7
0
        public void GetIncomingLabel_Should_Throw_KeyNotFoundException_For_Missing_Code()
        {
            const int Zero = 0x0000;
            const int One  = 0x0001;

            var table = new TestTable();

            table.AddIn(Zero, "Zero");

            table
            .Invoking(t => t.GetIncomingLabel(One))
            .ShouldThrow <KeyNotFoundException>();
        }
コード例 #8
0
        public void GetOutgoingCode_Should_Throw_For_Missing_Label()
        {
            const int    One        = 0x0001;
            const string ZeroString = "Zero";
            const string OneString  = "One";

            var table = new TestTable();

            table.AddOut(OneString, One);

            table
            .Invoking(t => t.GetOutgoingCode(ZeroString))
            .ShouldThrow <KeyNotFoundException>();
        }
コード例 #9
0
        public void TryGetOutgoingCode_Should_Throw_On_Null_Label()
        {
            var table = new TestTable();

            table
                .Invoking(TryGetNullCode)
                .ShouldThrow<ArgumentNullException>();
        }
コード例 #10
0
        public void LoadPacketCodes_Should_Not_Throw()
        {
            var table = new TestTable();

            table
                .Invoking(t => t.LoadPacketCodes())
                .ShouldNotThrow();
        }
コード例 #11
0
        public void GetOutgoingCode_Should_Throw_For_Missing_Label()
        {
            const int One = 0x0001;
            const string ZeroString = "Zero";
            const string OneString = "One";

            var table = new TestTable();
            table.AddOut(OneString, One);

            table
                .Invoking(t => t.GetOutgoingCode(ZeroString))
                .ShouldThrow<KeyNotFoundException>();
        }
コード例 #12
0
        public void GetIncomingLabel_Should_Throw_KeyNotFoundException_For_Missing_Code()
        {
            const int Zero = 0x0000;
            const int One = 0x0001;

            var table = new TestTable();
            table.AddIn(Zero, "Zero");

            table
                .Invoking(t => t.GetIncomingLabel(One))
                .ShouldThrow<KeyNotFoundException>();
        }