Esempio n. 1
0
            public void EventEntryWithoutLocationReturnsJaevnerEntryWithEmptyLocation()
            {
                var eventEntry = new EventEntry("Title", "Description");
                var eventTime  = new When(DateTime.Now, DateTime.Now.AddHours(1));

                eventEntry.Times.Add(eventTime);

                JaevnerEntry entry = EntryConverter.GetJaevnerEntry(eventEntry);

                entry.Location.Should().BeEmpty();
            }
Esempio n. 2
0
            public void FilledEventEntryReturnsExpectedJaevnerEntry()
            {
                var entry = new JaevnerEntry();

                entry.Title         = "Title";
                entry.Description   = "Description";
                entry.Location      = "Location";
                entry.StartDateTime = DateTime.Now;
                entry.EndDateTime   = DateTime.Now.AddHours(1);

                EventEntry eventEntry = EntryConverter.GetEventEntry(entry);

                eventEntry.Title.Text.Should().Be("Title");
                eventEntry.Content.Content.Should().Be("Description");
                eventEntry.Locations[0].ValueString.Should().Be("Location");
                eventEntry.Times[0].StartTime.Should().BeCloseTo(DateTime.Now, 5000);
                eventEntry.Times[0].EndTime.Should().BeCloseTo(DateTime.Now.AddHours(1), 5000);
            }
Esempio n. 3
0
            public void CanParseSingleLineDataIntoCorrectProperties()
            {
                string data = "\"Meeting\",\"2013-01-02\",\"14:30:00\",\"2013-01-02\",\"16:00:00\",\"True\",\"The Room\",\"Description\",\"4321\"";

                var parser = new CsvParser();

                List <JaevnerEntry> entries = parser.Parse(data);

                entries.Count.Should().Be(1);
                JaevnerEntry entry = entries.First();

                entry.Title.Should().Be("Meeting");
                entry.StartDateTime.Should().Be(new DateTime(2013, 01, 02, 14, 30, 00));
                entry.EndDateTime.Should().Be(new DateTime(2013, 01, 02, 16, 00, 00));
                entry.Location.Should().Be("The Room");
                entry.Description.Should().Be("Description");
                entry.AllDayEvent.Should().BeTrue();
                entry.UniqueId.Should().Be("4321");
            }
Esempio n. 4
0
            public void ConvertingFilledItem()
            {
                var eventEntry = new EventEntry("Title", "Description", "Location");
                var eventTime  = new When(DateTime.Now, DateTime.Now.AddHours(1));
                var extended   = new ExtendedProperty();

                extended.Name  = "UniqueId";
                extended.Value = "4321";
                eventEntry.ExtensionElements.Add(extended);
                eventEntry.Times.Add(eventTime);

                JaevnerEntry entry = EntryConverter.GetJaevnerEntry(eventEntry);

                entry.Title.Should().Be("Title");
                entry.Description.Should().Be("Description");
                entry.Location.Should().Be("Location");
                entry.StartDateTime.Should().BeCloseTo(DateTime.Now, 5000);
                entry.EndDateTime.Should().BeCloseTo(DateTime.Now.AddHours(1), 5000);
                entry.UniqueId.Should().Be("4321");
            }