Exemple #1
0
        public void ConvertToChar_ShouldBeSuccessful(Key key, string expected)
        {
            // act
            var result = VisibilityBehaviors.ConvertToChar(key);

            // assert
            result.ShouldBe(expected);
        }
Exemple #2
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 #3
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);
        }
Exemple #4
0
 private static string ConvertToString(Key key)
 {
     return(VisibilityBehaviors.ConvertToChar(key));
 }