Skip to content

Instantly share code, notes, and snippets.

@huseyint
Created July 26, 2013 09:33
Show Gist options
  • Select an option

  • Save huseyint/6087575 to your computer and use it in GitHub Desktop.

Select an option

Save huseyint/6087575 to your computer and use it in GitHub Desktop.

Revisions

  1. huseyint created this gist Jul 26, 2013.
    8 changes: 8 additions & 0 deletions gistfile1.cs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    // headers is a Dictionary<string, string>
    Assert.AreEqual(1, headers.Count);
    Assert.AreEqual("bar", headers["foo"]);
    // Do I need both of these? Only first? Only second?

    // Only 1st: What if the item is different than what I expected?
    // Only 2nd: If dictionary is empty, this line will throw an exception before assertion is evaluated, is this OK?
    // Both: Isn't this against "one assert per unit test" rule?