public void shouldConcatenateASeriesOfLines() { var notifyCalls = new List <Tuple <int, int> >(); var codeModule = new Mock <ICodeModuleWrapper>(); codeModule.Setup(cm => cm.get_Lines(It.IsAny <int>(), It.IsAny <int>())) .Callback <int, int>((start, count) => notifyCalls.Add(Tuple.Create(start, count))); var selections = new List <Selection>() { new Selection(5, 1, 5, 20), new Selection(10, 1, 12, 20) }; var model = new Mock <IExtractMethodModel>(); var method = new ExtractedMethod(); method.Accessibility = Accessibility.Private; method.Parameters = new List <ExtractedParameter>(); method.MethodName = "NewMethod"; model.Setup(m => m.RowsToRemove).Returns(selections); model.Setup(m => m.Method).Returns(method); var SUT = new ExtractMethodExtraction(); //Act SUT.constructLinesOfProc(codeModule.Object, model.Object); //Assert Assert.AreEqual(Tuple.Create(5, 1), notifyCalls[0]); Assert.AreEqual(Tuple.Create(10, 3), notifyCalls[1]); }