Example #1
0
        public void Story_Fetch_Info_List()
        {
            StoryTestHelper.StoryAdd();
            StoryTestHelper.StoryAdd();

            var storys = StoryRepository.StoryFetchInfoList(new StoryDataCriteria());

            Assert.IsTrue(storys.Count() > 1, "Row returned should be greater than one");
        }
Example #2
0
        public void Story_Fetch()
        {
            var story = StoryTestHelper.StoryNew();

            story = StoryRepository.StorySave(story);

            story = StoryRepository.StoryFetch(story.StoryId);

            Assert.IsTrue(story != null, "Row returned should not equal null");
        }
Example #3
0
        public void Story_Add()
        {
            var story = StoryTestHelper.StoryNew();

            Assert.IsTrue(story.IsValid, "IsValid should be true");

            story = StoryRepository.StorySave(story);

            Assert.IsTrue(story.StoryId != 0, "StoryId should be a non-zero value");

            StoryRepository.StoryFetch(story.StoryId);
        }
Example #4
0
        public void Story_Edit()
        {
            var story = StoryTestHelper.StoryNew();

            var description = story.Description;

            Assert.IsTrue(story.IsValid, "IsValid should be true");

            story = StoryRepository.StorySave(story);

            story = StoryRepository.StoryFetch(story.StoryId);

            story.Description = DataHelper.RandomString(20);

            story = StoryRepository.StorySave(story);

            story = StoryRepository.StoryFetch(story.StoryId);

            Assert.IsTrue(story.Description != description, "Description should have different value");
        }
Example #5
0
        public void Story_Delete()
        {
            var story = StoryTestHelper.StoryNew();

            Assert.IsTrue(story.IsValid, "IsValid should be true");

            story = StoryRepository.StorySave(story);

            story = StoryRepository.StoryFetch(story.StoryId);

            StoryRepository.StoryDelete(story.StoryId);

            try
            {
                StoryRepository.StoryFetch(story.StoryId);
            }
            catch (Exception ex)
            {
                Assert.IsTrue(ex.GetBaseException() is InvalidOperationException);
            }
        }