private static void ConfigureMipConnectorToCreateSimpleSubmitToEbayTask(
     Mock< DemoshopStoreManager > mockDemoshopStoreManager)
 {
     var store = mockDemoshopStoreManager.Object;
     mockDemoshopStoreManager
         .Setup(
             mock => mock.CreateTask( It.Is< StoreTaskType >( type => type == StoreTaskType.SubmitToEbay ) ) )
         .Returns(
             () => {
                 var storeTask =
                     new DemoshopStoreTask {
                         StoreId = store.Id,
                         Description = "Fake Task"
                     };
                 storeTask.AddSubTasks(
                     new EbaySubmissionTask {
                         IsCritical = true,
                         MipFeedSubmissionOverallStatus = MipFeedSubmissionOverallStatus.Unknown,
                         ChannelId = EbayAdapter.Instance.Id,
                         ChannelMethod = ChannelMethod.Submit,
                         Args = new EbaySubmissionArgs {
                             MipFeedDescriptor = new MipFeedDescriptor( MipFeedType.None ) {
                                 Content = "Fake Content",
                                 ItemInfo = "Fake Item"
                             }
                         }
                     } );
                 store.AddTask( storeTask );
                 return storeTask;
             }
         );
 }
Ejemplo n.º 2
0
        public static void DemoshopStoreTask_Serialization()
        {
            var storeTask = new DemoshopStoreTask();
            var submissionTask1 = new EbaySubmissionTask();
            var submissionTask2 = new EbaySubmissionTask();
            storeTask.AddSubTasks( submissionTask1, submissionTask2 );
            submissionTask2.AbstractResponse = new ChannelResponse< EbaySubmissionResult >(
                new Exception( "Test Exception" ) );

            var str = storeTask.ToYamlString( SerializationOptions.EmitDefaults );

            Console.WriteLine( str );

            Assert.That( str.Contains( "SubTasks:" ), "Contains SubTasks" );
            Assert.That( str.Contains( "Test Exception" ), "Contains Test Exception" );
        }
        // --------------------------------------------------------[]
        private DemoshopStoreTask CreateEbaySubmissionTask()
        {
            var storeTask =
                new DemoshopStoreTask {
                    StoreId = Id,
                    Description = string.Format( "Submit [{0}] to eBay", Item.Sku )
                };

            storeTask.AddSubTasks(
                _CreateEbaySubmissionSubTask( MipFeedType.Product ),
                _CreateEbaySubmissionSubTask( MipFeedType.Distribution ),
                _CreateEbaySubmissionSubTask( MipFeedType.Availability )
                );

            _AddTask( storeTask );
            return storeTask;
        }
 // --------------------------------------------------------[]
 private void _AddTask( DemoshopStoreTask task )
 {
     _storeTasks.Add( task );
 }
Ejemplo n.º 5
0
 // --------------------------------------------------------[]
 public void AddTask( DemoshopStoreTask storeTask )
 {
     _AddTask( storeTask );
 }