-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extend tests to guard conditional attribute.
- Loading branch information
Showing
4 changed files
with
71 additions
and
1 deletion.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
specs/Qowaiv.Specs/Diagnostics/Contracts/Conditional_specs.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
namespace Diagnostics.Contracts.Conditional_specs; | ||
|
||
public class Is_decorated_with_condtional_CONTRACTS_FULL | ||
{ | ||
[Test] | ||
public void Collection_mutation_attribute() | ||
=> typeof(Qowaiv.Diagnostics.Contracts.CollectionMutationAttribute) | ||
.Should().DecoratedWithConditionalAttribute("CONTRACTS_FULL"); | ||
|
||
[Test] | ||
public void Fluent_syntax_attribute() | ||
=> typeof(Qowaiv.Diagnostics.Contracts.FluentSyntaxAttribute) | ||
.Should().DecoratedWithConditionalAttribute("CONTRACTS_FULL"); | ||
|
||
[Test] | ||
public void Impure_attribute() | ||
=> typeof(Qowaiv.Diagnostics.Contracts.ImpureAttribute) | ||
.Should().DecoratedWithConditionalAttribute("CONTRACTS_FULL"); | ||
|
||
[Test] | ||
public void Inheritable_attribute() | ||
=> typeof(Qowaiv.Diagnostics.Contracts.InheritableAttribute) | ||
.Should().DecoratedWithConditionalAttribute("CONTRACTS_FULL"); | ||
|
||
[Test] | ||
public void Mutable_attribute() | ||
=> typeof(Qowaiv.Diagnostics.Contracts.MutableAttribute) | ||
.Should().DecoratedWithConditionalAttribute("CONTRACTS_FULL"); | ||
} |
2 changes: 1 addition & 1 deletion
2
specs/Qowaiv.Specs/Diagnostics/Contracts/Impure_attribute_specs.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
specs/Qowaiv.Specs/FluentAssertions/System.Type.Assertions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using FluentAssertions.Types; | ||
|
||
namespace FluentAssertions; | ||
|
||
internal static class QowaivSpecsTypeAssertions | ||
{ | ||
public static AndWhichConstraint<TypeAssertions, ConditionalAttribute> DecoratedWithConditionalAttribute( | ||
this TypeAssertions assertions, | ||
string condition, | ||
string because = "", params object[] becauseArgs) | ||
{ | ||
var andWhich = assertions.Subject.Should().BeDecoratedWith<ConditionalAttribute>(); | ||
andWhich.Which.ConditionString.Should().Be(condition, because, becauseArgs); | ||
return andWhich; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters