1

I'm implementing the steps of a feature with Specflow and I have a problem with one of the steps.

Here is the Scenario :

Scenario: Cancel a yearly running subscription after legal retractation
        Given I'm logged as "patrickTho"
        And a running "Yearly" subscription
        When I cancel my subscription the "2020-01-15"
        Then I should have access until the end of the subscription
        And received a confirmation for the canceling

I already have implemented all the steps except the last one because I don't know what to put in it...

The notification can be from multiple forms (Email, SMS, Notification...) and for exemple Technically we use our own implementation of IEmailSender from Microsoft.AspNetCore.Identity.UI.Services with SendGrid to send emails.

Technically I was thinking to set the "communication" inside a queue and test if I have something in it... but I believe that I will write extra code only to solve this Steps and not to solve a business problem

Any help was appreciated

OrcusZ
  • 129

1 Answers1

3

If the user of your system can choose what mechanism gets used for sending notifications to them, then I would add an additional notification mechanism "Inform test runner" that is set as the chosen notification mechanism for 'patrickTho'.

That notification mechanism can then use whatever means to inform the test runner that a message was received and what the contents of the message are, without having a dependency on external infrastructure.

Naturally, you would need some other test to verify that each of the notification mechanisms that a normal user would choose also work, but you could choose to run those tests manually when needed.