Ejemplo n.º 1
0
 public void EndVisit_ShouldEndSession([Substitute] ControllerContext ctx, [Frozen] IDemoStateService demoState, [Greedy] DemoController sut)
 {
     demoState.IsDemoEnabled.Returns(true);
     sut.ControllerContext = ctx;
     sut.EndVisit();
     ctx.HttpContext.Session.Received(1).Abandon();
 }
Ejemplo n.º 2
0
        public void EndVisit_ShouldReturnRedirectToRoot(IContactProfileProvider contact, IProfileProvider profile, [Substitute] ControllerContext ctx)
        {
            //arrange
            var controller = new DemoController(contact, profile);

            controller.ControllerContext = ctx;
            controller.EndVisit().As <RedirectResult>().Url.Should().Be("/");
        }
Ejemplo n.º 3
0
        public void EndVisit_ShouldEndSession(IContactProfileProvider contact, IProfileProvider profile, [Substitute] ControllerContext ctx)
        {
            //arrange
            var controller = new DemoController(contact, profile);

            controller.ControllerContext = ctx;
            controller.EndVisit();
            ctx.HttpContext.Session.Received(1).Abandon();
        }
Ejemplo n.º 4
0
 public void EndVisit_ShouldEndSession([Substitute] ControllerContext ctx, [Greedy] DemoController sut)
 {
     sut.ControllerContext = ctx;
     sut.EndVisit();
     ctx.HttpContext.Session.Received(1).Abandon();
 }
Ejemplo n.º 5
0
 public void EndVisit_ShouldReturnRedirectToRoot([Substitute] ControllerContext ctx, [Greedy] DemoController sut)
 {
     sut.ControllerContext = ctx;
     sut.EndVisit().As <HttpStatusCodeResult>().StatusCode.Should().Be((int)HttpStatusCode.OK);
 }
Ejemplo n.º 6
0
 public void EndVisit_ShouldReturnRedirectToRoot([Substitute] ControllerContext ctx, [Frozen] IDemoStateService demoState, [Greedy] DemoController sut)
 {
     demoState.IsDemoEnabled.Returns(true);
     sut.ControllerContext = ctx;
     sut.EndVisit().As <HttpStatusCodeResult>().StatusCode.Should().Be((int)HttpStatusCode.OK);
 }