* fix validation in new form layout * pin mediatr to last oss version * update dependencies * cleanup code in core * cleanup code in ffmpeg * cleanup code in infra * cleanup code in scanner * cleanup code in application * cleanup main code * cleanup test code * solution-wide code cleanup
38 lines
843 B
C#
38 lines
843 B
C#
using ErsatzTV.Core.Domain;
|
|
using NUnit.Framework;
|
|
using Shouldly;
|
|
|
|
namespace ErsatzTV.Core.Tests.Domain;
|
|
|
|
[TestFixture]
|
|
public class PlayoutItemTests
|
|
{
|
|
[Test]
|
|
public void GetDisplayDuration_ShortDuration()
|
|
{
|
|
var item = new PlayoutItem
|
|
{
|
|
Start = DateTime.UtcNow.Date,
|
|
Finish = DateTime.UtcNow.Date.AddHours(3).AddMinutes(5).AddSeconds(4)
|
|
};
|
|
|
|
string actual = item.GetDisplayDuration();
|
|
|
|
actual.ShouldBe("3:05:04");
|
|
}
|
|
|
|
[Test]
|
|
public void GetDisplayDuration_LongDuration()
|
|
{
|
|
var item = new PlayoutItem
|
|
{
|
|
Start = DateTime.UtcNow.Date,
|
|
Finish = DateTime.UtcNow.Date.AddHours(27).AddMinutes(5).AddSeconds(4)
|
|
};
|
|
|
|
string actual = item.GetDisplayDuration();
|
|
|
|
actual.ShouldBe("27:05:04");
|
|
}
|
|
}
|