Esempio n. 1
0
        public async Task GroupsNotNullAfterAssignmentCreationPageNavigatedToTest()
        {
            var _azureService = new MockAzureService();
            var app           = new App(_azureService);
            var viewModel     = new AssignmentCreationPageViewModel(null);

            await _azureService.SyncOfflineCacheAsync();

            viewModel.OnNavigatingTo(null);

            Assert.NotNull(viewModel.Groups);
        }
Esempio n. 2
0
        public async Task AssignmentCreatedInAssignmentCreationPageTest()
        {
            var _azureService = new MockAzureService();
            var app           = new App(_azureService);
            var viewModel     = new AssignmentCreationPageViewModel(null);

            await _azureService.SyncOfflineCacheAsync();

            viewModel.OnNavigatingTo(null);

            viewModel.Assignment.Name = "NewAssignment";
            viewModel.SelectedGroup   = viewModel.Groups.Where(s => s.Name == "Group1").FirstOrDefault();

            viewModel.CreateAssignmentCommand.Execute();

            var assignment = (await(await _azureService.GetTableAsync <Assignment>())
                              .Where(s => s.Name == "NewAssignment"))
                             .FirstOrDefault();

            Assert.NotNull(assignment);
        }