Esempio n. 1
0
        public void SetUpContext()
        {
            this.Path = new[] { "path1, path2 " };

            var template = new Template(this.Path);
            var config = new Configuration(null, new[] { new IsAuthenticatedCondition() });

            this.UserIdentity = Rhino.Mocks.MockRepository.GenerateMock<IIdentity>();

            this.User = Rhino.Mocks.MockRepository.GenerateMock<ClaimsPrincipal>();
            this.User.Stub(u => u.Identity).Return(this.UserIdentity);

            this.ContentRepository.Stub(r => r.FindContent(this.Path)).Return(new[] { new FindContentResult(template, config) });
        }
Esempio n. 2
0
        public void SetUp()
        {
            // template:
            // - container1
            //   - atom1
            var template = new Template(
                new[] { "test", "path" },
                new[] { new Container("container1", null, new[] { new Atom("atom1") }) });

            var config = new Configuration(cacheControl: "public, max-age=600");

            this.ContentRepository.Stub(
                r => r.FindContent(Arg<IEnumerable<string>>.List.Equal(new[] { "test", "path" })))
                .Return(new[] { new FindContentResult(template, config) });

            this.Response = this.Browser.Get("/test/path", with => with.Header("Accept", "text/html"));
        }