title: Nunit Test naming convention sample
body: <p>Started programming, I am looking at some unit test naming convention: This is a popular one.
  MethodName_StateUnderTest_ExpectedBehavior</p>
  
  <p><a href="https://dzone.com/articles/7-popular-unit-test-naming" rel="nofollow noreferrer">https://dzone.com/articles/7-popular-unit-test-naming</a></p>
  
  <p>If I have a Class ParseVendorSupply,</p>
  
  <p>What would I name the first unit test?
  FromCsv_ParseCorrectly_IsGood</p>
  
  <p>What would I name the second unit test?
  FromCsv_ParseCorrectly_IsIncorrect</p>
  
  <pre><code>//Electronics store 
  public class ParseVendorSupply
  {
      public VendorSupply FromCsv(string csvLine)
      {
          string[] values = csvLine.Split(',');
          VendorSupply vendorsupply = new VendorSupply();
          vendorsupply.VendorId = Convert.ToInt16(values[0]);
          vendorsupply.ProductId = Convert.ToInt16(values[1]);
          vendorsupply.Quantity = Convert.ToInt16(values[2]);
          return vendorsupply;
      }
  }
  
  public class ParseVendorSupplyTest
  {
  
      ParseVendorSupply parseVendorSupplytest = new ParseVendorSupply();
  
      [Test]
      public void FromCsv_ParseCorrectly_IsGood()
      {
          string csvLineTest = "5,8,3";
          VendorSupply vendorsupply = parseVendorSupplytest.FromCsv(csvLineTest);
          Assert.AreEqual(5, vendorsupply.VendorId);
          Assert.AreEqual(8, vendorsupply.ProductId);
          Assert.AreEqual(3, vendorsupply.Quantity);
      }
      [Test]
      public void FromCsv_ParseCorrectly_IsIncorrect()
      {
          string csvLineTest = "5,testdatatype,3,testextrawords";
          VendorSupply vendorsupply = parseVendorSupplytest.FromCsv(csvLineTest);
          Assert.AreEqual(5, vendorsupply.VendorId);
  
      }
  }
  </code></pre>