Exemplo n.º 1
0
 protected override void Given()
 {
     resource = new PageResource
                    {
                        Title = "Something", 
                        Content = "Description", 
                        TransformedContent = "Transformed description"
                    };
 }
        protected override void Given()
        {
            var page = new PageResource
                           {
                               Title = "Unrelated", 
                               Content = "Content",
                               TransformedContent = "Transformed content"
                           };

            Subject<PageRepository>().Save(page);
        }
        protected override void Given()
        {
            savedPage = new PageResource
                            {
                                Title = "Title", 
                                Content = "Content",
                                TransformedContent = "Transformed content"
                            };

            Subject<PageRepository>().Save(savedPage);
        }
        protected override void Given()
        {
            var oldPageResource = new PageResource
                                      {
                                          Title = "Something", 
                                          Content = "Old Content",
                                          TransformedContent = "Transformed old content"
                                      };

            newPageResource = new PageResource
                                  {
                                      Title = "Something", 
                                      Content = "New Content",
                                      TransformedContent = "Transformed new content"
                                  };

            Subject<PageRepository>().Save(oldPageResource);
        }
Exemplo n.º 5
0
        // this would take a PageResource but there seems to be a binding bug in the version
        // of OpenRasta that I'm using at this point in time
        public OperationResult.SeeOther Post(string title, string content)
        {
            var resource = new PageResource
                               {
                                   Title = title, 
                                   Content = content,
                                   TransformedContent = markdown.Transform(content)
                               };
            

            pageRepository.Save(resource);

            var redirectLocation = uriResolver.CreateUriFor(context.ApplicationBaseUri,
                                                            typeof (PageResource), null,
                                                            resource.ToNameValueCollection());

            return new OperationResult.SeeOther
                       {
                           RedirectLocation = redirectLocation
                       };
        }
 protected override void When()
 {
     resource = Subject<PageRepository>().Get("Something");
 }
 protected override void When()
 {
     retrievedPage = Subject<PageRepository>().Get("Title");
 }
Exemplo n.º 8
0
 protected override void When()
 {
     resource = (PageResource) Subject<PageHandler>().Get("existingPage");
 }