public void Save_and_Restore_Tasks()
        {
            var store = new DemoshopStoreManager();

            store.CreateTask( StoreTaskType.SubmitToEbay );
            store.SaveData();
            store.DeleteAllTasks();
            store.LoadData();

            Assert.AreEqual( 1, store.StoreTasks.Count );
            Assert.AreEqual( 3, store.GetChannelTasks().Count() );

            var feeds =
                store.GetChannelTasks()
                    .OfType< EbaySubmissionTask >()
                    .Select( t => t.Args.MipFeedDescriptor.Type )
                    .OrderBy( f => f.ToString() ).ToArray();

            Assert.AreEqual( 3, feeds.Count() );
            Assert.AreEqual( MipFeedType.Availability, feeds[ 0 ] );
            Assert.AreEqual( MipFeedType.Distribution, feeds[ 1 ] );
            Assert.AreEqual( MipFeedType.Product, feeds[ 2 ] );
        }
        public void Task_Num_Is_The_Same_After_Reload_With_Deleting()
        {
            var store = new DemoshopStoreManager();
            store.CreateTask( StoreTaskType.SubmitToEbay );
            var taskNum = store.GetChannelTasks().Count();

            store.SaveData();
            store.DeleteAllTasks();
            store.LoadData();

            Assert.AreEqual( 1, store.StoreTasks.Count(), "Store Task Num" );
            var task = store.StoreTasks.First();
            Assert.AreEqual( taskNum, task.AbstractSubTasks.Count(), "Sub Tasks num" );
        }
 public void DeleteAllStoreTasks()
 {
     using( var store = new DemoshopStoreManager() ) {
         store.DeleteAllTasks();
     }
 }