Example #1
0
        public void TestAddNegativeHours()
        {
            timestamp = new TimeStamp();

            timestamp.AddHours(-21);
            Assert.Equal(0, timestamp.Seconds);
            Assert.Equal(0, timestamp.Minutes);
            Assert.Equal(0, timestamp.Hours);
        }
Example #2
0
        public void TestAddHours()
        {
            timestamp = new TimeStamp();

            timestamp.AddHours(1);
            Assert.Equal(0, timestamp.Seconds);
            Assert.Equal(0, timestamp.Minutes);
            Assert.Equal(1, timestamp.Hours);

            timestamp.AddHours(22);
            Assert.Equal(0, timestamp.Seconds);
            Assert.Equal(0, timestamp.Minutes);
            Assert.Equal(23, timestamp.Hours);

            timestamp.AddHours(1);
            Assert.Equal(0, timestamp.Seconds);
            Assert.Equal(0, timestamp.Minutes);
            Assert.Equal(0, timestamp.Hours);

            timestamp.AddHours(27);
            Assert.Equal(0, timestamp.Seconds);
            Assert.Equal(0, timestamp.Minutes);
            Assert.Equal(3, timestamp.Hours);
        }