예제 #1
0
        public void FormatTime_ReturnsFormattedTime()
        {
            //  arrange
            float  seconds  = 5.0607f + 4 * 60 + 3 * 60 * 60 + 2 * 24 * 60 * 60;
            string expected = "2:03:04:05.06";

            //  act
            string actual = PMath.FormatTime(seconds);

            //  assert
            Assert.IsTrue(expected.Equals(actual), TestHelper.ShowVariables(expected, actual));
        }
예제 #2
0
        public void GetExecutionTime_ReturnsCurrentExecutionTime()
        {
            //  arrange
            string separator = ">";
            float  time      = UnityEngine.Time.time;
            string expected  = PMath.FormatTime(time) + " " + separator + " ";

            //  act
            string actual = PMath.GetExecutionTime(true, separator);

            //  assert
            Assert.IsTrue(expected.Equals(actual), TestHelper.ShowVariables(expected, actual));
        }