Ejemplo n.º 1
0
        public ValidStoryApplicationReceived()
        {
            var storyCreator = new StoryCreator();
            var application  = new StoryApplication("Stick", "Whats brown and sticky? A stick", StoryType.Joke);

            _result = storyCreator.CreateOrEditStory(application);
            _story  = _result.NewStory;
        }
Ejemplo n.º 2
0
 public ActionResult Edit(StoryApplication app)
 {
     if (ModelState.IsValid)
     {
         // Call our StoryCreator service
         var sc = new StoryCreator();
         StoryCreatorResult result = sc.CreateOrEditStory(app);
         if (result.StoryApplication.IsValid())
         {
             return(RedirectToAction("Index"));
         }
     }
     return(View(app));
 }
Ejemplo n.º 3
0
        public EditStoryReceived()
        {
            // Create a story
            _sc = new StoryCreator();
            var app = new StoryApplication("Stick", "Whats brown and sticky? A stick", StoryType.Joke);

            _result = _sc.CreateOrEditStory(app);

            // Edit that story using the id created above
            var _sc2 = new StoryCreator();
            var app2 = new StoryApplication("Stick", "Whats brown and sticky? A stick",
                                            StoryType.Joke, "", "", storyID: _result.NewStory.ID, rating: 5);
            var _result2 = _sc2.CreateOrEditStory(app2);

            _story2 = _result2.NewStory;
        }
Ejemplo n.º 4
0
        public ShortTitle()
        {
            var app = new StoryApplication("asd", "content", StoryType.Joke);

            _result = new StoryCreator().CreateOrEditStory(app);
        }
Ejemplo n.º 5
0
        public ExistingTitle()
        {
            var app1 = new StoryApplication("asdf", "content", StoryType.Joke);

            _result = new StoryCreator().CreateOrEditStory(app1);
        }