Exemplo n.º 1
0
        public void ToString_Correct()
        {
            //Arrange
            string      input    = "82536";
            string      expected = "82536";
            IntegerTime testObj;

            //Act
            testObj = new IntegerTime(input);

            //Assert
            Assert.AreEqual(expected, testObj.ToString());
        }
Exemplo n.º 2
0
        public void IntegerTimeReadmeTest()
        {
            // Find date components
            IntegerTime fromString = new IntegerTime("010203");

            Assert.AreEqual(1, fromString.Hour);
            Assert.AreEqual(2, fromString.Minute);
            Assert.AreEqual(3, fromString.Second);

            IntegerTime fromInt = new IntegerTime(101112);

            Assert.AreEqual(10, fromInt.Hour);
            Assert.AreEqual(11, fromInt.Minute);
            Assert.AreEqual(12, fromInt.Second);

            // Convert
            Assert.AreEqual(10203, fromString.ToInt);
            Assert.AreEqual("101112", fromInt.ToString());

            Assert.AreEqual(10, fromInt.ToTimeSpan.Hours);
            Assert.AreEqual(11, fromInt.ToTimeSpan.Minutes);
            Assert.AreEqual(12, fromInt.ToTimeSpan.Seconds);
        }