示例#1
0
        public async Tasks.Task ChangingFilterRefreshesList()
        {
            DataAccessTestable dataAccessTestable = new DataAccessTestable();

            TimeCollectionViewModel viewModel = new TimeCollectionViewModel();

            viewModel.DataAccess = dataAccessTestable;

            // Load
            await viewModel.LoadTimes();

            // Subscribe to update
            bool retrieved = false;

            dataAccessTestable.addRetrieveEntitiesHandler((q, e, b) =>
            {
                retrieved = true;
            });

            // change filter
            await viewModel.IncrementDateFilter();

            // Verify updated
            Assert.IsTrue(retrieved);
        }
示例#2
0
        public async Tasks.Task DefaultDateFromCurrentFilter()
        {
            msdyn_timeentry timeEntry = new msdyn_timeentry();
            // Today - the day of the week (gives sunday) + 7 = Sunday next week.
            DateTime expectedDate = DateTime.Today - TimeSpan.FromDays((int)DateTime.Today.DayOfWeek) + TimeSpan.FromDays(7);

            // Act.
            TimeCollectionViewModel viewModel = new TimeCollectionViewModel();

            viewModel.DataAccess = new DataAccessTestable();
            await viewModel.IncrementDateFilter();

            // Assert.
            viewModel.DefaultDateFromCurrentFilter(timeEntry);
        }