Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>When I started to look at BDD I investigated all the frameworks out there (for .net) and ended up using none of them. Main reason is I feel like the community hasn't settled on a syntax and best practises yet so instead I continued to use NUnit with a base class based on a <a href="http://flux88.com/blog/the-transition-from-tdd-to-bdd/" rel="noreferrer">blog post</a> by Ben Scheirman. This worked out really well because BDD is not about the tooling but making the tests clean and understandable which is totally possible with normal tools like nunit. </p> <p>Compared to my old unit tests the new style is much more readable and puts a lot more focus on naming and behavior. We're not that far from printing out the method names and have a discussion with the business people about the system.</p> <p>Some additional reading by Scott Bellware: <a href="http://www.code-magazine.com/article.aspx?quickid=0805061&amp;page=1" rel="noreferrer" title="Behavior-Driven Development">Behavior-Driven Development</a></p> <p>Examle of a test:</p> <pre><code>public class WhenAddingLineItemToEmptyOrder : BDDBase { Order order; [SetUp] public void Arrange() { order = new Order(); } public void Act() // called by BDDBase { LintItem item = new LineItem(); item.Quantity = 1; item.Price = 10; order.AddLineItem(item); } [Test] public void TotalPriceShouldBeUpdated() { Assert.AreEqual(10, order.TotalPrice); } [Test] public void OrderCanBeCheckedOut() { Assert.IsTrue(order.CanBeCheckedOut) } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload