示例#1
0
        public void NullStackItemsAreEqualToNull()
        {
            var item1 = new HistoryStackItem("titi", 0, 4);
            HistoryStackItem item2 = null;

            (item1 == null).ShouldBeFalse();
            (item2 == null).ShouldBeTrue();
            (item1 == item2).ShouldBeFalse();
            (item2 == item1).ShouldBeFalse();
        }
示例#2
0
        public void EquivalentStackItemsAreEqual()
        {
            var item1 = new HistoryStackItem("titi", 0, 4);
            var item2 = item1;

            (item1 == item2).ShouldBeTrue();

            item2 = new HistoryStackItem("titi", 0, 4);

            (item1 == item2).ShouldBeTrue();
        }
示例#3
0
        private void ApplyUndoOrRedo(HistoryStackItem stackItem)
        {
            lockTextChangedEvent = true;

            UnmaskedConnectionString = stackItem.Value;

            Text = PasswordHelper.Mask(UnmaskedConnectionString);

            SelectionStart  = stackItem.SelectionStart;
            SelectionLength = stackItem.SelectionLength;

            lockTextChangedEvent = false;
        }
示例#4
0
        public void NonEquivalentStackItemsArentEqual()
        {
            var item1 = new HistoryStackItem("titi", 0, 4);
            var item2 = new HistoryStackItem("moto", 0, 4);

            (item1 == item2).ShouldBeFalse();

            item2 = new HistoryStackItem("titi", 1, 4);

            (item1 == item2).ShouldBeFalse();

            item2 = new HistoryStackItem("titi", 0, 3);

            (item1 == item2).ShouldBeFalse();
        }