Exemple #1
0
        public void SingleSubstitution()
        {
            var sut = new CompositeListExpander(new[]
            {
                new ListExpander <int>((value, target) => target(value * 2))
            });

            Assert.Equal(new object[] { 2, 1, 4, 6, 3 }, sut.Expand(new object[] { 1, 2, 3 }));
        }
Exemple #2
0
        public void DoubleSubstitution()
        {
            var sut = new CompositeListExpander(new[]
            {
                new ListExpander <int>((value, target) => target(value * 2)),
                new ListExpander <int>((value, target) => target(value * 3))
            });

            Assert.Equal(new object[] { 6, 2, 3, 1, 12, 4, 18, 9 }, sut.Expand(new object[] { 1, 2, 3 }));
        }
Exemple #3
0
        public void NoSubstitutions()
        {
            var sut = new CompositeListExpander(Array.Empty <IListExpander>());

            Assert.Equal(new object[] { 1, 2, 3 }, sut.Expand(new object[] { 1, 2, 3 }));
        }