Example #1
0
 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);
 }
Example #3
0
        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();
        }
Example #4
0
 public TreeService(IProblemStorage problemStorage)
 {
     _problemStorage = problemStorage;
 }