public void Create_WrongFormat_Exception()
        {
            var subject = new DateTimeOffsetBuilder();

            PropertyInfo wrongFormat = this.Property(nameof(WrongFormat));

            Assert.That(() => subject.Create(wrongFormat, null), Throws.InstanceOf <FormatException>());
        }
        public void Create_NotAProperty_NoOp()
        {
            var    subject      = new DateTimeOffsetBuilder();
            object notAProperty = typeof(int);
            var    noOp         = subject.Create(notAProperty, null);

            Assert.That(noOp, Is.InstanceOf <NoSpecimen>());
        }
        public void Create_SortableFormat_Utc()
        {
            var subject = new DateTimeOffsetBuilder();

            PropertyInfo rightFormat = this.Property(nameof(RightFormat));
            var          date        = (DateTimeOffset)subject.Create(rightFormat, null);

            Assert.That(date.Offset, Is.EqualTo(TimeSpan.Zero));
        }
        public void Create_SortableFormat_Date()
        {
            var subject = new DateTimeOffsetBuilder();

            PropertyInfo rightFormat = this.Property(nameof(RightFormat));
            var          date        = subject.Create(rightFormat, null);

            Assert.That(date, Is.InstanceOf(rightFormat.PropertyType));
        }
        public void Create_NotADate_NoOp()
        {
            var subject = new DateTimeOffsetBuilder();

            PropertyInfo notADate = this.Property(nameof(NotADate));
            var          noOp     = subject.Create(notADate, null);

            Assert.That(noOp, Is.InstanceOf <NoSpecimen>());
        }