Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,15 @@ which gives you a report like:
Then the ATM should retain the card
And the atm should say the card has been retained

## IDE annotations

This repository contains a small set of in-repo code-analysis annotations (see `src/TestStack.BDDfy/Properties/Annotations.cs`).

Notably, the attribute classes used for step discovery (for example `ExecutableAttribute` and the GWT attribute variants) are marked with a local `MeansImplicitUse` attribute. That makes methods decorated with `[Executable]` (or `[Given]`, `[When]`, `[Then]`, etc.) be treated as "used implicitly" by IDEs such as ReSharper or Rider. The effect: you won't see "unused" inspections on step methods even though they're invoked via reflection at runtime.

If you prefer to use the official `JetBrains.Annotations` NuGet package instead of the in-repo annotations, you can replace the local attributes and add the package as a development-only dependency (use `PrivateAssets="all"` on the package reference so it doesn't become transitive).


This is only the tip of iceberg. Absolutely everything you do with BDDfy is extensible and customizable.
You might see full documentation of BDDfy on the [TestStack documentation website](http://bddfy.teststack.net/).
Oh and while you are there don't forget to checkout other cool projects from [TestStack](http://www.teststack.net/).
Expand All @@ -120,4 +129,4 @@ Oh and while you are there don't forget to checkout other cool projects from [Te
* [Jake Ginnivan](https://github.com/JakeGinnivan)

## License
BDDfy is released under the MIT License. See the bundled license.txt file for details.
BDDfy is released under the MIT License. See the bundled license.txt file for details.
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
using System;
using TestStack.BDDfy.Annotations;

namespace TestStack.BDDfy
{
/// <summary>
/// This attribute is marked with <see cref="TestStack.BDDfy.Annotations.MeansImplicitUseAttribute"/>
/// so that any method decorated with <c>[Executable]</c> (or derived GWT attributes)
/// is treated as "used implicitly" by code-analysis tools (ReSharper/Rider/etc).
///
/// Reason: step methods are discovered via reflection at runtime, which can trigger
/// "unused" inspections in IDEs; marking the attribute with MeansImplicitUse prevents
/// those false positives and keeps IDE/test explorers tidy without requiring per-method
/// annotations such as <c>[UsedImplicitly]</c>.
/// </summary>
[MeansImplicitUse]
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
public class ExecutableAttribute(ExecutionOrder order, string stepTitle): Attribute
{
Expand Down
Loading