예제 #1
0
            public async Task Should_Call_Popup_Navigation()
            {
                // Given
                var navigation            = Substitute.For <IPopupNavigation>();
                PopupViewStackService sut = new PopupViewStackServiceFixture().WithNavigation(navigation);
                await sut.PushPopup(new NavigableViewModelMock());

                // When
                await sut.PopAllPopups();

                // Then
                await navigation.Received(1).PopAllAsync().ConfigureAwait(false);
            }
예제 #2
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.PopAllPopups();

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