コード例 #1
0
        public MainWindowViewModel(ISummaryService service)
        {
            _service = service;

            SummaryCreation = new SummaryCreationModel {
                PeriodTime = DateTime.Now, PeriodType = PeriodType.FromTypeEnum(PeriodTypeEnum.Day)
            };
            ShowSmallerSummariesCommand = new RelayCommand(ShowSmallerSummaries, () => MainSummaryType.Encompasses?.EncompassesOthers ?? false);
            ShowBiggerSummariesCommand  = new RelayCommand(ShowBiggerSummaries, () => MainSummaryType.IsEncompassedByOthers);
            CreateNewSummaryCommand     = new RelayCommand(CreateNewSummary);

            ShowSummaries(PeriodTypeEnum.Month);
        }
コード例 #2
0
 public static Summary ToDomainModel(this SummaryModel summary)
 {
     return(new Summary
            (
                id: summary.Id,
                period: new SummaryPeriod
                (
                    type: PeriodType.FromTypeEnum((PeriodTypeEnum)summary.PeriodType),
                    dateRange: new DateRange((Date)summary.StartTime, (Date)summary.EndTime)
                ),
                content: summary.Content
            ));
 }
コード例 #3
0
 public void SummarizedBy_MonthlySummary()
 {
     Assert.Empty(_allDays.SummarizedBy(PeriodType.FromTypeEnum(PeriodTypeEnum.Month)));
     Assert.Equal(52, _allWeeks.SummarizedBy(PeriodType.FromTypeEnum(PeriodTypeEnum.Month)).Count());
     Assert.Empty(_allMonths.SummarizedBy(PeriodType.FromTypeEnum(PeriodTypeEnum.Month)));
 }
コード例 #4
0
 public void OfType_MonthlyType()
 {
     Assert.Empty(_allDays.OfSummaryType(PeriodType.FromTypeEnum(PeriodTypeEnum.Month)));
     Assert.Empty(_allWeeks.OfSummaryType(PeriodType.FromTypeEnum(PeriodTypeEnum.Month)));
     Assert.Equal(12, _allMonths.OfSummaryType(PeriodType.FromTypeEnum(PeriodTypeEnum.Month)).Count());
 }
コード例 #5
0
 public void SummarizedBy_DailySummary()
 {
     Assert.Empty(_allDays.SummarizedBy(PeriodType.FromTypeEnum(PeriodTypeEnum.Day)));
     Assert.Empty(_allWeeks.SummarizedBy(PeriodType.FromTypeEnum(PeriodTypeEnum.Day)));
     Assert.Empty(_allMonths.SummarizedBy(PeriodType.FromTypeEnum(PeriodTypeEnum.Day)));
 }