title: How can I setup List<string> ReadBooklets method with mock?
body: <p>I have two class and one interface. I want to use mock in my test. I want to setup my <code>ReadBooklets()</code> method. But I don't know how can I do it. </p>
  
  <pre><code>class FileHandler : IHandler
  {
      public List&lt;string&gt; ReadBooklets() // A booklets.txt-ben található mérési azonosítókat beolvassa egy string listába
      {
          List&lt;string&gt; booklets = new List&lt;string&gt;();
          booklets = File.ReadAllLines("booklets.txt").ToList();
          return booklets;
      }
  }
  public class XMLHandler
  {
      FileHandler fileHandler = new FileHandler();
      public IHandler handler;
      public void RegisterHandler(IHandler handler)
      {
          this.handler = handler;
      }
  
  
      public void Creator() // Létrehozza a /bin/debug/booklets.txt-ben található mérési azonosítójú xml-eket
      {
          List&lt;string&gt; booklets = handler.ReadBooklets();
          List&lt;XDocument&gt; outxdocs = new List&lt;XDocument&gt;();
          XDocument foo;
          Student foostudent;
          for (int i = 0; i &lt; booklets.Count; i++)
          {
              foostudent = new Student(booklets[i].Remove(9, 4));
              foo = new XDocument(
                 new XElement("Diákok",
                 new XElement("Id", foostudent.Id),
                 new XElement("Pont", foostudent.Point)));
              outxdocs.Add(foo);
              outxdocs[i].Save(booklets[i]);
          }
      }
  }
  
  public interface IHandler
  {
      List&lt;string&gt; ReadBooklets();
  }
  </code></pre>
  
  <p>This is my Tests project, where I want to setup my <code>handlerMock</code> but I can't. </p>
  
  <pre><code>[TestFixture]
  public class XMLHandlerTests
  {
      [Test]
      public void XML_Should_Created_When_Called_Creator()
      {
          // Arrange
          XMLHandler xmlHandler = new XMLHandler();
          Mock&lt;IHandler&gt; handlerMock = new Mock&lt;IHandler&gt;();
          handlerMock.Setup(x =&gt; x.ReadBooklets()).Returns();
          xmlHandler.RegisterHandler(handlerMock.Object);
          FileInfo firstStudentId = new FileInfo("A111-T143.xml");
          FileInfo lastStudentId = new FileInfo("X973-B320.xml");
  
          // Act
          xmlHandler.Creator();
  
          // Assert
          FileAssert.Exists(firstStudentId, "Az első azonosító nem jött létre!");
          FileAssert.Exists(lastStudentId, "Az utolsó azonosító nem jött létre!");
      }
  }
  </code></pre>