public void AddLastNew_AddMultiple_ShouldAddAllNodes(params string[] parms) { // arrange var sut = new CodePath(); var list = new List <Method>(); foreach (var name in parms) { var mockedMethod = Mock.Create <Method>(); Mock.Arrange(() => mockedMethod.FullName).Returns(name); list.Add(mockedMethod); } // act foreach (var method in list) { sut = sut.AddLastNew(method); } // assert Assert.Equal(parms.Length, sut.Count()); Assert.Equal(parms.Length, sut.Length); foreach (var pair in sut.Zip(parms, (x, y) => new KeyValuePair <Method, String>(x, y))) { Assert.Equal(pair.Value, pair.Key.FullName); } }