public FirstViewModel(IMvxQueue queue) { var saveToLocalDatabaseCommand = new SaveToLocalDatabaseCommand { Message = "Test" }; var saveToRemoteServiceCommand = new SaveToRemoteServiceCommand { InsultToSay = "You suck", TimesToKick = 10, TimesToLaugh = 20 }; saveToLocalDatabaseCommand.AddSuccessCommand(saveToRemoteServiceCommand); queue.Push(saveToLocalDatabaseCommand); queue.ProcessQueue(); }
public void Should_process_successful_children() { var factory = new Cirrious.MvvmCross.Plugins.Sqlite.Wpf.MvxWpfSqLiteConnectionFactory(); var connection = factory.Create("queue.db"); connection.CreateTable<QueueEntity>(); var entities = connection.Table<QueueEntity>().ToList(); foreach (var entity in entities) { connection.Delete(entity); } var jsonConverter = new MvxJsonConverter(); IMvxQueue queue = new MvxQueue(factory, jsonConverter); var saveToLocalDatabaseCommand = new SaveToLocalDatabaseCommand { Message = "Test" }; var saveToRemoteServiceCommand = new FakeCommand(); saveToLocalDatabaseCommand.AddSuccessCommand(saveToRemoteServiceCommand); queue.Push(saveToLocalDatabaseCommand); queue.ProcessQueue(); }