Exemplo n.º 1
0
        public void InZone_NullDateTimeInterval_ThrowsException()
        {
            // Arrange
            DateTimeInterval dateTimeInterval = null;
            var timeZone = Fixture.Create <DateTimeZone>();

            // Act
            Action act = () => dateTimeInterval.InZone(timeZone);

            // Assert
            act.Should().Throw <ArgumentNullException>()
            .WithMessage("Value cannot be null.\r\nParameter name: dateTimeInterval");
        }
Exemplo n.º 2
0
        public void InZone_SinglePointDateTimeInterval_SinglePointInterval()
        {
            // Arrange
            var dateTime         = Fixture.Create <LocalDateTime>();
            var dateTimeInterval = new DateTimeInterval(dateTime, dateTime);
            var timeZone         = new FixedOffsetDateTimeZone(Offset.FromHours(3));

            // Act
            var interval = dateTimeInterval.InZone(timeZone);

            // Assert
            interval.Start.Should().Be(interval.End);
            interval.Start.Should().Be(timeZone.AtLeniently(dateTime).ToInstant());
        }