Пример #1
0
        public void ConvertSecondsToCurrentDateTimeTest()
        {
            // Arrange
            // All set at initialization

            // Act
            DateTime resultDateTime = _timeConvService.ConvertSecondsToDateTimeObj(_refSeconds);

            // Assert
            Assert.AreEqual(_refDateTime, resultDateTime);
        }
 private void ConvertTime(object obj)
 {
     if (_convertSecondsToHoursAction)
     {
         // Convert entered seconds into DateTime and retunr time into screen
         DateTime resultDateTime = _timeConverterService.ConvertSecondsToDateTimeObj(_secondsToConvert);
         ConvertedHours = resultDateTime.ToString("HH:mm:ss");
     }
     else if (_convertHoursToSecondsAction)
     {
         // Convert time in 24 hrs into seconds and display result in screen
         double resultSecs = _timeConverterService.ConvertString24HrTimeToSeconds(_hoursToConvert.ToString("HH:mm:ss"));
         ConvertedSeconds = $"{resultSecs:#,#0.00}"; // to String
     }
 }