public void WhenAUserSubscribes(string lastName, string firstName, string email) { var formCollection = new FormCollection { { "EMail", email }, { "LastName", lastName}, { "FirstName", firstName}, }; var controller = new SubscriptionController(this.dataStorageMock.Object, this.reportingMock.Object) { ControllerContext = MvcMockHelpers.GetControllerContextMock("POST") }; var actionResult = controller.Create(formCollection); ScenarioContext.Current["Controller"] = controller; ScenarioContext.Current["ActionResult"] = actionResult; }
public void WhenAUserUnSubscribes(string lastName, string firstName, string email) { var controller = new SubscriptionController(this.dataStorageMock.Object, this.reportingMock.Object) { ControllerContext = MvcMockHelpers.GetControllerContextMock("POST") }; var actionResult = controller.Delete(email, new FormCollection()); ScenarioContext.Current["Controller"] = controller; ScenarioContext.Current["ActionResult"] = actionResult; }