Example #1
0
        public void have_all_fields_filled()
        {
            var writer = XmlWriter.Create(new MemoryStream());

            var entry = new EntryElement();

            Assert.Throws <AtomSpecificationViolationException>(() => entry.WriteXml(writer));

            entry.SetTitle("test #0");
            Assert.Throws <AtomSpecificationViolationException>(() => entry.WriteXml(writer));

            entry.SetId("guid");
            Assert.Throws <AtomSpecificationViolationException>(() => entry.WriteXml(writer));

            entry.SetUpdated(DateTime.UtcNow);
            Assert.Throws <AtomSpecificationViolationException>(() => entry.WriteXml(writer));

            entry.SetAuthor(AtomSpecs.Author);
            Assert.Throws <AtomSpecificationViolationException>(() => entry.WriteXml(writer));

            entry.SetSummary("Entry #0");

            Assert.DoesNotThrow(() => entry.WriteXml(writer));
            writer.Close();
        }