Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Depends on dose not pick up methods in base class #1248

Closed
jacob7395 opened this issue Nov 19, 2024 · 1 comment · Fixed by #1255
Closed

Depends on dose not pick up methods in base class #1248

jacob7395 opened this issue Nov 19, 2024 · 1 comment · Fixed by #1255

Comments

@jacob7395
Copy link

Hey, might be a general limitation but worth mentioning this issue or maybe There is a way around it.

My classes are setup like;

[ClassConstructor<DependencyInjectionClassConstructor>]
[InheritsTests]
public class SessionAccountantScenarioTests(IMediator mediator,
                                            [SubstituteInstance]
                                            IInMemoryEventHubWrapper eventHub,
                                            [SubstituteInstance]
                                            ITimeProvider timeProvider,
                                            AccountantInterfaceFactory factory,
                                            IAccountantContextTestInterface accountantContextTest,
                                            IAccountantStateInterface stateInterface) :
    AccountantScenarioTests(mediator, eventHub, timeProvider, factory, accountantContextTest, stateInterface)
public abstract class AccountantScenarioTests(IMediator mediator,
                                              IInMemoryEventHubWrapper eventHub,
                                              ITimeProvider timeProvider,
                                              AccountantInterfaceFactory factory,
                                              IAccountantContextTestInterface contextTestInterface,
                                              IAccountantStateInterface stateInterface) : AccountTestBase(timeProvider)

With a test in AccountantScenarioTests

    [Test]
    [DependsOn(nameof(Accountant_WillHaveCorrectBalance_WhenAccountantConstructed))]
    public async Task CompleteTransaction_WillOverChargeIfRequired([Matrix(2)] double initalBalance,
                                                                   [Matrix(0, 1)] double reservation,
                                                                   [Matrix(1, 20)] double charge,
                                                                   [Matrix(MarkupPercent.Zero, MarkupPercent.Forty)]
                                                                   MarkupPercent markupPercent)

My SessionAccountantScenarioTests then want's to depend on this method

    [Test]
    [DependsOn(nameof(AccountantScenarioTests.CompleteTransaction_WillOverChargeIfRequired))]
    public async Task CompleteTransaction_WillChargeUsers_EvenIfTheyLeaveTheCampaign([Matrix(2)] double initialBalance,
                                                                                     [Matrix(0, 1)] double reservation,
                                                                                     [Matrix(1, 20)] double charge,
                                                                                     [Matrix(MarkupPercent.Zero, MarkupPercent.Forty)]
                                                                                     MarkupPercent markupPercent)

I get a TUnit0004: No method found, also thanks for the error really helps ❤️ (not being sarcastic just a useful error)

@thomhurst
Copy link
Owner

Should be resolved in 0.3.34! Thanks for the report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants