protected override void Given()
        {
            var url = "Home/Index";
            UrlActionContext actualContext = null;

            MockUrlHelper.Setup(h => h.Action(It.IsAny <UrlActionContext>())).Returns(url).Callback <UrlActionContext>(c => actualContext = c).Verifiable("Url.Action was never called");

            _mockReportService.Setup(s => s.GetReport(It.IsAny <string>(), It.IsAny <string>())).Throws(new Exception("get report Error"));
        }
Exemple #2
0
        protected override void Given()
        {
            base.Given();

            MockUrlHelper
            .Setup(
                m =>
                m.Action(
                    It.Is <UrlActionContext>(
                        ctx =>
                        ctx.Action.Equals("Edit", StringComparison.OrdinalIgnoreCase) &&
                        ctx.Controller.Equals("Report", StringComparison.OrdinalIgnoreCase))
                    ))
            .Returns(
                ExpectedUrl);
        }