Defining the API

Conventional Testing Styles

Behavior-Driven Development

BDD-style syntax typically…

  • Places an emphasis on using natural language, e.g. describe("Dog").it("can bark!")
  • Provides before and after functions for test setup and cleanup.
  • Uses natural language for “Expectations”, e.g. x.ShouldEqual() or Expect(x).toEqual()
Dog dog;
Describe("Dog", () => {
  Before(() => { dog = new Dog(); });
  It("can bark", () => {
    Expect(dog.Bark()).ToEqual("Woof!");
  });
});