コード例 #1
0
        public void Add_201600And101220181400_Returns311220180600()
        {
            var timeCalculator = new TimeCalculator();
            var expected       = new DateTime(2018, 12, 31, 6, 0, 0);
            var actual         = timeCalculator.Add(new TimeSpan(20, 16, 0, 0), new DateTime(2018, 12, 10, 14, 0, 0));

            Assert.Equal(expected, actual);
        }
コード例 #2
0
        public void Add_10122018And4900_Returns121120180100()
        {
            var timeCalculator = new TimeCalculator();
            var expected       = new DateTime(2018, 12, 12, 1, 0, 0);
            var actual         = timeCalculator.Add(new DateTime(2018, 12, 10), new TimeSpan(49, 0, 0));

            Assert.Equal(expected, actual);
        }
コード例 #3
0
        public void Add_2359And10122018_Returns101220182359()
        {
            var timeCalculator = new TimeCalculator();
            var expected       = new DateTime(2018, 10, 12, 23, 59, 0);
            var actual         = timeCalculator.Add(new TimeSpan(23, 59, 0), new DateTime(2018, 10, 12));

            Assert.Equal(expected, actual);
        }