public void AddOut_Should_Return_False_On_Adding_Existing_Label()
        {
            const int One = 0x0001;
            const string OneString = "One";

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

            table.AddOut(OneString, One).Should().BeFalse();
        }
        public void AddOut_Should_Return_True_On_Adding_New_Label()
        {
            const int One = 0x0001;
            var table = new TestTable();

            table.AddOut("One", One).Should().BeTrue();
        }
Esempio n. 3
0
        public void TryGetOutgoingCode_Should_Return_True_For_Existing_Label()
        {
            const int    Zero       = 0x0000;
            const string ZeroString = "Zero";

            var table = new TestTable();

            table.AddOut(ZeroString, Zero);

            ushort code;

            table.TryGetOutgoingCode(ZeroString, out code).Should().BeTrue();
        }
Esempio n. 4
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>();
        }
Esempio n. 5
0
        public void TryGetOutgoingCode_Should_Retrieve_Correct_Code()
        {
            const int    One       = 0x0001;
            const string OneString = "One";

            var table = new TestTable();

            table.AddOut(OneString, One);

            ushort code;

            table.TryGetOutgoingCode(OneString, out code);
            code.Should().Be(One);
        }
        public void TryGetOutgoingCode_Should_Return_True_For_Existing_Label()
        {
            const int Zero = 0x0000;
            const string ZeroString = "Zero";

            var table = new TestTable();
            table.AddOut(ZeroString, Zero);

            ushort code;
            table.TryGetOutgoingCode(ZeroString, out code).Should().BeTrue();
        }
        public void TryGetOutgoingCode_Should_Return_False_For_Missing_Label()
        {
            const int Zero = 0x0000;

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

            ushort code;
            table.TryGetOutgoingCode("One", out code).Should().BeFalse();
        }
        public void TryGetOutgoingCode_Should_Retrieve_Correct_Code()
        {
            const int One = 0x0001;
            const string OneString = "One";

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

            ushort code;
            table.TryGetOutgoingCode(OneString, out code);
            code.Should().Be(One);
        }
        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>();
        }
Esempio n. 10
0
        public void GetOutgoingCode_Should_Return_Correct_Code()
        {
            const int One = 0x0001;
            const string OneString = "One";

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

            table.GetOutgoingCode(OneString).Should().Be(One);
        }