Example #1
0
    public void ToCalendarEvent()
    {
        var start = DateTime.Parse("2000-01-13 12:00:00");
        var end   = DateTime.Parse("2000-01-13 13:00:00");

        var item = new Item
        {
            Id        = "id",
            Title     = "title",
            StaffName = "firstName lastName",
            Location  = new[] { "location" },
            Start     = start,
            End       = end,
            AllDay    = false
        };

        var converter = new CalendarConverter();

        var calendarEvent = converter.ConvertToCalendarEvent(item);

        Assert.Equal("id", calendarEvent.Uid);
        Assert.Equal("title (firstName)", calendarEvent.Summary);
        Assert.Equal("location", calendarEvent.Location);
        Assert.Equal(start, calendarEvent.DtStart.Value);
        Assert.Equal("Europe/Copenhagen", calendarEvent.DtStart.TimeZoneName);
        Assert.Equal(end, calendarEvent.DtEnd.Value);
        Assert.Equal("Europe/Copenhagen", calendarEvent.DtEnd.TimeZoneName);
    }