I have the following test of my controller
[Binding] public class RegisterUserSteps { private AccountController _accountController = new AccountController(); private ActionResult _result; [When(@"the user goes to the register user screen")] public void WhenTheUserGoesToTheRegisterUserScreen() { _result = _accountController.Register(); } [Then(@"the register user view should be displayed")] public void ThenTheRegisterUserViewShouldBeDisplayed() { Assert.AreEqual("Register", _accountController.ViewData["Title"]); } }
it works fine, but it doesnβt look very good, because I donβt want to create global / class level variables. So there may be an alternative to these variables in the spec stream. Because when we move on to a large application, and a one-step file contains many scripts, then it will be a mess and it will be difficult to manage.
Thank you in advance
source share