Ejemplo n.º 1
0
        public void Test_AttributeValueModifier_Time()
        {
            var origin = DateTime.SpecifyKind(new DateTime(2000, 1, 1, 1, 1, 1), DateTimeKind.Utc);

            Assert.Equal(0, AttributeValueModifiers.ModifiedTime(DateTime.SpecifyKind(new DateTime(2000, 1, 1, 1, 1, 1), DateTimeKind.Utc), origin));
            Assert.Equal(100, AttributeValueModifiers.ModifiedTime(DateTime.SpecifyKind(new DateTime(2000, 1, 1, 1, 1, 11), DateTimeKind.Utc), origin));
        }
Ejemplo n.º 2
0
        public void Test_AttributeValueModifier_Time_FailWithNegativeOffset()
        {
            var origin = DateTime.SpecifyKind(new DateTime(2000, 2, 1, 1, 1, 1), DateTimeKind.Utc);

            Action act = () => AttributeValueModifiers.ModifiedTime(DateTime.SpecifyKind(new DateTime(2000, 1, 1, 1, 1, 1), DateTimeKind.Utc), origin);

            act.Should().Throw <ArgumentException>().WithMessage("Time argument [*] should not be less that the origin [*]");
        }
Ejemplo n.º 3
0
        public void Test_AttributeValueModifier_Time_FailWithNonUTCDate()
        {
            Action act = () => AttributeValueModifiers.ModifiedTime(DateTime.Now, DateTime.Now);

            act.Should().Throw <ArgumentException>().WithMessage("Time and time origin must be a UTC date time");
        }