NancyFx/Nancy — pull request #914 by tischlda (2013-01-16 01:02:57+00:00)
Title: New testing assertions for HTML attributes.

Allows the testing for attributes:

response.Body["#someElement"]
.ShouldExistOnce()
.And.ShouldContainAttribute("href", "http://whatev.er");

Which is easier to read than this:

response.Body["#someElement[href='http://whatev.er']"].ShouldExistOnce();

And easier to type than this (using FluentAssertions):

response.Body["#someElement"]
.ShouldExistOnce()
.And.Attributes["href"].Should().Be("http://whatev.er");

It also allows testing for attribute existence and tests on multiple nodes:

response.Body["a"]
.ShouldContainAttribute("href");