Esempio n. 1
0
        public void ShouldRedirectToAcceptedViewOnSuccessfulApplication()
        {
            var sut = new HomeController();

            var application = new Application
            {
                IsAccepted = true
            };

            sut.WithCallTo(x => x.Index(application)).ShouldRedirectTo(x => x.Accepted);
        }
Esempio n. 2
0
        public void ShouldApplicationRenderWhenIdExists()
        {
            var fakeContext = new Mock<IApplicationRepository>();
            fakeContext.Setup(x => x.Get(1)).Returns(new Application
            {
                Id = 1,
                Name = "A",
                IsAccepted = true
            });

            var sut = new HomeController(fakeContext.Object);
            sut.WithCallTo(x => x.GetApplication(1)).ShouldRenderDefaultView().WithModel<Application>(x => x.Id == 1);
        }
Esempio n. 3
0
        public void ShouldRedirectToOnetOnAbout()
        {
            var sut = new HomeController();

            sut.WithCallTo(x => x.About()).ShouldRedirectTo("http://onet.pl/");
        }
Esempio n. 4
0
        public void ShouldRenderDefaultView()
        {
            var sut = new HomeController();

            sut.WithCallTo(x => x.Index()).ShouldRenderDefaultView();
        }