Beispiel #1
0
        public void AddOneListIntoAnotherWithDirectFalseFlagTest()
        {
            var list = new List <int> {
                1, 2, 3, 4, 5
            };

            var target = Colls.AddIf(list, 6, false).ToList();

            list.Count.ShouldBe(5);

            target[0].ShouldBe(1);
            target[1].ShouldBe(2);
            target[2].ShouldBe(3);
            target[3].ShouldBe(4);
            target[4].ShouldBe(5);
        }
Beispiel #2
0
        public void AddOneListIntoAnotherWithDirectTrueConditionAndValTest()
        {
            var list = new List <int> {
                1, 2, 3, 4, 5
            };

            var target = Colls.AddIf(list, 6, v => v > 5).ToList();

            list.Count.ShouldBe(5);
            target.Count.ShouldBe(6);

            target[0].ShouldBe(1);
            target[1].ShouldBe(2);
            target[2].ShouldBe(3);
            target[3].ShouldBe(4);
            target[4].ShouldBe(5);
            target[5].ShouldBe(6);
        }