Exemplo n.º 1
0
            public async Task Should_Call_Popup_Navigation()
            {
                // Given
                var navigation            = Substitute.For <IPopupNavigation>();
                PopupViewStackService sut = new PopupViewStackServiceFixture().WithNavigation(navigation);

                // When
                await sut.PopPopup();

                // Then
                await navigation.Received(1).PopAsync(Arg.Any <bool>()).ConfigureAwait(false);
            }
Exemplo n.º 2
0
            public async Task Should_Observe_Popped()
            {
                // Given
                bool pushed = false;
                PopupViewStackService sut = new PopupViewStackServiceFixture().WithNavigation(new PopupNavigationMock());

                sut.Popped.Select(_ => true).Subscribe(x => pushed = x);

                // When
                await sut.PushPopup(new NavigableViewModelMock());

                await sut.PopPopup();

                // Then
                pushed.Should().BeTrue();
            }
Exemplo n.º 3
0
            public async Task Should_Call_Destroy()
            {
                // Given
                var viewModel = Substitute.For <IEverything>();
                var popup     = new PopupMock
                {
                    ViewModel = viewModel
                };
                bool pushed = false;
                PopupViewStackService sut = new PopupViewStackServiceFixture().WithNavigation(new PopupNavigationMock());

                sut.Popped.Select(_ => true).Subscribe(x => pushed = x);

                // When
                await sut.PushPopup(viewModel);

                await sut.PopPopup();

                // Then
                ((IDestructible)popup.ViewModel).Received(1).Destroy();
            }