JustBDD.Core 1.0.0-beta-161

This is a prerelease version of JustBDD.Core.
dotnet add package JustBDD.Core --version 1.0.0-beta-161
                    
NuGet\Install-Package JustBDD.Core -Version 1.0.0-beta-161
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="JustBDD.Core" Version="1.0.0-beta-161" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="JustBDD.Core" Version="1.0.0-beta-161" />
                    
Directory.Packages.props
<PackageReference Include="JustBDD.Core" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add JustBDD.Core --version 1.0.0-beta-161
                    
#r "nuget: JustBDD.Core, 1.0.0-beta-161"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package JustBDD.Core@1.0.0-beta-161
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=JustBDD.Core&version=1.0.0-beta-161&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=JustBDD.Core&version=1.0.0-beta-161&prerelease
                    
Install as a Cake Tool

JustBDD

Credits

This library is an enhanced copy of a BDD framework that was originally developed Darren Hall @Darren166. The original design of a BDD syntax that is in the core of JustBDD belongs to him, my implementation just extends it a bit for a more convenient and extendable usage.

Description

This library is intended to solve two main problems:

  • tests readability. In most of the cases, tests written by developers can be read only by developers and only right after they were written. Also, the test case description in most of the cases is just a test method name. This library allows to make test body as readable as possible for everybody and document a test case properly.
  • test steps reusability. When there are too many tests, inevitably there will be a custom solution to group test steps somehow. This lib suggest GWT-style structure as a possible solution.

Comparison to other libraries:

  • Specflow. Specflow is a great BDD library to use for complex specification-first development scenarios. JustBDD is intended to be used when there is no BDD specification available at the beginnging.
  • LightBDD. LightBDD is also a great library, but it does not facilitate the structure of the tests as well does not facilitate code reusability.
  • BDDfy. Almost the same as LightBDD.
  • to be added...

Pros:

  • Simple. Subjectively, it is way easier to write human-readable scenarios compared to Specflow
  • Lightweight. It can be fully forked and redesigned for a specific project if needed. There is not too much code in there.
  • Maintainability. The library forces to have a structure for test step methods.
  • Code reusability. Allows ultimate reusability of tests steps which facilitates TDD.
  • Readability. Test body looks like human readable text, so test can be used for onboarding new people on the project.
  • Flexibility. Yes, it facilitates the structure of the tests, but everything else can be adjusted as needed for specific project and domain language.

Cons:

  • No parallelization. There are some static things that block parallelization support. Solution: there is no solution for now, however - the library use case is high-level API tests, so parallelization there most-likely may cause random tests failures or complex data setup.
  • Awaitable methods look a bit ugly. Solution: no solution here for now, but in the future integration with LightBDD may help to resolve this issue.

Future plans:

  • Provide more samples
  • Provide integration with LightBDD for prettier output
  • Provide more out-of-box helpers, e.g. logging, authentication, etc.

Test example:

See samples folder for an example of usage. The example is not a guidelines, but just one of many possible ways to use the library.

    public class GetAllCategoriesApi_HappyPath_Should : TestFixtureBase
    {
        [Test]
        public void ReturnAllCategories()
        {
            var existingCategory = new CategoryBuilder()
                .WithRandomValues()
                .Build();

            var expectedResponse = new CategoryResponseItemBuilder()
                .FromDomainModel(existingCategory)
                .Build();

            Given.IHave.LoggedInAs.AValidUser().And.DatabaseHas.Category(existingCategory);
            When.ICall.TheCategoriesApi.GetAllEndpoint();
            Then.TheCall.WillSucceed().And.TheCall.WillHaveAResponseEqualTo(new[] { expectedResponse });
        }
    }
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.
  • net7.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on JustBDD.Core:

Package Downloads
JustBDD.NUnit

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0-beta-161 156 3/5/2023
1.0.0-beta-151 147 3/5/2023
1.0.0-beta-141 139 2/12/2023
1.0.0-beta-131 145 2/12/2023
1.0.0-beta-121 155 2/12/2023
1.0.0-beta-111 140 2/12/2023
1.0.0-beta-101 147 2/12/2023
0.0.1-beta-91 169 2/12/2023
0.0.1-alpha9 155 2/7/2023
0.0.1-alpha8 228 2/7/2023
0.0.1-alpha7 155 2/7/2023
0.0.1-alpha6 152 2/7/2023
0.0.1-alpha4 169 1/10/2023
0.0.1-alpha3 161 1/10/2023
0.0.1-alpha2 163 1/10/2023
0.0.1-alpha10 151 2/7/2023
0.0.1-alpha-81 148 2/12/2023
0.0.1-alpha-71 143 2/12/2023
0.0.1-alpha-61 148 2/12/2023
0.0.1-alpha-51 150 2/12/2023
0.0.1-alpha-41 148 2/12/2023
0.0.1-alpha-371 157 2/12/2023
0.0.1-alpha-31 148 2/12/2023
0.0.1-alpha-21 156 2/12/2023
0.0.1-alpha-11 158 2/12/2023