1

Closed

Extend attribute assertions with property checks

description

Closed Aug 25, 2012 at 2:19 PM by
All done with the public beta of Fluent Assertions 2.0

comments

wrote May 30, 2012 at 8:44 PM

Associated with changeset 78313.

mopdam wrote Jun 3, 2012 at 7:40 AM

I'm thinking about creating an overload of the BeDecoratedWith method with the following syntax:

controllerType.Should()
.BeDecoratedWith(AnAttribute
    .OfType()
    .WithProperty(a => a.Roles, "Admin")
    .WithProperty(a => a.Order, 2));

Let me know what you think.

wrote Jun 6, 2012 at 7:26 PM

Associated with changeset 78603: Implemented support for property checks in attribute assertions

wrote Jun 7, 2012 at 7:30 PM

Associated with changeset 78642: Changed implementation of BeDecoratedWith, to take a predicate for matching the properties.

wrote Jun 11, 2012 at 6:13 PM

Associated with changeset 78842: Refactoring

wrote Jun 15, 2012 at 8:05 PM

Associated with changeset 79067: Replaced some method overloads with default parameter values

wrote Jun 25, 2012 at 7:11 PM

Associated with changeset 79538: Minor changes to the TypeAssertions.BeDecoratedWith

wrote Jun 25, 2012 at 7:34 PM

I can't find a better syntax than what is currently implemented. And since these Type assertions will always be a bit technical, I think it is alright that you must specify the attribute property assertions by passing in a predicate.