workhorsy / BDD

Behavior Driven Development testing framework for the D programming language
Boost Software License 1.0
3 stars 1 forks source link

Add shouldHaveKey and shouldNotHaveKey functions #12

Open workhorsy opened 3 years ago

workhorsy commented 3 years ago

It would be nice to have a way to assert that associative arrays have a certain key.

unittest {
    string[string] data = [
        "breakfast" : "eggs",
        "lunch" : "tuna sandwitch",
        "dinner" : "pizza",
    ];

    data.shouldHaveKey("lunch");
}