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); }
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 )); }
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))); }
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()); }
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))); }