feat: Added an extension method for getting the hour in 12 hour format

This commit is contained in:
Chris Cameron
2019-09-04 12:36:54 -04:00
parent 091ad10068
commit dc1b60e629
3 changed files with 33 additions and 9 deletions

View File

@@ -1,18 +1,29 @@
using NUnit.Framework;
using System;
using ICD.Common.Utils.Extensions;
using NUnit.Framework;
namespace ICD.Common.Utils.Tests.Extensions
{
[TestFixture]
public sealed class DateTimeExtensionsTest
{
[Test]
public static void ToShortTimeStringTest()
{
Assert.Inconclusive();
}
public sealed class DateTimeExtensionsTest
{
[TestCase(1, 1)]
[TestCase(0, 12)]
[TestCase(12, 12)]
[TestCase(23, 11)]
public void Get12Hour(int hour, int expected)
{
Assert.AreEqual(expected, new DateTime(2019, 1, 1, hour, 0, 0).Get12Hour());
}
[Test]
public static void ToLongTimeStringWithMillisecondsTest()
public void ToShortTimeStringTest()
{
Assert.Inconclusive();
}
[Test]
public void ToLongTimeStringWithMillisecondsTest()
{
Assert.Inconclusive();
}