protected IBlogDataService GetDataService()
        {
            BlogDataServiceFactory.RemoveService(dasBlogContent.FullName);
            localhostBlogService = BlogDataServiceFactory.GetService(
                dasBlogContent.FullName,
                loggingService);
            Assert.IsNotNull(localhostBlogService);

            return(localhostBlogService);
        }
Beispiel #2
0
        public void BlogDataService_GetEntriesWithFalse_Successful()
        {
            BlogDataServiceFactory.RemoveService(UnitTestsConstants.TestContentLocation);
            IBlogDataService blogdataservice = BlogDataServiceFactory.GetService(UnitTestsConstants.TestContentLocation,
                                                                                 LoggingDataServiceFactory.GetService(UnitTestsConstants.TestLoggingLocation));
            // gets both public and non-public
            var entries = blogdataservice.GetEntries(false);

            Assert.Equal(23, entries.Count);
        }
Beispiel #3
0
        public static void FixIsPublic(string path)
        {
            ContentPath = path;

            BlogDataServiceFactory.RemoveService(path);
            IBlogDataService dataService = BlogDataServiceFactory.GetService(ContentPath, null);
            EntryCollection  entries     = dataService.GetEntriesForDay(
                DateTime.MaxValue.AddDays(-2),
                TimeZone.CurrentTimeZone,
                String.Empty,
                int.MaxValue,
                int.MaxValue,
                String.Empty);

            foreach (Entry e in entries)
            {
                //if (e.IsPublic == false)
                {
                    try
                    {
                        Entry edit = dataService.GetEntryForEdit(e.EntryId);
                        edit.IsPublic = true;

                        if (edit.Categories == String.Empty)
                        {
                            edit.Categories = "Main";
                        }
                        EntrySaveState saved = dataService.SaveEntry(edit);

                        if (saved == EntrySaveState.Failed)
                        {
                            WriteLine(String.Format("Failed saving {0}", e.Title));
                        }
                        else
                        {
                            WriteLine(String.Format("Saved {0}", e.Title));
                        }
                    }
                    catch (Exception e1)
                    {
                        WriteLine(String.Format("Failed saving {0}, {1}", e.Title, e1.ToString()));
                    }
                }
            }
        }
 public void TearDown()
 {
     BlogDataServiceFactory.RemoveService(dasBlogContent.FullName);
 }