title: How do I write CustomAssertion using FluentAssertions?
body: <p>There is official example how to create CustomAssertion at <a href="https://fluentassertions.com/introduction" rel="nofollow noreferrer">FluentAssertions docs</a>, however my attempt to apply it fails. Here's the code:</p>
  
  <pre><code>public abstract class BaseTest
  {
      public List&lt;int&gt; TestList = new List&lt;int&gt;() { 1, 2, 3 };
  }
  </code></pre>
  
  <hr>
  
  <p><code>public class Test : BaseTest { }</code></p>
  
  <hr>
  
  <pre><code>public class TestAssertions
  {
      private readonly BaseTest test;
  
      public TestAssertions(BaseTest test)
      {
          this.test = test;
      }
  
      [CustomAssertion]
      public void BeWorking(string because = "", params object[] becauseArgs)
      {
          foreach (int num in test.TestList)
          {
              num.Should().BeGreaterThan(0, because, becauseArgs);
          }
      }
  }
  </code></pre>
  
  <hr>
  
  <pre><code>public class CustomTest
  {
      [Fact]
      public void TryMe()
      {
          Test test = new Test();
          test.Should().BeWorking(); // error here
      }
  }
  </code></pre>
  
  <p>I'm getting compile error:</p>
  
  <p><code>CS1061 'ObjectAssertions' does not contain a definition for 'BeWorking' and no accessible extension method 'BeWorking' accepting a first argument of type 'ObjectAssertions' could be found (are you missing a using directive or an assembly reference?)</code></p>
  
  <p>I also tried to move <code>BeWorking</code> from <code>TestAssertions</code> to <code>BaseTest</code> but it still won't work. What am I missing and how do I make it work?</p>