Exemple #1
0
        public void ElementShouldBeVisible_IfInputIsAlphaNumeric(Key key, Visibility expected)
        {
            // arrange
            _addSymbolView.Setup(x => x.Visibility).Returns(Visibility.Collapsed);
            _addSymbolView.Setup(x => x.SetSymbol(It.Is <string>(s => s == ConvertToString(key))));

            // act
            VisibilityBehaviors.DoShowWhenKeystroke(_addSymbolView.Object, key);

            // assert
            _addSymbolView.VerifySet(x => x.Visibility = expected);
        }
Exemple #2
0
        public void ShouldNotProcessIfKeystrokeIsNonAlphaNumeric(Key key)
        {
            // arrange
            _addSymbolView.Setup(x => x.Visibility).Returns(Visibility.Collapsed);
            _addSymbolView.Setup(x => x.SetSymbol(It.Is <string>(s => s == ConvertToString(key))));

            // act
            VisibilityBehaviors.DoShowWhenKeystroke(_addSymbolView.Object, key);

            // assert
            _addSymbolView.VerifySet(x => x.Visibility = Visibility.Collapsed, Times.Never);
            _addSymbolView.VerifySet(x => x.Visibility = Visibility.Visible, Times.Never);
        }