public void PushArgs_ReturnsNull_IfPushedDiffersFromPopped()
        {
            TestArgs1 ta1 = new TestArgs1();

            sut.PushArgs(Page1Name, ta1);

            bool succeeded = sut.TryPopArgs(Page1Name, out TestArgs2 ta2);

            Assert.IsFalse(succeeded);
            Assert.IsNull(ta2);
        }
        public void PushArgs_ReturnsSameAsPopped()
        {
            TestArgs1 ta1 = new TestArgs1();

            sut.PushArgs(Page1Name, ta1);

            bool succeeded = sut.TryPopArgs(Page1Name, out TestArgs1 ta2);

            Assert.IsTrue(succeeded);
            Assert.AreSame(ta1, ta2);
        }
        public void PopArgs_Twice_ReturnsSameArgsTheSecondTime()
        {
            TestArgs1 ta1 = new TestArgs1();

            sut.PushArgs(Page1Name, ta1);

            bool succeeded = sut.TryPopArgs(Page1Name, out TestArgs1 ta2);

            Assert.IsTrue(succeeded);
            Assert.AreSame(ta1, ta2);

            succeeded = sut.TryPopArgs(Page1Name, out ta2);
            Assert.IsTrue(succeeded);
            Assert.AreSame(ta1, ta2);
        }
        public void MapOnTo_Test()
        {
            var target = new SyntheticArguments(new IArgument[]
            {
                new PositionalArgument("test1"),
                new NamedArgument("b", "test2"),
                new FlagArgument("c")
            });
            var result = new TestArgs1();

            target.MapOnto(result);
            result.A.Should().Be("test1");
            result.B.Should().Be("test2");
            result.C.Should().BeTrue();
            result.D.Should().BeFalse();
        }
        public void PushArgs_AreHandledPerPage()
        {
            TestArgs1 ta1 = new TestArgs1();

            sut.PushArgs(Page1Name, ta1);

            bool succeeded = sut.TryPopArgs(Page1Name, out TestArgs1 actual1);

            Assert.IsTrue(succeeded);
            Assert.AreSame(ta1, actual1);

            TestArgs2 ta2 = new TestArgs2();

            sut.PushArgs(Page2Name, ta2);

            succeeded = sut.TryPopArgs(Page2Name, out TestArgs2 actual2);
            Assert.IsTrue(succeeded);
            Assert.AreSame(ta2, actual2);
        }