public void Create_Run_SaveRestore_Proceed_Task_Submit_Item_To_Ebay() { try { var dispatcher = Dispatcher.Instance; var store = new DemoshopStoreManager(); store.CreateTask( StoreTaskType.SubmitToEbay ); store.SaveData(); store.LoadData(); dispatcher.RunChannelTasks( store.GetChannelTasks() ); dispatcher.ProceedChannelTasks( store.GetChannelTasks() ); store.SaveData(); store.LoadData(); Assert.AreEqual( 1, store.StoreTasks.Count ); Assert.AreEqual( 3, store.GetChannelTasks().Count() ); store.GetEbaySubmissionTasks().ForEach( t => { Console.WriteLine(); Console.WriteLine( t ); Assert.IsTrue( t.GetStatusCode() == TaskStatus.InProgress || t.GetStatusCode() == TaskStatus.Success, "Success or InProgress" ); Assert.IsNotNull( t.EbaySubmissionResponse.Result.MipSubmissionId ); Assert_That_Text_Contains( t, "ArgsInfo" ); } ); } catch( SpreadbotException exception ) { IgnoreMipQueueDepthErrorMessage( exception.Message ); } }
public void Task_Keeps_Id_After_Reload() { var store = new DemoshopStoreManager(); var id = store.CreateTask( StoreTaskType.SubmitToEbay ).Id; store.SaveData(); store.LoadData(); var task = store.StoreTasks.First(); Assert.AreEqual( id, task.Id, "Task.Id" ); }
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 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 ] ); }