Esempio n. 1
0
            public void ShouldHaveADefaultValue()
            {
                var timeEntry = new MockTimeEntry();

                var calendarItem = CalendarItem.From(timeEntry);

                calendarItem.Color.Should().Be(Colors.NoProject);
            }
Esempio n. 2
0
            public void SetsTheAppropriateCalendarIconKind(SyncStatus syncStatus, CalendarIconKind expectedCalendarIcon)
            {
                var timeEntry = new MockTimeEntry {
                    SyncStatus = syncStatus
                };

                var calendarItem = CalendarItem.From(timeEntry);

                calendarItem.IconKind.Should().Be(expectedCalendarIcon);
            }
Esempio n. 3
0
            public void ShouldBeTakenFromTimeEntry(long duration)
            {
                var timeEntry = new MockTimeEntry {
                    Duration = duration
                };

                var calendarItem = CalendarItem.From(timeEntry);

                calendarItem.Duration.Should().Be(TimeSpan.FromSeconds(duration));
            }
Esempio n. 4
0
            public void ShouldUseDefaultValueIfPassedAnInvalidColor()
            {
                var timeEntry = new MockTimeEntry {
                    Project = new MockProject {
                        Color = "#fa"
                    }
                };

                var calendarItem = CalendarItem.From(timeEntry);

                calendarItem.Color.Should().Be(Colors.NoProject);
            }
Esempio n. 5
0
            public void ShouldInheritFromTimeEntryProjectColor()
            {
                var timeEntry = new MockTimeEntry {
                    Project = new MockProject {
                        Color = "#666666"
                    }
                };

                var calendarItem = CalendarItem.From(timeEntry);

                calendarItem.Color.Should().Be("#666666");
            }
Esempio n. 6
0
            public void ShouldReturnTheExpectedForegroundColor(string color, string expectedColor)
            {
                var timeEntry = new MockTimeEntry {
                    Project = new MockProject {
                        Color = color
                    }
                };

                var calendarItem    = CalendarItem.From(timeEntry);
                var foregroundColor = calendarItem.ForegroundColor();

                foregroundColor.Should().BeEquivalentTo(new Color(expectedColor));
            }