title: Autofac mock - How do I setup/fake data from specific methods in dependencies?
body: <p>I'm new to both unit tests, Autofac and mocks so likely, this is relatively easy, but I'm having a hard time figure it out.</p>
  
  <p>I have this class <code>SystemUnderTest</code> with one dependency, and two methods <code>GetValueOne</code> and <code>GetValueTwo</code>.</p>
  
  <pre><code>public class SystemUnderTest : ISystemUnderTest
  {
      private readonly IDependency _dependency;
  
      public SystemUnderTest(IDependency dependency)
      {
          _dependency = dependency;
      }
  
      public string GetValueOne()
      {
          return _dependency.GetValueOne();
      }
  
      public string GetValueTwo()
      {
          return _dependency.GetValueTwo();
      }
  }
  
  public interface ISystemUnderTest
  {
      string GetValueOne();
      string GetValueTwo();
  }
  </code></pre>
  
  <p>These methods gets data from the dependency.</p>
  
  <pre><code>public class Dependency : IDependency
  {
      public string GetValueOne()
      {
          return "get-value-one";
      }
      public string GetValueTwo()
      {
          return "get-value-two";
      }
  }
  
  public interface IDependency
  {
      string GetValueOne();
      string GetValueTwo();
  }
  </code></pre>
  
  <p>I'm trying to fake the data from one of the methods (the "<code>GetValueTwo</code>") so its returning <code>"expected value"</code> instead of <code>"get-value-two"</code> which is what the dependency normally returns.</p>
  
  <pre><code>[Fact]
  public async Task Test_SystemUnderTest()
  {
      using (var mock = AutoMock.GetLoose())
      {
          // Setup
          mock.Mock&lt;IDependency&gt;().Setup(x =&gt; x.GetValueTwo()).Returns("expected value");
  
          // Configure
          mock.Provide&lt;IDependency, Dependency&gt;();
  
          // Arrange - configure the mock
          var sut = mock.Create&lt;SystemUnderTest&gt;();
  
          // Act
          var actual_GetValueOne = sut.GetValueOne();
          var actual_GetValueTwo = sut.GetValueTwo();
  
          // Assert - assert on the mock
          Assert.Equal("get-value-one", actual_GetValueOne);
          Assert.Equal("expected value", actual_GetValueTwo);
      }
  }
  </code></pre>
  
  <p>The first part in my test, the <code>Setup</code> piece, does not seem to have any effect, and its probably because I'm doing some basic stuff wrong.</p>
  
  <p>Anyone with insights on how to save my day?</p>