feat(domain): add core enums (NdiSourceKind, IsoState, AspectMode, AudioMode, TargetFramerate, TargetResolution)
Some checks failed
CI / build-and-test (push) Failing after 23s
Some checks failed
CI / build-and-test (push) Failing after 23s
This commit is contained in:
parent
5ac0a50afe
commit
b07e3e78e0
3 changed files with 93 additions and 0 deletions
51
src/TeamsISO.Engine/Domain/Enums.cs
Normal file
51
src/TeamsISO.Engine/Domain/Enums.cs
Normal file
|
|
@ -0,0 +1,51 @@
|
||||||
|
namespace TeamsISO.Engine.Domain;
|
||||||
|
|
||||||
|
public enum NdiSourceKind
|
||||||
|
{
|
||||||
|
Participant,
|
||||||
|
ActiveSpeaker,
|
||||||
|
Audio,
|
||||||
|
ScreenShare
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum IsoState
|
||||||
|
{
|
||||||
|
Idle,
|
||||||
|
Receiving,
|
||||||
|
Sending,
|
||||||
|
NoSignal,
|
||||||
|
Error
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum AspectMode
|
||||||
|
{
|
||||||
|
Pillarbox,
|
||||||
|
Letterbox,
|
||||||
|
Stretch
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum AudioMode
|
||||||
|
{
|
||||||
|
Auto,
|
||||||
|
Isolated,
|
||||||
|
Mixed
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum TargetFramerate
|
||||||
|
{
|
||||||
|
Fps23_976,
|
||||||
|
Fps24,
|
||||||
|
Fps25,
|
||||||
|
Fps29_97,
|
||||||
|
Fps30,
|
||||||
|
Fps50,
|
||||||
|
Fps59_94,
|
||||||
|
Fps60
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum TargetResolution
|
||||||
|
{
|
||||||
|
R720p,
|
||||||
|
R1080p,
|
||||||
|
R4K
|
||||||
|
}
|
||||||
40
src/tests/TeamsISO.Engine.Tests/Domain/EnumSanityTests.cs
Normal file
40
src/tests/TeamsISO.Engine.Tests/Domain/EnumSanityTests.cs
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
using TeamsISO.Engine.Domain;
|
||||||
|
|
||||||
|
namespace TeamsISO.Engine.Tests.Domain;
|
||||||
|
|
||||||
|
public class EnumSanityTests
|
||||||
|
{
|
||||||
|
[Fact]
|
||||||
|
public void NdiSourceKind_HasExpectedMembers()
|
||||||
|
{
|
||||||
|
var values = Enum.GetValues<NdiSourceKind>();
|
||||||
|
values.Should().Contain(new[]
|
||||||
|
{
|
||||||
|
NdiSourceKind.Participant,
|
||||||
|
NdiSourceKind.ActiveSpeaker,
|
||||||
|
NdiSourceKind.Audio,
|
||||||
|
NdiSourceKind.ScreenShare
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void IsoState_HasExpectedMembers()
|
||||||
|
{
|
||||||
|
var values = Enum.GetValues<IsoState>();
|
||||||
|
values.Should().Contain(new[]
|
||||||
|
{
|
||||||
|
IsoState.Idle,
|
||||||
|
IsoState.Receiving,
|
||||||
|
IsoState.Sending,
|
||||||
|
IsoState.NoSignal,
|
||||||
|
IsoState.Error
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void TargetFramerate_HasAllSupportedRates()
|
||||||
|
{
|
||||||
|
var values = Enum.GetValues<TargetFramerate>();
|
||||||
|
values.Should().HaveCount(8);
|
||||||
|
}
|
||||||
|
}
|
||||||
2
src/tests/TeamsISO.Engine.Tests/GlobalUsings.cs
Normal file
2
src/tests/TeamsISO.Engine.Tests/GlobalUsings.cs
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
global using FluentAssertions;
|
||||||
|
global using Xunit;
|
||||||
Loading…
Reference in a new issue