Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

Automatically register SpecFlow bindings #25

Merged
merged 4 commits into from
Feb 24, 2020

Conversation

304NotModified
Copy link
Contributor

@304NotModified 304NotModified commented Feb 17, 2020

Fixes #24, fixes #7

@304NotModified
Copy link
Contributor Author

Please squash when accepted :)

@mbhoek
Copy link
Member

mbhoek commented Feb 17, 2020

You move fast! 😄 Let me check this tonight, I think there was a reason for using the return () => and Func<IServiceCollection> constructs having to do with timing so I just want to make sure.

Thanks for your contribution!

@304NotModified
Copy link
Contributor Author

304NotModified commented Feb 17, 2020

it's still doing return () => ;)

But please do check :)

Thanks for the great library!

@mbhoek mbhoek self-requested a review February 17, 2020 16:22
@304NotModified 304NotModified changed the title Search for BindingAttribute inside lib Automatically register SpecFlow bindings Feb 17, 2020
@304NotModified
Copy link
Contributor Author

@mbhoek I've updated the PR so it also resolves #7 :)

Copy link
Member

@mbhoek mbhoek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks ok, but I need to check what happens if users already added the piece of initialisation code (and this change would add those bindings again). This comment is a reminder to @mbhoek to check it.

EDIT: and ofcourse simultaneously @304NotModified updated the PR, so I need to recheck 😃

@304NotModified
Copy link
Contributor Author

luckily I didn't do a force push, so you could check the latest commit :)

@304NotModified
Copy link
Contributor Author

Looks ok, but I need to check what happens if users already added the piece of initialisation code

No crash at my side, but not sure if there goes some else wrong

@304NotModified
Copy link
Contributor Author

To be clear, if you leave this:

            foreach (var type in typeof(TestDependencies).Assembly.GetTypes().Where(t => Attribute.IsDefined(t, typeof(BindingAttribute))))	
            {	
                services.AddSingleton(type);	
            }

Then still all tests are green.

@@ -5,5 +5,9 @@ namespace SolidToken.SpecFlow.DependencyInjection
[AttributeUsage(AttributeTargets.Method)]
public class ScenarioDependenciesAttribute : Attribute
{
/// <summary>
/// Automatically register all SpecFlow bindings
Copy link
Member

@mbhoek mbhoek Feb 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer ending all <summary> comments with .

Copy link
Member

@mbhoek mbhoek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@mbhoek mbhoek merged commit 13804ea into solidtoken:master Feb 24, 2020
mbhoek pushed a commit that referenced this pull request Feb 24, 2020
* Search for BindingAttribute inside lib
* add AutoRegisterBindings

Contributor: @304NotModified
+semver: feature
@304NotModified 304NotModified deleted the fix-BindingAttribute branch February 24, 2020 16:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

System.NullReferenceException inside TechTalk.SpecFlow Automatically register SpecFlow bindings
2 participants