示例#1
0
        public ICollection <INavCommand> Forward(Screen screen)
        {
            var entry   = _registry.Resolve(screen);
            var command = new ForwardNavCommand(screen, entry.Resolver);

            return(new[] { command });
        }
示例#2
0
        public void ApplyForwardCommandTest()
        {
            // - Arrange
            var screen      = new ScreenStub();
            var screenStack = new ScreenStack();

            var screenResorverStub = new Mock <IScreenResolver>().Object;
            var navigatorMock      = new Mock <Navigator>();

            var command = new ForwardNavCommand(screen, screenResorverStub);

            // - Act
            command.Apply(navigatorMock.Object, screenStack);

            // - Assert
            CollectionAssert.Contains(screenStack, screen);
            navigatorMock.Verify(
                it => it.Forward(screen, screenResorverStub),
                Times.Once);
        }