I'm working with big set of articles from a Website. I retrieve them by querying the database and apply to this data a set of methods.
Let's write some pseudocode to clarify this context:
List<Article> articles = GetArticlesFromDatabase(); intermediateResult1 = FirstMethod(articles); intermediateResult2 = SecondMethod(intermediateResult1 ); output = FinalMethod(intermediateResult2);
I'd like to be able to unit test FinalMethod using mocked data. And instead of writing the sample data manually I'd rather use the real data saved in a example data file at the previous execution of the software.
Is there a name for this practice? Are there patterns and frameworks to avoid reinventing the wheel?