Exemple #1
0
            public void Should_Notify_If_Keyborad_Hide()
            {
                KeyboardService sut        = new KeyboardServiceFixture();
                var             isNotified = false;

                sut.KeyboardChanged.Subscribe(_ => isNotified = true);

                //When
                NSNotificationCenter.DefaultCenter.PostNotificationName(UIKeyboard.WillHideNotification, null);

                //Then
                isNotified.Should().BeTrue();
            }
Exemple #2
0
            public void Should_Be_Greater_Than_Zero_If_Notified()
            {
                //Given
                KeyboardService sut    = new KeyboardServiceFixture();
                var             result = new KeyboardData();

                sut.KeyboardChanged.Subscribe(d => result = d);

                //When
                NSNotificationCenter.DefaultCenter.PostNotificationName(UIKeyboard.WillShowNotification, null);

                //Then
                result.Height.Should().BeGreaterThan(0);
            }
Exemple #3
0
            public void Should_Be_Faslse_If_Keyboard_Hides()
            {
                //Given
                KeyboardService sut    = new KeyboardServiceFixture();
                var             result = new KeyboardData();

                sut.KeyboardChanged.Subscribe((d => result = d));

                //When
                NSNotificationCenter.DefaultCenter.PostNotificationName(UIKeyboard.WillHideNotification, null);

                //Then
                result.IsVisible.Should().BeFalse();
            }