public TreePageViewModel(IProblemStorage problemStorage, ITreeService treeService, IContentNavigationService contentNavigationService) { _problemStorage = problemStorage; _treeService = treeService; _contentNavigationService = contentNavigationService; ItemCommand = new Command <Syncfusion.XForms.TreeView.ItemTappedEventArgs>(TreeView_ItemTapped); }
public ProblemPageViewModel(IProblemStorage problemStorage, Utils utils, IContentNavigationService contentNavigationService, IChapter2NameService chapter2NameService) { _problemStorage = problemStorage; _contentNavigationService = contentNavigationService; _utils = utils; _tapCommand = new Command(OnTapped); _doubleTapCommand = new Command(OnDoubleTapped); _chapter2NameService = chapter2NameService; _settingCommand = new Command(OnClickedSetting); }
public async Task OnGetProblemAsyncTest() { var preferenceStorageMock = new Mock <IPreferenceStorage>(); preferenceStorageMock .Setup(p => p.Get(ProblemStorageConstants.VersionKey, -1)) .Returns(ProblemStorageConstants.Version); IProblemStorage problemStorage = Utils.GetMockStorage(); await problemStorage.InitializeAsync(); var prob = await problemStorage.GetProblemAsync(0); Assert.AreEqual("1-3-3", prob.chapter); await problemStorage.CloseAsync(); }
public TreeService(IProblemStorage problemStorage) { _problemStorage = problemStorage; }