예제 #1
0
            public void ShouldHaveADefaultValue()
            {
                var timeEntry = new MockTimeEntry();

                var calendarItem = CalendarItem.From(timeEntry);

                calendarItem.Color.Should().Be(Colors.NoProject);
            }
예제 #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);
            }
예제 #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));
            }
예제 #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);
            }
예제 #5
0
            public void ShouldInheritFromTimeEntryProjectColor()
            {
                var timeEntry = new MockTimeEntry {
                    Project = new MockProject {
                        Color = "#666666"
                    }
                };

                var calendarItem = CalendarItem.From(timeEntry);

                calendarItem.Color.Should().Be("#666666");
            }
예제 #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));
            }