diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 422f001..998651e 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -32,7 +32,7 @@ jobs: $coverageFiles = Get-ChildItem -Path . -Recurse -Filter coverage.cobertura.xml $coveragePaths = $coverageFiles | ForEach-Object { $_.FullName } $reportsArg = '"' + ($coveragePaths -join ";") + '"' - dotnet tool run reportgenerator -reports:$reportsArg "-targetdir:coverage-report" "-filefilters:-*.g.cs" "-reporttypes:$reportType" + dotnet tool run reportgenerator -reports:$reportsArg "-targetdir:coverage-report" "-filefilters:-*.g.cs" "-reporttypes:Html" - name: Upload Coverage report uses: actions/upload-artifact@v4 diff --git a/AtemSharp.Demo/AtemSharp.Demo.csproj b/AtemSharp.Demo/AtemSharp.Demo.csproj index 71ee97c..707b437 100644 --- a/AtemSharp.Demo/AtemSharp.Demo.csproj +++ b/AtemSharp.Demo/AtemSharp.Demo.csproj @@ -9,6 +9,7 @@ + diff --git a/AtemSharp.Demo/Program.cs b/AtemSharp.Demo/Program.cs index 2d11ff7..5df300e 100644 --- a/AtemSharp.Demo/Program.cs +++ b/AtemSharp.Demo/Program.cs @@ -2,6 +2,7 @@ using System.Diagnostics; using AtemSharp; +using AtemSharp.Json; using Newtonsoft.Json; using Newtonsoft.Json.Converters; @@ -28,7 +29,8 @@ // Serialize state to JSON var stateJson = JsonConvert.SerializeObject(atem, Formatting.Indented, new JsonSerializerSettings - { Converters = [new StringEnumConverter()], TypeNameHandling = TypeNameHandling.Auto }); + { Converters = [new StringEnumConverter()], TypeNameHandling = TypeNameHandling.Auto } + .WithAtemStateSupport()); // Write state to file await File.WriteAllTextAsync("state.json", stateJson); diff --git a/AtemSharp.Json/AtemSharp.Json.csproj b/AtemSharp.Json/AtemSharp.Json.csproj new file mode 100644 index 0000000..ab9d107 --- /dev/null +++ b/AtemSharp.Json/AtemSharp.Json.csproj @@ -0,0 +1,34 @@ + + + + net9.0 + enable + enable + true + + + + AtemSharp.Json + Markus Palcer + Extensions for serializing the AtemSharp state to JSON using Newtonsoft.Json + MIT + MIT + https://github.com/MarkusPalcer/AtemSharp + git + atem;blackmagic;switcher;video;json + true + README.md + + + + + + + + + + + + + + diff --git a/AtemSharp.Json/Converters/ItemCollectionConverter.cs b/AtemSharp.Json/Converters/ItemCollectionConverter.cs new file mode 100644 index 0000000..8db182a --- /dev/null +++ b/AtemSharp.Json/Converters/ItemCollectionConverter.cs @@ -0,0 +1,57 @@ +using System.Numerics; +using System.Reflection; +using AtemSharp.Types; +using Newtonsoft.Json; + +namespace AtemSharp.Json.Converters; + +public class ItemCollectionConverter : JsonConverter +{ + public override void WriteJson(JsonWriter writer, object? value, JsonSerializer serializer) + { + if (value is null) + { + serializer.Serialize(writer, null); + return; + } + + var objectType = value.GetType(); + var keyType = objectType.GetGenericArguments()[0]; + var valueType = objectType.GetGenericArguments()[1]; + + var writeDelegate = typeof(ItemCollectionConverter).GetMethod(nameof(Write), BindingFlags.Static | BindingFlags.NonPublic)! + .MakeGenericMethod(keyType, valueType) + .CreateDelegate(); + + writeDelegate(writer, value, serializer); + } + + delegate void WriteMethod(JsonWriter writer, object? value, JsonSerializer serializer); + + private static void Write(JsonWriter writer, object? value, JsonSerializer serializer) + where TKey : IIncrementOperators, + IComparisonOperators, + IConvertible + { + if (value is not ItemCollection itemCollection) + { + serializer.Serialize(writer, null); + return; + } + + var items = itemCollection.AsReadOnly(); + var dictionary = items.ToDictionary(x => $"{x.Key}", x => (object?)x.Value); + + serializer.Serialize(writer, dictionary); + } + + public override object ReadJson(JsonReader reader, Type objectType, object? existingValue, JsonSerializer serializer) + { + throw new InvalidOperationException("Parsing JSON is not supported."); + } + + public override bool CanConvert(Type objectType) + { + return objectType.IsConstructedGenericType && objectType.GetGenericTypeDefinition() == typeof(ItemCollection<,>); + } +} diff --git a/AtemSharp.Json/Converters/MacroSystemConverter.cs b/AtemSharp.Json/Converters/MacroSystemConverter.cs new file mode 100644 index 0000000..1fad802 --- /dev/null +++ b/AtemSharp.Json/Converters/MacroSystemConverter.cs @@ -0,0 +1,39 @@ +using AtemSharp.State.Macro; +using Newtonsoft.Json; + +namespace AtemSharp.Json.Converters; + +public class MacroSystemConverter : JsonConverter +{ + public override bool CanConvert(Type objectType) => objectType == typeof(MacroSystem); + + public override object ReadJson(JsonReader reader, Type objectType, object? existingValue, JsonSerializer serializer) + { + throw new InvalidOperationException("Parsing JSON is not supported."); + } + + public override void WriteJson(JsonWriter writer, object? value, JsonSerializer serializer) + { + if (value is null) + { + writer.WriteNull(); + } + + if (value is not MacroSystem macroSystem) + { + throw new InvalidOperationException("Tried to serialize a non MacroSystem with MacroSystemConverter"); + } + + var serialized = new Dictionary(); + + foreach (var (key, macro) in macroSystem.AsReadOnly()) + { + serialized[key.ToString()] = macro; + } + + serialized["Player"] = macroSystem.Player; + serialized["Recorder"] = macroSystem.Recorder; + + serializer.Serialize(writer, serialized); + } +} diff --git a/AtemSharp.Json/Extensions.cs b/AtemSharp.Json/Extensions.cs new file mode 100644 index 0000000..57a6607 --- /dev/null +++ b/AtemSharp.Json/Extensions.cs @@ -0,0 +1,19 @@ +using AtemSharp.Json.Converters; +using Newtonsoft.Json; + +namespace AtemSharp.Json; + +public static class Extensions +{ + /// + /// Adds the converters needed to properly convert the ATEM state to JSON to the given + /// + /// + public static JsonSerializerSettings WithAtemStateSupport(this JsonSerializerSettings options) + { + options.Converters.Add(new MacroSystemConverter()); + options.Converters.Add(new ItemCollectionConverter()); + + return options; + } +} diff --git a/AtemSharp.Json/README.md b/AtemSharp.Json/README.md new file mode 100644 index 0000000..fdde017 --- /dev/null +++ b/AtemSharp.Json/README.md @@ -0,0 +1,29 @@ +# AtemSharp.Json + +This library extends [Newtonsoft.Json](https://www.nuget.org/packages/Newtonsoft.Json) for use with +[AtemSharp](https://www.nuget.org/packages/AtemSharp/). + +**Note:** It does not support deserialization + +## Usage: + +### Add package + +Add the package to your project with the following command + +```powershell +dotnet add package AtemSharp.Json +``` + +make sure to use the same version as the one of the `AtemSharp` package. + +### Use package + +Where you create your JsonSerializerSettings, just append the following: + +```C# +var settings = new JsonSerializerSettings { ... }.WithAtemStateSupport(); +``` + +This helper method adds the converters needed to properly serialize the state. + diff --git a/AtemSharp.Tests/AtemSharp.Tests.csproj b/AtemSharp.Tests/AtemSharp.Tests.csproj index a207265..900c124 100644 --- a/AtemSharp.Tests/AtemSharp.Tests.csproj +++ b/AtemSharp.Tests/AtemSharp.Tests.csproj @@ -16,7 +16,7 @@ - + diff --git a/AtemSharp.Tests/Commands/Audio/AudioMixerHeadphonesCommandTests.cs b/AtemSharp.Tests/Commands/Audio/AudioMixerHeadphonesCommandTests.cs index 5590cdb..6450d27 100644 --- a/AtemSharp.Tests/Commands/Audio/AudioMixerHeadphonesCommandTests.cs +++ b/AtemSharp.Tests/Commands/Audio/AudioMixerHeadphonesCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.Audio; [TestFixture] -public class AudioMixerHeadphonesCommandTests : SerializedCommandTestBase { protected override Range[] GetFloatingPointByteRanges() diff --git a/AtemSharp.Tests/Commands/Audio/AudioMixerHeadphonesUpdateCommandTests.cs b/AtemSharp.Tests/Commands/Audio/AudioMixerHeadphonesUpdateCommandTests.cs index d63dff6..7d14974 100644 --- a/AtemSharp.Tests/Commands/Audio/AudioMixerHeadphonesUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/Audio/AudioMixerHeadphonesUpdateCommandTests.cs @@ -5,7 +5,7 @@ namespace AtemSharp.Tests.Commands.Audio; [TestFixture] -internal class AudioMixerHeadphonesUpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/Audio/AudioMixerInputCommandTests.cs b/AtemSharp.Tests/Commands/Audio/AudioMixerInputCommandTests.cs index 16e8c8d..a128eee 100644 --- a/AtemSharp.Tests/Commands/Audio/AudioMixerInputCommandTests.cs +++ b/AtemSharp.Tests/Commands/Audio/AudioMixerInputCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.Audio; [TestFixture] -public class AudioMixerInputCommandTests : SerializedCommandTestBase { protected override Range[] GetFloatingPointByteRanges() diff --git a/AtemSharp.Tests/Commands/Audio/AudioMixerInputUpdateCommandTests.cs b/AtemSharp.Tests/Commands/Audio/AudioMixerInputUpdateCommandTests.cs index bb5b65d..082b005 100644 --- a/AtemSharp.Tests/Commands/Audio/AudioMixerInputUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/Audio/AudioMixerInputUpdateCommandTests.cs @@ -6,7 +6,7 @@ namespace AtemSharp.Tests.Commands.Audio; [TestFixture] -internal class AudioMixerInputUpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/Audio/AudioMixerInputUpdateV8CommandTests.cs b/AtemSharp.Tests/Commands/Audio/AudioMixerInputUpdateV8CommandTests.cs index 050b062..08e6782 100644 --- a/AtemSharp.Tests/Commands/Audio/AudioMixerInputUpdateV8CommandTests.cs +++ b/AtemSharp.Tests/Commands/Audio/AudioMixerInputUpdateV8CommandTests.cs @@ -6,7 +6,7 @@ namespace AtemSharp.Tests.Commands.Audio; [TestFixture] -internal class AudioMixerInputUpdateV8CommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/Audio/AudioMixerMasterCommandTests.cs b/AtemSharp.Tests/Commands/Audio/AudioMixerMasterCommandTests.cs index 6db461a..afb5355 100644 --- a/AtemSharp.Tests/Commands/Audio/AudioMixerMasterCommandTests.cs +++ b/AtemSharp.Tests/Commands/Audio/AudioMixerMasterCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.Audio; [TestFixture] -public class AudioMixerMasterCommandTests : SerializedCommandTestBase { protected override Range[] GetFloatingPointByteRanges() diff --git a/AtemSharp.Tests/Commands/Audio/AudioMixerMasterUpdateCommandTests.cs b/AtemSharp.Tests/Commands/Audio/AudioMixerMasterUpdateCommandTests.cs index 7bff27b..7cb78d2 100644 --- a/AtemSharp.Tests/Commands/Audio/AudioMixerMasterUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/Audio/AudioMixerMasterUpdateCommandTests.cs @@ -5,7 +5,7 @@ namespace AtemSharp.Tests.Commands.Audio; [TestFixture] -internal class AudioMixerMasterUpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/Audio/AudioMixerMonitorCommandTests.cs b/AtemSharp.Tests/Commands/Audio/AudioMixerMonitorCommandTests.cs index 56dc33f..de8b7ee 100644 --- a/AtemSharp.Tests/Commands/Audio/AudioMixerMonitorCommandTests.cs +++ b/AtemSharp.Tests/Commands/Audio/AudioMixerMonitorCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.Audio; [TestFixture] -public class AudioMixerMonitorCommandTests : SerializedCommandTestBase { protected override Range[] GetFloatingPointByteRanges() diff --git a/AtemSharp.Tests/Commands/Audio/AudioMixerMonitorUpdateCommandTests.cs b/AtemSharp.Tests/Commands/Audio/AudioMixerMonitorUpdateCommandTests.cs index 1d8e7c1..080ee9c 100644 --- a/AtemSharp.Tests/Commands/Audio/AudioMixerMonitorUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/Audio/AudioMixerMonitorUpdateCommandTests.cs @@ -5,7 +5,7 @@ namespace AtemSharp.Tests.Commands.Audio; [TestFixture] -internal class AudioMixerMonitorUpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/Audio/AudioMixerPropertiesCommandTests.cs b/AtemSharp.Tests/Commands/Audio/AudioMixerPropertiesCommandTests.cs index d6efb9d..396a24e 100644 --- a/AtemSharp.Tests/Commands/Audio/AudioMixerPropertiesCommandTests.cs +++ b/AtemSharp.Tests/Commands/Audio/AudioMixerPropertiesCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.Audio; [TestFixture] -public class AudioMixerPropertiesCommandTests : SerializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/Audio/AudioMixerPropertiesUpdateCommandTests.cs b/AtemSharp.Tests/Commands/Audio/AudioMixerPropertiesUpdateCommandTests.cs index edf690f..77313d2 100644 --- a/AtemSharp.Tests/Commands/Audio/AudioMixerPropertiesUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/Audio/AudioMixerPropertiesUpdateCommandTests.cs @@ -5,7 +5,7 @@ namespace AtemSharp.Tests.Commands.Audio; [TestFixture] -internal class AudioMixerPropertiesUpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/Audio/AudioMixerResetPeaksCommandTests.cs b/AtemSharp.Tests/Commands/Audio/AudioMixerResetPeaksCommandTests.cs index 70fa08b..b0dede7 100644 --- a/AtemSharp.Tests/Commands/Audio/AudioMixerResetPeaksCommandTests.cs +++ b/AtemSharp.Tests/Commands/Audio/AudioMixerResetPeaksCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.Audio; [TestFixture] -public class AudioMixerResetPeaksCommandTests : SerializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/ColorGenerators/ColorGeneratorCommandTests.cs b/AtemSharp.Tests/Commands/ColorGenerators/ColorGeneratorCommandTests.cs index 067314f..9ed6e35 100644 --- a/AtemSharp.Tests/Commands/ColorGenerators/ColorGeneratorCommandTests.cs +++ b/AtemSharp.Tests/Commands/ColorGenerators/ColorGeneratorCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.ColorGenerators; -public class ColorGeneratorCommandTests : SerializedCommandTestBase +public class ColorGeneratorCommandTests : TypeScriptLibrarySerializedCommandTestBase { protected override Range[] GetFloatingPointByteRanges() => [ diff --git a/AtemSharp.Tests/Commands/ColorGenerators/ColorGeneratorUpdateCommandTests.cs b/AtemSharp.Tests/Commands/ColorGenerators/ColorGeneratorUpdateCommandTests.cs index 33267c0..add2e14 100644 --- a/AtemSharp.Tests/Commands/ColorGenerators/ColorGeneratorUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/ColorGenerators/ColorGeneratorUpdateCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.ColorGenerators; -internal class ColorGeneratorUpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/DataTransfer/DataTransferAckCommandTests.cs b/AtemSharp.Tests/Commands/DataTransfer/DataTransferAckCommandTests.cs index 13ac2b6..e98bb7f 100644 --- a/AtemSharp.Tests/Commands/DataTransfer/DataTransferAckCommandTests.cs +++ b/AtemSharp.Tests/Commands/DataTransfer/DataTransferAckCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.DataTransfer; [TestFixture] -public class DataTransferAckCommandTests : SerializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/DataTransfer/DataTransferCompleteCommandTests.cs b/AtemSharp.Tests/Commands/DataTransfer/DataTransferCompleteCommandTests.cs index b7d497b..139a177 100644 --- a/AtemSharp.Tests/Commands/DataTransfer/DataTransferCompleteCommandTests.cs +++ b/AtemSharp.Tests/Commands/DataTransfer/DataTransferCompleteCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.DataTransfer; [TestFixture] -internal class DataTransferCompleteCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/DataTransfer/DataTransferDataReceivedCommandTests.cs b/AtemSharp.Tests/Commands/DataTransfer/DataTransferDataReceivedCommandTests.cs index 94ca81b..1e4770d 100644 --- a/AtemSharp.Tests/Commands/DataTransfer/DataTransferDataReceivedCommandTests.cs +++ b/AtemSharp.Tests/Commands/DataTransfer/DataTransferDataReceivedCommandTests.cs @@ -7,7 +7,7 @@ namespace AtemSharp.Tests.Commands.DataTransfer; /// Test deserialization functionality of DataTransferDataCommand using data-driven tests /// [TestFixture] -internal class DataTransferDataReceivedCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/DataTransfer/DataTransferDataSendCommandTests.cs b/AtemSharp.Tests/Commands/DataTransfer/DataTransferDataSendCommandTests.cs index 2097c2c..5d32983 100644 --- a/AtemSharp.Tests/Commands/DataTransfer/DataTransferDataSendCommandTests.cs +++ b/AtemSharp.Tests/Commands/DataTransfer/DataTransferDataSendCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.DataTransfer; [TestFixture] -public class DataTransferDataSendCommandTests : SerializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/DataTransfer/DataTransferDownloadRequestCommandTests.cs b/AtemSharp.Tests/Commands/DataTransfer/DataTransferDownloadRequestCommandTests.cs index a5670ca..31a9e60 100644 --- a/AtemSharp.Tests/Commands/DataTransfer/DataTransferDownloadRequestCommandTests.cs +++ b/AtemSharp.Tests/Commands/DataTransfer/DataTransferDownloadRequestCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.DataTransfer; [TestFixture] -public class DataTransferDownloadRequestCommandTests : SerializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/DataTransfer/DataTransferErrorCommandTests.cs b/AtemSharp.Tests/Commands/DataTransfer/DataTransferErrorCommandTests.cs index 435c3fb..71ffa60 100644 --- a/AtemSharp.Tests/Commands/DataTransfer/DataTransferErrorCommandTests.cs +++ b/AtemSharp.Tests/Commands/DataTransfer/DataTransferErrorCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.DataTransfer; [TestFixture] -internal class DataTransferErrorCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/DataTransfer/DataTransferFileDescriptionCommandTests.cs b/AtemSharp.Tests/Commands/DataTransfer/DataTransferFileDescriptionCommandTests.cs index 8090c41..fa4aa42 100644 --- a/AtemSharp.Tests/Commands/DataTransfer/DataTransferFileDescriptionCommandTests.cs +++ b/AtemSharp.Tests/Commands/DataTransfer/DataTransferFileDescriptionCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.DataTransfer; [TestFixture] -public class DataTransferFileDescriptionCommandTests : SerializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/DataTransfer/DataTransferUploadContinueCommandTests.cs b/AtemSharp.Tests/Commands/DataTransfer/DataTransferUploadContinueCommandTests.cs index a7bfe31..bcdda34 100644 --- a/AtemSharp.Tests/Commands/DataTransfer/DataTransferUploadContinueCommandTests.cs +++ b/AtemSharp.Tests/Commands/DataTransfer/DataTransferUploadContinueCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.DataTransfer; [TestFixture] -internal class DataTransferUploadContinueCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/DataTransfer/DataTransferUploadRequestCommandTests.cs b/AtemSharp.Tests/Commands/DataTransfer/DataTransferUploadRequestCommandTests.cs index 8f743a2..e91cf26 100644 --- a/AtemSharp.Tests/Commands/DataTransfer/DataTransferUploadRequestCommandTests.cs +++ b/AtemSharp.Tests/Commands/DataTransfer/DataTransferUploadRequestCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.DataTransfer; [TestFixture] -public class DataTransferUploadRequestCommandTests : SerializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/DataTransfer/LockObtainedCommandTests.cs b/AtemSharp.Tests/Commands/DataTransfer/LockObtainedCommandTests.cs index 66b67e5..f3af329 100644 --- a/AtemSharp.Tests/Commands/DataTransfer/LockObtainedCommandTests.cs +++ b/AtemSharp.Tests/Commands/DataTransfer/LockObtainedCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.DataTransfer; [TestFixture] -internal class LockObtainedCommandTests : DeserializedCommandTestBase +internal class LockObtainedCommandTests : TypeScriptLibraryDeserializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/DataTransfer/LockStateCommandTests.cs b/AtemSharp.Tests/Commands/DataTransfer/LockStateCommandTests.cs index b63b497..110b58e 100644 --- a/AtemSharp.Tests/Commands/DataTransfer/LockStateCommandTests.cs +++ b/AtemSharp.Tests/Commands/DataTransfer/LockStateCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.DataTransfer; [TestFixture] -public class LockStateCommandTests : SerializedCommandTestBase +public class LockStateCommandTests : TypeScriptLibrarySerializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/DataTransfer/LockStateUpdateCommandTests.cs b/AtemSharp.Tests/Commands/DataTransfer/LockStateUpdateCommandTests.cs index 9b5ea51..5802068 100644 --- a/AtemSharp.Tests/Commands/DataTransfer/LockStateUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/DataTransfer/LockStateUpdateCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.DataTransfer; [TestFixture] -internal class LockStateUpdateCommandTests : DeserializedCommandTestBase +internal class LockStateUpdateCommandTests : TypeScriptLibraryDeserializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/DeviceProfile/AudioMixerConfigCommandTests.cs b/AtemSharp.Tests/Commands/DeviceProfile/AudioMixerConfigCommandTests.cs index a93454d..f308371 100644 --- a/AtemSharp.Tests/Commands/DeviceProfile/AudioMixerConfigCommandTests.cs +++ b/AtemSharp.Tests/Commands/DeviceProfile/AudioMixerConfigCommandTests.cs @@ -6,7 +6,7 @@ namespace AtemSharp.Tests.Commands.DeviceProfile; [TestFixture] -internal class AudioMixerConfigCommandTests : DeserializedCommandTestBase +internal class AudioMixerConfigCommandTests : TypeScriptLibraryDeserializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/DeviceProfile/FairlightAudioMixerConfigCommandTests.cs b/AtemSharp.Tests/Commands/DeviceProfile/FairlightAudioMixerConfigCommandTests.cs index 195973d..1728ef0 100644 --- a/AtemSharp.Tests/Commands/DeviceProfile/FairlightAudioMixerConfigCommandTests.cs +++ b/AtemSharp.Tests/Commands/DeviceProfile/FairlightAudioMixerConfigCommandTests.cs @@ -6,7 +6,7 @@ namespace AtemSharp.Tests.Commands.DeviceProfile; [TestFixture] -internal class FairlightAudioMixerConfigCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/DeviceProfile/MacroPoolConfigCommandTests.cs b/AtemSharp.Tests/Commands/DeviceProfile/MacroPoolConfigCommandTests.cs index 73e0f2c..7a40aed 100644 --- a/AtemSharp.Tests/Commands/DeviceProfile/MacroPoolConfigCommandTests.cs +++ b/AtemSharp.Tests/Commands/DeviceProfile/MacroPoolConfigCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.DeviceProfile; [TestFixture] -internal class MacroPoolConfigCommandTests : DeserializedCommandTestBase +internal class MacroPoolConfigCommandTests : TypeScriptLibraryDeserializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/DeviceProfile/MediaPoolConfigCommandTests.cs b/AtemSharp.Tests/Commands/DeviceProfile/MediaPoolConfigCommandTests.cs index c8736af..6d71fc7 100644 --- a/AtemSharp.Tests/Commands/DeviceProfile/MediaPoolConfigCommandTests.cs +++ b/AtemSharp.Tests/Commands/DeviceProfile/MediaPoolConfigCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.DeviceProfile; [TestFixture] -internal class MediaPoolConfigCommandTests : DeserializedCommandTestBase +internal class MediaPoolConfigCommandTests : TypeScriptLibraryDeserializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/DeviceProfile/MixEffectBlockConfigCommandTests.cs b/AtemSharp.Tests/Commands/DeviceProfile/MixEffectBlockConfigCommandTests.cs index 95e723f..959709c 100644 --- a/AtemSharp.Tests/Commands/DeviceProfile/MixEffectBlockConfigCommandTests.cs +++ b/AtemSharp.Tests/Commands/DeviceProfile/MixEffectBlockConfigCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.DeviceProfile; [TestFixture] -internal class MixEffectBlockConfigCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/DeviceProfile/MultiviewerConfigCommandTests.cs b/AtemSharp.Tests/Commands/DeviceProfile/MultiviewerConfigCommandTests.cs index 8fa55ef..9106356 100644 --- a/AtemSharp.Tests/Commands/DeviceProfile/MultiviewerConfigCommandTests.cs +++ b/AtemSharp.Tests/Commands/DeviceProfile/MultiviewerConfigCommandTests.cs @@ -5,7 +5,7 @@ namespace AtemSharp.Tests.Commands.DeviceProfile; -internal class MultiviewerConfigCommandTests : DeserializedCommandTestBase { [MaxProtocolVersion(ProtocolVersion.V8_0_1)] diff --git a/AtemSharp.Tests/Commands/DeviceProfile/MultiviewerConfigCommandV811Tests.cs b/AtemSharp.Tests/Commands/DeviceProfile/MultiviewerConfigCommandV811Tests.cs index 6e0a863..c7ef064 100644 --- a/AtemSharp.Tests/Commands/DeviceProfile/MultiviewerConfigCommandV811Tests.cs +++ b/AtemSharp.Tests/Commands/DeviceProfile/MultiviewerConfigCommandV811Tests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.DeviceProfile; -internal class MultiviewerConfigCommandV811Tests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/DeviceProfile/ProductIdentifierCommandTests.cs b/AtemSharp.Tests/Commands/DeviceProfile/ProductIdentifierCommandTests.cs index 935e025..8ee09ed 100644 --- a/AtemSharp.Tests/Commands/DeviceProfile/ProductIdentifierCommandTests.cs +++ b/AtemSharp.Tests/Commands/DeviceProfile/ProductIdentifierCommandTests.cs @@ -5,7 +5,7 @@ namespace AtemSharp.Tests.Commands.DeviceProfile; [TestFixture] -internal class ProductIdentifierCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/DeviceProfile/SuperSourceConfigCommandTests.cs b/AtemSharp.Tests/Commands/DeviceProfile/SuperSourceConfigCommandTests.cs index faf7198..c718f61 100644 --- a/AtemSharp.Tests/Commands/DeviceProfile/SuperSourceConfigCommandTests.cs +++ b/AtemSharp.Tests/Commands/DeviceProfile/SuperSourceConfigCommandTests.cs @@ -6,7 +6,7 @@ namespace AtemSharp.Tests.Commands.DeviceProfile; [TestFixture] -internal class SuperSourceConfigCommandTests : DeserializedCommandTestBase { [MaxProtocolVersion(ProtocolVersion.V7_5_2)] diff --git a/AtemSharp.Tests/Commands/DeviceProfile/SuperSourceConfigCommandV8Tests.cs b/AtemSharp.Tests/Commands/DeviceProfile/SuperSourceConfigCommandV8Tests.cs index a212a38..1e5595e 100644 --- a/AtemSharp.Tests/Commands/DeviceProfile/SuperSourceConfigCommandV8Tests.cs +++ b/AtemSharp.Tests/Commands/DeviceProfile/SuperSourceConfigCommandV8Tests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.DeviceProfile; [TestFixture] -internal class SuperSourceConfigCommandV8Tests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/DeviceProfile/TopologyCommandTests.cs b/AtemSharp.Tests/Commands/DeviceProfile/TopologyCommandTests.cs index 3414142..bff4f54 100644 --- a/AtemSharp.Tests/Commands/DeviceProfile/TopologyCommandTests.cs +++ b/AtemSharp.Tests/Commands/DeviceProfile/TopologyCommandTests.cs @@ -5,7 +5,7 @@ namespace AtemSharp.Tests.Commands.DeviceProfile; -internal class TopologyCommandTests : DeserializedCommandTestBase +internal class TopologyCommandTests : TypeScriptLibraryDeserializedCommandTestBase { [MaxProtocolVersion(ProtocolVersion.V7_5_2)] public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/DeviceProfile/TopologyCommandV811Tests.cs b/AtemSharp.Tests/Commands/DeviceProfile/TopologyCommandV811Tests.cs index ae3569b..3a8a07f 100644 --- a/AtemSharp.Tests/Commands/DeviceProfile/TopologyCommandV811Tests.cs +++ b/AtemSharp.Tests/Commands/DeviceProfile/TopologyCommandV811Tests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.DeviceProfile; -internal class TopologyCommandV811Tests : DeserializedCommandTestBase +internal class TopologyCommandV811Tests : TypeScriptLibraryDeserializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/DeviceProfile/TopologyCommandV8Tests.cs b/AtemSharp.Tests/Commands/DeviceProfile/TopologyCommandV8Tests.cs index 2e52856..3e4d608 100644 --- a/AtemSharp.Tests/Commands/DeviceProfile/TopologyCommandV8Tests.cs +++ b/AtemSharp.Tests/Commands/DeviceProfile/TopologyCommandV8Tests.cs @@ -5,7 +5,7 @@ namespace AtemSharp.Tests.Commands.DeviceProfile; -internal class TopologyCommandV8Tests : DeserializedCommandTestBase +internal class TopologyCommandV8Tests : TypeScriptLibraryDeserializedCommandTestBase { [MaxProtocolVersion(ProtocolVersion.V8_0_1)] public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/DeviceProfile/VersionCommandTests.cs b/AtemSharp.Tests/Commands/DeviceProfile/VersionCommandTests.cs index e294ce1..7aa0970 100644 --- a/AtemSharp.Tests/Commands/DeviceProfile/VersionCommandTests.cs +++ b/AtemSharp.Tests/Commands/DeviceProfile/VersionCommandTests.cs @@ -5,7 +5,7 @@ namespace AtemSharp.Tests.Commands.DeviceProfile; [TestFixture] -internal class VersionCommandTests : DeserializedCommandTestBase +internal class VersionCommandTests : TypeScriptLibraryDeserializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/DisplayClock/DisplayClockCurrentTimeCommandTests.cs b/AtemSharp.Tests/Commands/DisplayClock/DisplayClockCurrentTimeCommandTests.cs index c159237..fe353f6 100644 --- a/AtemSharp.Tests/Commands/DisplayClock/DisplayClockCurrentTimeCommandTests.cs +++ b/AtemSharp.Tests/Commands/DisplayClock/DisplayClockCurrentTimeCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.DisplayClock; [TestFixture] -internal class DisplayClockCurrentTimeCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/DisplayClock/DisplayClockPropertiesGetCommandTests.cs b/AtemSharp.Tests/Commands/DisplayClock/DisplayClockPropertiesGetCommandTests.cs index c809a5f..c12c72c 100644 --- a/AtemSharp.Tests/Commands/DisplayClock/DisplayClockPropertiesGetCommandTests.cs +++ b/AtemSharp.Tests/Commands/DisplayClock/DisplayClockPropertiesGetCommandTests.cs @@ -6,7 +6,7 @@ namespace AtemSharp.Tests.Commands.DisplayClock; [TestFixture] -internal class DisplayClockPropertiesGetCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/DisplayClock/DisplayClockPropertiesSetCommandTests.cs b/AtemSharp.Tests/Commands/DisplayClock/DisplayClockPropertiesSetCommandTests.cs index 2f715c9..828db31 100644 --- a/AtemSharp.Tests/Commands/DisplayClock/DisplayClockPropertiesSetCommandTests.cs +++ b/AtemSharp.Tests/Commands/DisplayClock/DisplayClockPropertiesSetCommandTests.cs @@ -5,7 +5,7 @@ namespace AtemSharp.Tests.Commands.DisplayClock; [TestFixture] -public class DisplayClockPropertiesSetCommandTests : SerializedCommandTestBase { protected override Range[] GetFloatingPointByteRanges() diff --git a/AtemSharp.Tests/Commands/DisplayClock/DisplayClockRequestTimeCommandTests.cs b/AtemSharp.Tests/Commands/DisplayClock/DisplayClockRequestTimeCommandTests.cs index c038199..8a6a922 100644 --- a/AtemSharp.Tests/Commands/DisplayClock/DisplayClockRequestTimeCommandTests.cs +++ b/AtemSharp.Tests/Commands/DisplayClock/DisplayClockRequestTimeCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.DisplayClock; [TestFixture] -public class DisplayClockRequestTimeCommandTests : SerializedCommandTestBase { public class CommandData : CommandDataBase; diff --git a/AtemSharp.Tests/Commands/DisplayClock/DisplayClockStateSetCommandTests.cs b/AtemSharp.Tests/Commands/DisplayClock/DisplayClockStateSetCommandTests.cs index 7b16943..911b27e 100644 --- a/AtemSharp.Tests/Commands/DisplayClock/DisplayClockStateSetCommandTests.cs +++ b/AtemSharp.Tests/Commands/DisplayClock/DisplayClockStateSetCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.DisplayClock; [TestFixture] -public class DisplayClockStateSetCommandTests : SerializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeyAutoCommandTests.cs b/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeyAutoCommandTests.cs index 65dc88b..0bad3e0 100644 --- a/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeyAutoCommandTests.cs +++ b/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeyAutoCommandTests.cs @@ -6,7 +6,7 @@ namespace AtemSharp.Tests.Commands.DownstreamKey; [TestFixture] -public class DownstreamKeyAutoCommandTests : SerializedCommandTestBase { [MaxProtocolVersion(ProtocolVersion.V8_0)] diff --git a/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeyAutoCommandV801Tests.cs b/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeyAutoCommandV801Tests.cs index 2df2eaa..8ba2ba0 100644 --- a/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeyAutoCommandV801Tests.cs +++ b/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeyAutoCommandV801Tests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.DownstreamKey; [TestFixture] -public class DownstreamKeyAutoCommandV801Tests : SerializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeyCutSourceCommandTests.cs b/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeyCutSourceCommandTests.cs index 16d3a78..f7e5bc8 100644 --- a/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeyCutSourceCommandTests.cs +++ b/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeyCutSourceCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.DownstreamKey; [TestFixture] -public class DownstreamKeyCutSourceCommandTests : SerializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeyFillSourceCommandTests.cs b/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeyFillSourceCommandTests.cs index f80d65c..f4f542a 100644 --- a/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeyFillSourceCommandTests.cs +++ b/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeyFillSourceCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.DownstreamKey; [TestFixture] -public class DownstreamKeyFillSourceCommandTests : SerializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeyGeneralCommandTests.cs b/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeyGeneralCommandTests.cs index 77ac708..a362f30 100644 --- a/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeyGeneralCommandTests.cs +++ b/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeyGeneralCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.DownstreamKey; [TestFixture] -public class DownstreamKeyGeneralCommandTests : SerializedCommandTestBase { protected override Range[] GetFloatingPointByteRanges() => [ diff --git a/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeyMaskCommandTests.cs b/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeyMaskCommandTests.cs index 799c3a9..2821af4 100644 --- a/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeyMaskCommandTests.cs +++ b/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeyMaskCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.DownstreamKey; [TestFixture] -public class DownstreamKeyMaskCommandTests : SerializedCommandTestBase { protected override Range[] GetFloatingPointByteRanges() => diff --git a/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeyOnAirCommandTests.cs b/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeyOnAirCommandTests.cs index 31c9c4f..ec929aa 100644 --- a/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeyOnAirCommandTests.cs +++ b/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeyOnAirCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.DownstreamKey; [TestFixture] -public class DownstreamKeyOnAirCommandTests : SerializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeyPropertiesUpdateCommandTests.cs b/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeyPropertiesUpdateCommandTests.cs index 49ff1f7..2b04bf2 100644 --- a/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeyPropertiesUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeyPropertiesUpdateCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.DownstreamKey; [TestFixture] -internal class DownstreamKeyPropertiesUpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeyRateCommandTests.cs b/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeyRateCommandTests.cs index f9f1b52..157756a 100644 --- a/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeyRateCommandTests.cs +++ b/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeyRateCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.DownstreamKey; -public class DownstreamKeyRateCommandTests : SerializedCommandTestBase +public class DownstreamKeyRateCommandTests : TypeScriptLibrarySerializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeySourcesUpdateCommandTests.cs b/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeySourcesUpdateCommandTests.cs index dd6e71d..be4c399 100644 --- a/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeySourcesUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeySourcesUpdateCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.DownstreamKey; -internal class DownstreamKeySourcesUpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeyStateUpdateCommandTests.cs b/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeyStateUpdateCommandTests.cs index dcdf59a..5c41b0f 100644 --- a/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeyStateUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeyStateUpdateCommandTests.cs @@ -5,7 +5,7 @@ namespace AtemSharp.Tests.Commands.DownstreamKey; -internal class DownstreamKeyStateUpdateCommandTests : DeserializedCommandTestBase { [MaxProtocolVersion(ProtocolVersion.V8_0)] diff --git a/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeyStateV8UpdateCommandTests.cs b/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeyStateV8UpdateCommandTests.cs index b54cf20..bc586a5 100644 --- a/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeyStateV8UpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeyStateV8UpdateCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.DownstreamKey; -internal class DownstreamKeyStateV8UpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeyTieCommandTests.cs b/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeyTieCommandTests.cs index 4b6e7af..b8a3757 100644 --- a/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeyTieCommandTests.cs +++ b/AtemSharp.Tests/Commands/DownstreamKey/DownstreamKeyTieCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.DownstreamKey; [TestFixture] -public class DownstreamKeyTieCommandTests : SerializedCommandTestBase +public class DownstreamKeyTieCommandTests : TypeScriptLibrarySerializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/Fairlight/AudioRouting/AudioRoutingOutputCommandTests.cs b/AtemSharp.Tests/Commands/Fairlight/AudioRouting/AudioRoutingOutputCommandTests.cs index c8f42b4..f797f4d 100644 --- a/AtemSharp.Tests/Commands/Fairlight/AudioRouting/AudioRoutingOutputCommandTests.cs +++ b/AtemSharp.Tests/Commands/Fairlight/AudioRouting/AudioRoutingOutputCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.Fairlight.AudioRouting; -public class AudioRoutingOutputCommandTests : SerializedCommandTestBase +public class AudioRoutingOutputCommandTests : TypeScriptLibrarySerializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/Fairlight/AudioRouting/AudioRoutingOutputUpdateCommandTests.cs b/AtemSharp.Tests/Commands/Fairlight/AudioRouting/AudioRoutingOutputUpdateCommandTests.cs index 2ba55e4..4b3e251 100644 --- a/AtemSharp.Tests/Commands/Fairlight/AudioRouting/AudioRoutingOutputUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/Fairlight/AudioRouting/AudioRoutingOutputUpdateCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.Fairlight.AudioRouting; -internal class AudioRoutingOutputUpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/Fairlight/AudioRouting/AudioRoutingSourceCommandTests.cs b/AtemSharp.Tests/Commands/Fairlight/AudioRouting/AudioRoutingSourceCommandTests.cs index f0d5316..afef989 100644 --- a/AtemSharp.Tests/Commands/Fairlight/AudioRouting/AudioRoutingSourceCommandTests.cs +++ b/AtemSharp.Tests/Commands/Fairlight/AudioRouting/AudioRoutingSourceCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.Fairlight.AudioRouting; -public class AudioRoutingSourceCommandTests : SerializedCommandTestBase +public class AudioRoutingSourceCommandTests : TypeScriptLibrarySerializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/Fairlight/AudioRouting/AudioRoutingSourceUpdateCommandTests.cs b/AtemSharp.Tests/Commands/Fairlight/AudioRouting/AudioRoutingSourceUpdateCommandTests.cs index 04e824f..187352e 100644 --- a/AtemSharp.Tests/Commands/Fairlight/AudioRouting/AudioRoutingSourceUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/Fairlight/AudioRouting/AudioRoutingSourceUpdateCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.Fairlight.AudioRouting; -internal class AudioRoutingSourceUpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/Fairlight/FairlightMixerInputCommandTests.cs b/AtemSharp.Tests/Commands/Fairlight/FairlightMixerInputCommandTests.cs index 63785f5..00706ec 100644 --- a/AtemSharp.Tests/Commands/Fairlight/FairlightMixerInputCommandTests.cs +++ b/AtemSharp.Tests/Commands/Fairlight/FairlightMixerInputCommandTests.cs @@ -5,7 +5,7 @@ namespace AtemSharp.Tests.Commands.Fairlight; -public class FairlightMixerInputCommandTests : SerializedCommandTestBase { [MaxProtocolVersion(ProtocolVersion.V8_0_1)] diff --git a/AtemSharp.Tests/Commands/Fairlight/FairlightMixerInputUpdateCommandTests.cs b/AtemSharp.Tests/Commands/Fairlight/FairlightMixerInputUpdateCommandTests.cs index b1ab4f5..db11c0e 100644 --- a/AtemSharp.Tests/Commands/Fairlight/FairlightMixerInputUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/Fairlight/FairlightMixerInputUpdateCommandTests.cs @@ -7,7 +7,7 @@ namespace AtemSharp.Tests.Commands.Fairlight; -internal class FairlightMixerInputUpdateCommandTests : DeserializedCommandTestBase { [MaxProtocolVersion(ProtocolVersion.V8_0_1)] diff --git a/AtemSharp.Tests/Commands/Fairlight/FairlightMixerInputUpdateV811CommandTests.cs b/AtemSharp.Tests/Commands/Fairlight/FairlightMixerInputUpdateV811CommandTests.cs index d111429..c61e501 100644 --- a/AtemSharp.Tests/Commands/Fairlight/FairlightMixerInputUpdateV811CommandTests.cs +++ b/AtemSharp.Tests/Commands/Fairlight/FairlightMixerInputUpdateV811CommandTests.cs @@ -5,7 +5,7 @@ namespace AtemSharp.Tests.Commands.Fairlight; -internal class FairlightMixerInputUpdateV811CommandTests : DeserializedCommandTestBase +internal class FairlightMixerInputUpdateV811CommandTests : TypeScriptLibraryDeserializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/Fairlight/FairlightMixerInputV811CommandTests.cs b/AtemSharp.Tests/Commands/Fairlight/FairlightMixerInputV811CommandTests.cs index 8f81946..2a1aa03 100644 --- a/AtemSharp.Tests/Commands/Fairlight/FairlightMixerInputV811CommandTests.cs +++ b/AtemSharp.Tests/Commands/Fairlight/FairlightMixerInputV811CommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.Fairlight; -public class FairlightMixerInputV811CommandTests : SerializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/Fairlight/FairlightMixerResetPeakLevelsCommandTests.cs b/AtemSharp.Tests/Commands/Fairlight/FairlightMixerResetPeakLevelsCommandTests.cs index 200f39c..ab8b2fc 100644 --- a/AtemSharp.Tests/Commands/Fairlight/FairlightMixerResetPeakLevelsCommandTests.cs +++ b/AtemSharp.Tests/Commands/Fairlight/FairlightMixerResetPeakLevelsCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.Fairlight; [TestFixture] -public class FairlightMixerResetPeakLevelsCommandTests : SerializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/Fairlight/FairlightMixerSendLevelsCommandTests.cs b/AtemSharp.Tests/Commands/Fairlight/FairlightMixerSendLevelsCommandTests.cs index 911263b..c9f1f32 100644 --- a/AtemSharp.Tests/Commands/Fairlight/FairlightMixerSendLevelsCommandTests.cs +++ b/AtemSharp.Tests/Commands/Fairlight/FairlightMixerSendLevelsCommandTests.cs @@ -2,7 +2,7 @@ namespace AtemSharp.Tests.Commands.Fairlight; -public class FairlightMixerSendLevelsCommandTests : SerializedCommandTestBase +public class FairlightMixerSendLevelsCommandTests : TypeScriptLibrarySerializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterCommandTests.cs b/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterCommandTests.cs index 33a58fe..ffb010a 100644 --- a/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterCommandTests.cs +++ b/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.Fairlight.Master; -public class FairlightMixerMasterCommandTests : SerializedCommandTestBase +public class FairlightMixerMasterCommandTests : TypeScriptLibrarySerializedCommandTestBase { protected override Range[] GetFloatingPointByteRanges() => [ diff --git a/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterCompressorCommandTests.cs b/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterCompressorCommandTests.cs index a73b49a..1e5e8d8 100644 --- a/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterCompressorCommandTests.cs +++ b/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterCompressorCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.Fairlight.Master; -public class FairlightMixerMasterCompressorCommandTests : SerializedCommandTestBase +public class FairlightMixerMasterCompressorCommandTests : TypeScriptLibrarySerializedCommandTestBase { protected override Range[] GetFloatingPointByteRanges() => [ (4..8), // Threshold diff --git a/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterCompressorUpdateCommandTests.cs b/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterCompressorUpdateCommandTests.cs index 2485d1e..3b0c073 100644 --- a/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterCompressorUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterCompressorUpdateCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.Fairlight.Master; -internal class FairlightMixerMasterCompressorUpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterDynamicsResetCommandTests.cs b/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterDynamicsResetCommandTests.cs index d75b2a3..e1e1364 100644 --- a/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterDynamicsResetCommandTests.cs +++ b/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterDynamicsResetCommandTests.cs @@ -2,7 +2,7 @@ namespace AtemSharp.Tests.Commands.Fairlight.Master; -public class FairlightMixerMasterDynamicsResetCommandTests : SerializedCommandTestBase +public class FairlightMixerMasterDynamicsResetCommandTests : TypeScriptLibrarySerializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterEqualizerBandCommandTests.cs b/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterEqualizerBandCommandTests.cs index 7a8cec6..2baec09 100644 --- a/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterEqualizerBandCommandTests.cs +++ b/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterEqualizerBandCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.Fairlight.Master; -public class FairlightMixerMasterEqualizerBandCommandTests : SerializedCommandTestBase +public class FairlightMixerMasterEqualizerBandCommandTests : TypeScriptLibrarySerializedCommandTestBase { protected override Range[] GetFloatingPointByteRanges() => [ diff --git a/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterEqualizerBandUpdateCommandTests.cs b/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterEqualizerBandUpdateCommandTests.cs index a8f5d2e..60371f1 100644 --- a/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterEqualizerBandUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterEqualizerBandUpdateCommandTests.cs @@ -6,7 +6,7 @@ namespace AtemSharp.Tests.Commands.Fairlight.Master; -internal class FairlightMixerMasterEqualizerBandUpdateCommandTests : DeserializedCommandTestBase< +internal class FairlightMixerMasterEqualizerBandUpdateCommandTests : TypeScriptLibraryDeserializedCommandTestBase< FairlightMixerMasterEqualizerBandUpdateCommand, FairlightMixerMasterEqualizerBandUpdateCommandTests.CommandData> { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterEqualizerResetCommandTests.cs b/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterEqualizerResetCommandTests.cs index 13ea23d..a1ec116 100644 --- a/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterEqualizerResetCommandTests.cs +++ b/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterEqualizerResetCommandTests.cs @@ -2,7 +2,7 @@ namespace AtemSharp.Tests.Commands.Fairlight.Master; -public class FairlightMixerMasterEqualizerResetCommandTests : SerializedCommandTestBase +public class FairlightMixerMasterEqualizerResetCommandTests : TypeScriptLibrarySerializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterLevelsUpdateCommandTests.cs b/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterLevelsUpdateCommandTests.cs index 6349a3f..5a1011b 100644 --- a/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterLevelsUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterLevelsUpdateCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.Fairlight.Master; -internal class FairlightMixerMasterLevelsUpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterLimiterCommandTests.cs b/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterLimiterCommandTests.cs index 56f46f5..b66c61f 100644 --- a/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterLimiterCommandTests.cs +++ b/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterLimiterCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.Fairlight.Master; -public class FairlightMixerMasterLimiterCommandTests : SerializedCommandTestBase +public class FairlightMixerMasterLimiterCommandTests : TypeScriptLibrarySerializedCommandTestBase { protected override Range[] GetFloatingPointByteRanges() => [ diff --git a/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterLimiterUpdateCommandTests.cs b/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterLimiterUpdateCommandTests.cs index 44027ac..cfc68d4 100644 --- a/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterLimiterUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterLimiterUpdateCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.Fairlight.Master; -internal class FairlightMixerMasterLimiterUpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterPropertiesCommandTests.cs b/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterPropertiesCommandTests.cs index fccb892..3af3506 100644 --- a/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterPropertiesCommandTests.cs +++ b/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterPropertiesCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.Fairlight.Master; public class FairlightMixerMasterPropertiesCommandTests - : SerializedCommandTestBase + : TypeScriptLibrarySerializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterPropertiesUpdateCommandTests.cs b/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterPropertiesUpdateCommandTests.cs index 1bc3f58..ac0e5ab 100644 --- a/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterPropertiesUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterPropertiesUpdateCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.Fairlight.Master; -internal class FairlightMixerMasterPropertiesUpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterUpdateCommandTests.cs b/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterUpdateCommandTests.cs index ce4bc93..d1cb9d0 100644 --- a/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/Fairlight/Master/FairlightMixerMasterUpdateCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.Fairlight.Master; -internal class FairlightMixerMasterUpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/Fairlight/Monitor/FairlightMixerMonitorCommandTests.cs b/AtemSharp.Tests/Commands/Fairlight/Monitor/FairlightMixerMonitorCommandTests.cs index 650b6ae..730fffa 100644 --- a/AtemSharp.Tests/Commands/Fairlight/Monitor/FairlightMixerMonitorCommandTests.cs +++ b/AtemSharp.Tests/Commands/Fairlight/Monitor/FairlightMixerMonitorCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.Fairlight.Monitor; -public class FairlightMixerMonitorCommandTests : SerializedCommandTestBase +public class FairlightMixerMonitorCommandTests : TypeScriptLibrarySerializedCommandTestBase { protected override Range[] GetFloatingPointByteRanges() => [ diff --git a/AtemSharp.Tests/Commands/Fairlight/Monitor/FairlightMixerMonitorUpdateCommandTests.cs b/AtemSharp.Tests/Commands/Fairlight/Monitor/FairlightMixerMonitorUpdateCommandTests.cs index fb1ea63..237bb64 100644 --- a/AtemSharp.Tests/Commands/Fairlight/Monitor/FairlightMixerMonitorUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/Fairlight/Monitor/FairlightMixerMonitorUpdateCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.Fairlight.Monitor; -internal class FairlightMixerMonitorUpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceCommandTests.cs b/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceCommandTests.cs index f34163f..6fda938 100644 --- a/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceCommandTests.cs +++ b/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.Fairlight.Source; -public class FairlightMixerSourceCommandTests : SerializedCommandTestBase { protected override Range[] GetFloatingPointByteRanges() diff --git a/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceCompressorCommandTests.cs b/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceCompressorCommandTests.cs index 8055169..37689d0 100644 --- a/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceCompressorCommandTests.cs +++ b/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceCompressorCommandTests.cs @@ -2,7 +2,7 @@ namespace AtemSharp.Tests.Commands.Fairlight.Source; -public class FairlightMixerSourceCompressorCommandTests : SerializedCommandTestBase { protected override Range[] GetFloatingPointByteRanges() => diff --git a/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceCompressorUpdateCommandTests.cs b/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceCompressorUpdateCommandTests.cs index fc8b481..fdcf6ac 100644 --- a/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceCompressorUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceCompressorUpdateCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.Fairlight.Source; -internal class FairlightMixerSourceCompressorUpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceDeleteCommandTests.cs b/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceDeleteCommandTests.cs index 24405e8..c4de22f 100644 --- a/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceDeleteCommandTests.cs +++ b/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceDeleteCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.Fairlight.Source; -internal class FairlightMixerSourceDeleteCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceDynamicsResetCommandTests.cs b/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceDynamicsResetCommandTests.cs index a0337be..475ec94 100644 --- a/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceDynamicsResetCommandTests.cs +++ b/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceDynamicsResetCommandTests.cs @@ -2,7 +2,7 @@ namespace AtemSharp.Tests.Commands.Fairlight.Source; -public class FairlightMixerSourceDynamicsResetCommandTests : SerializedCommandTestBase +public class FairlightMixerSourceDynamicsResetCommandTests : TypeScriptLibrarySerializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceEqualizerBandCommandTests.cs b/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceEqualizerBandCommandTests.cs index 5bd23d5..0285b87 100644 --- a/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceEqualizerBandCommandTests.cs +++ b/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceEqualizerBandCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.Fairlight.Source; -public class FairlightMixerSourceEqualizerBandCommandTests : SerializedCommandTestBase { protected override Range[] GetFloatingPointByteRanges() => diff --git a/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceEqualizerBandUpdateCommandTests.cs b/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceEqualizerBandUpdateCommandTests.cs index 87f86dd..1437a6c 100644 --- a/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceEqualizerBandUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceEqualizerBandUpdateCommandTests.cs @@ -6,7 +6,7 @@ namespace AtemSharp.Tests.Commands.Fairlight.Source; -internal class FairlightMixerSourceEqualizerBandUpdateCommandTests : DeserializedCommandTestBase< +internal class FairlightMixerSourceEqualizerBandUpdateCommandTests : TypeScriptLibraryDeserializedCommandTestBase< FairlightMixerSourceEqualizerBandUpdateCommand, FairlightMixerSourceEqualizerBandUpdateCommandTests.CommandData> { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceEqualizerResetCommandTests.cs b/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceEqualizerResetCommandTests.cs index 93f86de..a2f3f66 100644 --- a/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceEqualizerResetCommandTests.cs +++ b/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceEqualizerResetCommandTests.cs @@ -2,7 +2,7 @@ namespace AtemSharp.Tests.Commands.Fairlight.Source; -public class FairlightMixerSourceEqualizerResetCommandTests : SerializedCommandTestBase +public class FairlightMixerSourceEqualizerResetCommandTests : TypeScriptLibrarySerializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceExpanderCommandTests.cs b/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceExpanderCommandTests.cs index df0b647..60d6895 100644 --- a/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceExpanderCommandTests.cs +++ b/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceExpanderCommandTests.cs @@ -2,7 +2,7 @@ namespace AtemSharp.Tests.Commands.Fairlight.Source; -public class FairlightMixerSourceExpanderCommandTests : SerializedCommandTestBase +public class FairlightMixerSourceExpanderCommandTests : TypeScriptLibrarySerializedCommandTestBase { protected override Range[] GetFloatingPointByteRanges() => [ (20..24), // Threshold diff --git a/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceExpanderUpdateCommandTests.cs b/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceExpanderUpdateCommandTests.cs index 6ec0803..7ff392f 100644 --- a/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceExpanderUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceExpanderUpdateCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.Fairlight.Source; -internal class FairlightMixerSourceExpanderUpdateCommandTests : DeserializedCommandTestBase +internal class FairlightMixerSourceExpanderUpdateCommandTests : TypeScriptLibraryDeserializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceLevelsUpdateCommandTests.cs b/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceLevelsUpdateCommandTests.cs index 29672b7..61fe514 100644 --- a/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceLevelsUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceLevelsUpdateCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.Fairlight.Source; -internal class FairlightMixerSourceLevelsUpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceLimiterCommandTests.cs b/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceLimiterCommandTests.cs index 9fe4fa4..ebfd30f 100644 --- a/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceLimiterCommandTests.cs +++ b/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceLimiterCommandTests.cs @@ -2,7 +2,7 @@ namespace AtemSharp.Tests.Commands.Fairlight.Source; -public class FairlightMixerSourceLimiterCommandTests : SerializedCommandTestBase +public class FairlightMixerSourceLimiterCommandTests : TypeScriptLibrarySerializedCommandTestBase { protected override Range[] GetFloatingPointByteRanges() => [ diff --git a/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceLimiterUpdateCommandTests.cs b/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceLimiterUpdateCommandTests.cs index 0b6f364..9dc3471 100644 --- a/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceLimiterUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceLimiterUpdateCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.Fairlight.Source; -internal class FairlightMixerSourceLimiterUpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceResetPeakLevelsCommandTests.cs b/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceResetPeakLevelsCommandTests.cs index df6f767..597fbff 100644 --- a/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceResetPeakLevelsCommandTests.cs +++ b/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceResetPeakLevelsCommandTests.cs @@ -2,7 +2,7 @@ namespace AtemSharp.Tests.Commands.Fairlight.Source; -public class FairlightMixerSourceResetPeakLevelsCommandTests : SerializedCommandTestBase +public class FairlightMixerSourceResetPeakLevelsCommandTests : TypeScriptLibrarySerializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceUpdateCommandTests.cs b/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceUpdateCommandTests.cs index 6759bce..074d7e7 100644 --- a/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/Fairlight/Source/FairlightMixerSourceUpdateCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.Fairlight.Source; -internal class FairlightMixerSourceUpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/Inputs/InputPropertiesCommandTests.cs b/AtemSharp.Tests/Commands/Inputs/InputPropertiesCommandTests.cs index 901729e..3a53b0f 100644 --- a/AtemSharp.Tests/Commands/Inputs/InputPropertiesCommandTests.cs +++ b/AtemSharp.Tests/Commands/Inputs/InputPropertiesCommandTests.cs @@ -5,7 +5,7 @@ namespace AtemSharp.Tests.Commands.Inputs; [TestFixture] -public class InputPropertiesCommandTests : SerializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/Inputs/InputPropertiesUpdateCommandTests.cs b/AtemSharp.Tests/Commands/Inputs/InputPropertiesUpdateCommandTests.cs index 557aa0c..79f580c 100644 --- a/AtemSharp.Tests/Commands/Inputs/InputPropertiesUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/Inputs/InputPropertiesUpdateCommandTests.cs @@ -6,7 +6,7 @@ namespace AtemSharp.Tests.Commands.Inputs; [TestFixture] -internal class InputPropertiesUpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/Macro/MacroActionCommandTests.cs b/AtemSharp.Tests/Commands/Macro/MacroActionCommandTests.cs index bdb7ca4..5a6a908 100644 --- a/AtemSharp.Tests/Commands/Macro/MacroActionCommandTests.cs +++ b/AtemSharp.Tests/Commands/Macro/MacroActionCommandTests.cs @@ -1,3 +1,4 @@ +using Argon; using AtemSharp.Commands.Macro; using AtemSharp.State.Macro; using AtemSharp.Tests.Batch; @@ -5,30 +6,27 @@ namespace AtemSharp.Tests.Commands.Macro; -public class MacroActionCommandTests : SerializedCommandTestBase +public class MacroActionCommandTests : SerializedCommandTestBase { - public class CommandData : CommandDataBase - { - public ushort Index { get; set; } - - public MacroAction Action { get; set; } - } + public record CreationParameters(ushort MacroId, MacroAction Action); - protected override MacroActionCommand CreateSut(TestUtilities.CommandTests.TestCaseData testCase) + protected override MacroActionCommand CreateCommand(IStateHolder state, JObject? creationParameters) { - var macro = new AtemSharp.State.Macro.Macro(Substitute.For()) { Id = testCase.Command.Index }; - return testCase.Command.Action switch + var parameters = creationParameters!.ToObject()!; + + return parameters.Action switch { - MacroAction.Run => MacroActionCommand.Run(macro), + MacroAction.Delete => MacroActionCommand.Delete(state.Macros[parameters.MacroId]), + MacroAction.Run => MacroActionCommand.Run(state.Macros[parameters.MacroId]), + MacroAction.Continue => MacroActionCommand.Continue(), MacroAction.Stop => MacroActionCommand.Stop(), MacroAction.StopRecord => MacroActionCommand.StopRecord(), MacroAction.InsertUserWait => MacroActionCommand.InsertUserWait(), - MacroAction.Continue => MacroActionCommand.Continue(), - MacroAction.Delete => MacroActionCommand.Delete(macro), _ => throw new ArgumentOutOfRangeException() }; } + [Test] public void LatestRunWins() { diff --git a/AtemSharp.Tests/Commands/Macro/MacroAddTimedPauseCommandTests.cs b/AtemSharp.Tests/Commands/Macro/MacroAddTimedPauseCommandTests.cs index 050679f..8dfd0d8 100644 --- a/AtemSharp.Tests/Commands/Macro/MacroAddTimedPauseCommandTests.cs +++ b/AtemSharp.Tests/Commands/Macro/MacroAddTimedPauseCommandTests.cs @@ -1,32 +1,21 @@ +using Argon; using AtemSharp.Commands.Macro; using AtemSharp.Tests.Batch; namespace AtemSharp.Tests.Commands.Macro; -public class MacroAddTimedPauseCommandTests : SerializedCommandTestBase +public class MacroAddTimedPauseCommandTests : SerializedCommandTestBase { - public class CommandData : CommandDataBase - { - public ushort Frames { get; set; } - } - - protected override MacroAddTimedPauseCommand CreateSut(TestUtilities.CommandTests.TestCaseData testCase) - { - return new MacroAddTimedPauseCommand - { - Frames = testCase.Command.Frames - }; - } + protected override MacroAddTimedPauseCommand CreateCommand(IStateHolder state, JObject? creationParameters) => new(); [Test] - public void MergeCommand() + public void DoesNotMergeWithSameCommand() { var first = new MacroAddTimedPauseCommand { Frames = 2 }; var second = new MacroAddTimedPauseCommand { Frames = 3 }; - Assert.That(second.TryMergeTo(first), Is.True); - Assert.That(first.Frames, Is.EqualTo(5)); + Assert.That(second.TryMergeTo(first), Is.False); + Assert.That(first.Frames, Is.EqualTo(2)); } [Test] @@ -37,3 +26,4 @@ public void DoesNotMergeWithDifferentCommandType() Assert.That(sut.TryMergeTo(new MergeableCommand(2)), Is.False); } } + diff --git a/AtemSharp.Tests/Commands/Macro/MacroPropertiesCommandTests.cs b/AtemSharp.Tests/Commands/Macro/MacroPropertiesCommandTests.cs index 58ab031..6065861 100644 --- a/AtemSharp.Tests/Commands/Macro/MacroPropertiesCommandTests.cs +++ b/AtemSharp.Tests/Commands/Macro/MacroPropertiesCommandTests.cs @@ -1,30 +1,17 @@ +using Argon; using AtemSharp.Commands.Macro; using AtemSharp.State.Macro; using NSubstitute; namespace AtemSharp.Tests.Commands.Macro; -public class MacroPropertiesCommandTests : SerializedCommandTestBase +public class MacroPropertiesCommandTests : SerializedCommandTestBase { - public class CommandData : CommandDataBase + protected override MacroPropertiesCommand CreateCommand(IStateHolder state, JObject? creationParameters) { - public ushort Index { get; set; } - public string Name { get; set; } = string.Empty; - public string Description { get; set; } = string.Empty; + return new MacroPropertiesCommand(state.Macros[creationParameters!["MacroId"]!.ToObject()]); } - protected override MacroPropertiesCommand CreateSut(TestUtilities.CommandTests.TestCaseData testCase) - { - var macro = new AtemSharp.State.Macro.Macro(Substitute.For()) - { - Id = testCase.Command.Index, - }; - - macro.UpdateName(testCase.Command.Name); - macro.UpdateDescription(testCase.Command.Description); - - return new MacroPropertiesCommand(macro); - } [Test] public void DoesNotMergeIfIndexIsDifferent() @@ -37,7 +24,7 @@ public void DoesNotMergeIfIndexIsDifferent() state[3].UpdateName("Name2"); var first = new MacroPropertiesCommand(state[2]); - var second = new MacroPropertiesCommand(state[3]); + var second = new MacroPropertiesCommand(state[3]); Assert.That(second.TryMergeTo(first), Is.False); Assert.Multiple(() => @@ -62,7 +49,7 @@ public void MergeOnlyWhenChanged() Name = "Name1", Description = "Desc1" }; - var second = new MacroPropertiesCommand(state[2]) + var second = new MacroPropertiesCommand(state[2]) { Name = "Name2" }; diff --git a/AtemSharp.Tests/Commands/Macro/MacroPropertiesUpdateCommandTests.cs b/AtemSharp.Tests/Commands/Macro/MacroPropertiesUpdateCommandTests.cs index be4cac0..1a38b0b 100644 --- a/AtemSharp.Tests/Commands/Macro/MacroPropertiesUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/Macro/MacroPropertiesUpdateCommandTests.cs @@ -5,7 +5,7 @@ namespace AtemSharp.Tests.Commands.Macro; -internal class MacroPropertiesUpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/Macro/MacroRecordCommandTests.cs b/AtemSharp.Tests/Commands/Macro/MacroRecordCommandTests.cs index 795839e..28d7258 100644 --- a/AtemSharp.Tests/Commands/Macro/MacroRecordCommandTests.cs +++ b/AtemSharp.Tests/Commands/Macro/MacroRecordCommandTests.cs @@ -1,36 +1,20 @@ +using Argon; using AtemSharp.Commands.Macro; using AtemSharp.State.Macro; +using JetBrains.Annotations; using NSubstitute; namespace AtemSharp.Tests.Commands.Macro; -public class MacroRecordCommandTests : SerializedCommandTestBase +public class MacroRecordCommandTests : SerializedCommandTestBase { - public class CommandData : CommandDataBase - { - public ushort Index { get; set; } - public string Name { get; set; } = string.Empty; - public string Description { get; set; } = string.Empty; - } + [UsedImplicitly] + private record CommandCreationParameters(ushort MacroId); - protected override MacroRecordCommand CreateSut(TestUtilities.CommandTests.TestCaseData testCase) + protected override MacroRecordCommand CreateCommand(IStateHolder state, JObject? creationParameters) { - var macro = new AtemSharp.State.Macro.Macro(Substitute.For()) - { - Id = testCase.Command.Index, - }; - - macro.UpdateName(testCase.Command.Name); - macro.UpdateDescription(testCase.Command.Description); - - return new MacroRecordCommand(macro); - } - - static MacroRecordCommand Factory() - { - var state = new MacroSystem(Substitute.For()); - state.Populate(5); - return new MacroRecordCommand(state[2]); + var parameters = creationParameters!.ToObject()!; + return new MacroRecordCommand(state.Macros[parameters.MacroId]); } [Test] @@ -39,8 +23,8 @@ public void NewMacroId_ReplacedOldCommand() var state = new MacroSystem(Substitute.For()); state.Populate(5); - var first = new MacroRecordCommand(state[2]) { Name = "First" , Description = "First Macro" }; - var second = new MacroRecordCommand(state[3]) { Name = "Second" , Description = "Second Macro" }; + var first = new MacroRecordCommand(state[2]) { Name = "First", Description = "First Macro" }; + var second = new MacroRecordCommand(state[3]) { Name = "Second", Description = "Second Macro" }; Assert.That(second.TryMergeTo(first), Is.True); Assert.That(first.Index, Is.EqualTo(3)); @@ -73,4 +57,11 @@ public void TestPropertyMerging_WithWrongType() { TestPropertyMerging_WithWrongType(Factory); } + + static MacroRecordCommand Factory() + { + var state = new MacroSystem(Substitute.For()); + state.Populate(5); + return new MacroRecordCommand(state[2]); + } } diff --git a/AtemSharp.Tests/Commands/Macro/MacroRecordingStatusCommandTests.cs b/AtemSharp.Tests/Commands/Macro/MacroRecordingStatusCommandTests.cs index 836ef6e..9f83b12 100644 --- a/AtemSharp.Tests/Commands/Macro/MacroRecordingStatusCommandTests.cs +++ b/AtemSharp.Tests/Commands/Macro/MacroRecordingStatusCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.Macro; -internal class MacroRecordingStatusCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/Macro/MacroRunStatusCommandTests.cs b/AtemSharp.Tests/Commands/Macro/MacroRunStatusCommandTests.cs index dbecf0d..30ced31 100644 --- a/AtemSharp.Tests/Commands/Macro/MacroRunStatusCommandTests.cs +++ b/AtemSharp.Tests/Commands/Macro/MacroRunStatusCommandTests.cs @@ -1,20 +1,11 @@ +using Argon; using AtemSharp.Commands.Macro; namespace AtemSharp.Tests.Commands.Macro; -public class MacroRunStatusCommandTests : SerializedCommandTestBase { - public class CommandData : CommandDataBase - { - public bool Loop { get; set; } - } - - protected override MacroRunStatusCommand CreateSut(TestUtilities.CommandTests.TestCaseData testCase) - { - return new MacroRunStatusCommand - { - Loop = testCase.Command.Loop - }; - } +public class MacroRunStatusCommandTests : SerializedCommandTestBase +{ + protected override MacroRunStatusCommand CreateCommand(IStateHolder state, JObject? creationParameters) => new(); [Test] [TestCase(false, false, false)] diff --git a/AtemSharp.Tests/Commands/Macro/MacroRunStatusUpdateCommandTests.cs b/AtemSharp.Tests/Commands/Macro/MacroRunStatusUpdateCommandTests.cs index df4d176..d0f5293 100644 --- a/AtemSharp.Tests/Commands/Macro/MacroRunStatusUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/Macro/MacroRunStatusUpdateCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.Macro; -internal class MacroRunStatusUpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/Media/MediaPlayerSourceCommandTests.cs b/AtemSharp.Tests/Commands/Media/MediaPlayerSourceCommandTests.cs index a29ca86..9fc95b7 100644 --- a/AtemSharp.Tests/Commands/Media/MediaPlayerSourceCommandTests.cs +++ b/AtemSharp.Tests/Commands/Media/MediaPlayerSourceCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.Media; -public class MediaPlayerSourceCommandTests : SerializedCommandTestBase +public class MediaPlayerSourceCommandTests : TypeScriptLibrarySerializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/Media/MediaPlayerSourceUpdateCommandTests.cs b/AtemSharp.Tests/Commands/Media/MediaPlayerSourceUpdateCommandTests.cs index dca34d9..92d6b1c 100644 --- a/AtemSharp.Tests/Commands/Media/MediaPlayerSourceUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/Media/MediaPlayerSourceUpdateCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.Media; -internal class MediaPlayerSourceUpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/Media/MediaPlayerStatusCommandTests.cs b/AtemSharp.Tests/Commands/Media/MediaPlayerStatusCommandTests.cs index 2b27bb8..323ca2f 100644 --- a/AtemSharp.Tests/Commands/Media/MediaPlayerStatusCommandTests.cs +++ b/AtemSharp.Tests/Commands/Media/MediaPlayerStatusCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.Media; -public class MediaPlayerStatusCommandTests : SerializedCommandTestBase +public class MediaPlayerStatusCommandTests : TypeScriptLibrarySerializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/Media/MediaPlayerStatusUpdateCommandTests.cs b/AtemSharp.Tests/Commands/Media/MediaPlayerStatusUpdateCommandTests.cs index 143c4e8..41ecb01 100644 --- a/AtemSharp.Tests/Commands/Media/MediaPlayerStatusUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/Media/MediaPlayerStatusUpdateCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.Media; -internal class MediaPlayerStatusUpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/Media/MediaPoolCaptureStillCommandTests.cs b/AtemSharp.Tests/Commands/Media/MediaPoolCaptureStillCommandTests.cs index f7aa723..58ee9f0 100644 --- a/AtemSharp.Tests/Commands/Media/MediaPoolCaptureStillCommandTests.cs +++ b/AtemSharp.Tests/Commands/Media/MediaPoolCaptureStillCommandTests.cs @@ -2,7 +2,7 @@ namespace AtemSharp.Tests.Commands.Media; -public class MediaPoolCaptureStillCommandTests : SerializedCommandTestBase +public class MediaPoolCaptureStillCommandTests : TypeScriptLibrarySerializedCommandTestBase { public class CommandData : CommandDataBase; diff --git a/AtemSharp.Tests/Commands/Media/MediaPoolClearClipCommandTests.cs b/AtemSharp.Tests/Commands/Media/MediaPoolClearClipCommandTests.cs index 9f215b5..1e07021 100644 --- a/AtemSharp.Tests/Commands/Media/MediaPoolClearClipCommandTests.cs +++ b/AtemSharp.Tests/Commands/Media/MediaPoolClearClipCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.Media; -public class MediaPoolClearClipCommandTests : SerializedCommandTestBase +public class MediaPoolClearClipCommandTests : TypeScriptLibrarySerializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/Media/MediaPoolClearStillCommandTests.cs b/AtemSharp.Tests/Commands/Media/MediaPoolClearStillCommandTests.cs index c571cf6..0e0a839 100644 --- a/AtemSharp.Tests/Commands/Media/MediaPoolClearStillCommandTests.cs +++ b/AtemSharp.Tests/Commands/Media/MediaPoolClearStillCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.Media; -public class MediaPoolClearStillCommandTests : SerializedCommandTestBase +public class MediaPoolClearStillCommandTests : TypeScriptLibrarySerializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/Media/MediaPoolClipDescriptionCommandTests.cs b/AtemSharp.Tests/Commands/Media/MediaPoolClipDescriptionCommandTests.cs index 08f71de..8897c5e 100644 --- a/AtemSharp.Tests/Commands/Media/MediaPoolClipDescriptionCommandTests.cs +++ b/AtemSharp.Tests/Commands/Media/MediaPoolClipDescriptionCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.Media; -internal class MediaPoolClipDescriptionCommandTests : DeserializedCommandTestBase +internal class MediaPoolClipDescriptionCommandTests : TypeScriptLibraryDeserializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/Media/MediaPoolFrameDescriptionCommandTests.cs b/AtemSharp.Tests/Commands/Media/MediaPoolFrameDescriptionCommandTests.cs index b58926e..2decd89 100644 --- a/AtemSharp.Tests/Commands/Media/MediaPoolFrameDescriptionCommandTests.cs +++ b/AtemSharp.Tests/Commands/Media/MediaPoolFrameDescriptionCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.Media; -internal class MediaPoolFrameDescriptionCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/Media/MediaPoolSetClipCommandTests.cs b/AtemSharp.Tests/Commands/Media/MediaPoolSetClipCommandTests.cs index 511c556..d15f4a2 100644 --- a/AtemSharp.Tests/Commands/Media/MediaPoolSetClipCommandTests.cs +++ b/AtemSharp.Tests/Commands/Media/MediaPoolSetClipCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.Media; -public class MediaPoolSetClipCommandTests : SerializedCommandTestBase +public class MediaPoolSetClipCommandTests : TypeScriptLibrarySerializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/Media/MediaPoolSettingsGetCommandTests.cs b/AtemSharp.Tests/Commands/Media/MediaPoolSettingsGetCommandTests.cs index 5f48a73..4525af5 100644 --- a/AtemSharp.Tests/Commands/Media/MediaPoolSettingsGetCommandTests.cs +++ b/AtemSharp.Tests/Commands/Media/MediaPoolSettingsGetCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.Media; -internal class MediaPoolSettingsGetCommandTests : DeserializedCommandTestBase +internal class MediaPoolSettingsGetCommandTests : TypeScriptLibraryDeserializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/Media/MediaPoolSettingsSetCommandTests.cs b/AtemSharp.Tests/Commands/Media/MediaPoolSettingsSetCommandTests.cs index 661a98f..cc54798 100644 --- a/AtemSharp.Tests/Commands/Media/MediaPoolSettingsSetCommandTests.cs +++ b/AtemSharp.Tests/Commands/Media/MediaPoolSettingsSetCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.Media; -public class MediaPoolSettingsSetCommandTests : SerializedCommandTestBase +public class MediaPoolSettingsSetCommandTests : TypeScriptLibrarySerializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/MixEffects/FadeToBlack/FadeToBlackAutoCommandTests.cs b/AtemSharp.Tests/Commands/MixEffects/FadeToBlack/FadeToBlackAutoCommandTests.cs index 8ee4f3c..c4fb514 100644 --- a/AtemSharp.Tests/Commands/MixEffects/FadeToBlack/FadeToBlackAutoCommandTests.cs +++ b/AtemSharp.Tests/Commands/MixEffects/FadeToBlack/FadeToBlackAutoCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.MixEffects.FadeToBlack; -public class FadeToBlackAutoCommandTests : SerializedCommandTestBase +public class FadeToBlackAutoCommandTests : TypeScriptLibrarySerializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/MixEffects/FadeToBlack/FadeToBlackRateCommandTests.cs b/AtemSharp.Tests/Commands/MixEffects/FadeToBlack/FadeToBlackRateCommandTests.cs index 4c2caa3..2d849ac 100644 --- a/AtemSharp.Tests/Commands/MixEffects/FadeToBlack/FadeToBlackRateCommandTests.cs +++ b/AtemSharp.Tests/Commands/MixEffects/FadeToBlack/FadeToBlackRateCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.MixEffects.FadeToBlack; -public class FadeToBlackRateCommandTests : SerializedCommandTestBase +public class FadeToBlackRateCommandTests : TypeScriptLibrarySerializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/MixEffects/FadeToBlack/FadeToBlackRateUpdateCommandTests.cs b/AtemSharp.Tests/Commands/MixEffects/FadeToBlack/FadeToBlackRateUpdateCommandTests.cs index fc59cdd..445051c 100644 --- a/AtemSharp.Tests/Commands/MixEffects/FadeToBlack/FadeToBlackRateUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/MixEffects/FadeToBlack/FadeToBlackRateUpdateCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.MixEffects.FadeToBlack; -internal class FadeToBlackRateUpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/MixEffects/FadeToBlack/FadeToBlackStateCommandTests.cs b/AtemSharp.Tests/Commands/MixEffects/FadeToBlack/FadeToBlackStateCommandTests.cs index 884faa5..f6869af 100644 --- a/AtemSharp.Tests/Commands/MixEffects/FadeToBlack/FadeToBlackStateCommandTests.cs +++ b/AtemSharp.Tests/Commands/MixEffects/FadeToBlack/FadeToBlackStateCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.MixEffects.FadeToBlack; -internal class FadeToBlackStateCommandTests : DeserializedCommandTestBase +internal class FadeToBlackStateCommandTests : TypeScriptLibraryDeserializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyAdvancedChromaPropertiesCommandTests.cs b/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyAdvancedChromaPropertiesCommandTests.cs index 6e96d36..106531a 100644 --- a/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyAdvancedChromaPropertiesCommandTests.cs +++ b/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyAdvancedChromaPropertiesCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.MixEffects.Key; [TestFixture] -public class MixEffectKeyAdvancedChromaPropertiesCommandTests : SerializedCommandTestBase { /// diff --git a/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyAdvancedChromaPropertiesUpdateCommandTests.cs b/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyAdvancedChromaPropertiesUpdateCommandTests.cs index 8df129b..d9af37a 100644 --- a/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyAdvancedChromaPropertiesUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyAdvancedChromaPropertiesUpdateCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.MixEffects.Key; [TestFixture] -internal class MixEffectKeyAdvancedChromaPropertiesUpdateCommandTests : DeserializedCommandTestBase< +internal class MixEffectKeyAdvancedChromaPropertiesUpdateCommandTests : TypeScriptLibraryDeserializedCommandTestBase< MixEffectKeyAdvancedChromaPropertiesUpdateCommand, MixEffectKeyAdvancedChromaPropertiesUpdateCommandTests.CommandData> { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyAdvancedChromaSampleCommandTests.cs b/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyAdvancedChromaSampleCommandTests.cs index 0682ef1..8a53cd8 100644 --- a/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyAdvancedChromaSampleCommandTests.cs +++ b/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyAdvancedChromaSampleCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.MixEffects.Key; [TestFixture] -public class MixEffectKeyAdvancedChromaSampleCommandTests : SerializedCommandTestBase { /// diff --git a/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyAdvancedChromaSampleResetCommandTests.cs b/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyAdvancedChromaSampleResetCommandTests.cs index a2614d8..a9dbf25 100644 --- a/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyAdvancedChromaSampleResetCommandTests.cs +++ b/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyAdvancedChromaSampleResetCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.MixEffects.Key; -public class MixEffectKeyAdvancedChromaSampleResetCommandTests : SerializedCommandTestBase +public class MixEffectKeyAdvancedChromaSampleResetCommandTests : TypeScriptLibrarySerializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyAdvancedChromaSampleUpdateCommandTests.cs b/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyAdvancedChromaSampleUpdateCommandTests.cs index 96398e2..d67e2c5 100644 --- a/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyAdvancedChromaSampleUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyAdvancedChromaSampleUpdateCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.MixEffects.Key; [TestFixture] -internal class MixEffectKeyAdvancedChromaSampleUpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyCutSourceSetCommandTests.cs b/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyCutSourceSetCommandTests.cs index 9d30281..8cc0a4c 100644 --- a/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyCutSourceSetCommandTests.cs +++ b/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyCutSourceSetCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.MixEffects.Key; -public class MixEffectKeyCutSourceSetCommandTests : SerializedCommandTestBase +public class MixEffectKeyCutSourceSetCommandTests : TypeScriptLibrarySerializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyDigitalVideoEffectsCommandTests.cs b/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyDigitalVideoEffectsCommandTests.cs index 254bbc4..add1a84 100644 --- a/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyDigitalVideoEffectsCommandTests.cs +++ b/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyDigitalVideoEffectsCommandTests.cs @@ -9,7 +9,7 @@ namespace AtemSharp.Tests.Commands.MixEffects.Key; // TODO #80: Capture test data and use test class base // for some reason byte 31 contains data in the TS test data and I don't know which [Ignore("TODO #80: Capture test data and use test class base")] -public class MixEffectKeyDigitalVideoEffectsCommandTests : SerializedCommandTestBase { /// diff --git a/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyDigitalVideoEffectsUpdateCommandTests.cs b/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyDigitalVideoEffectsUpdateCommandTests.cs index dd0495f..a310b75 100644 --- a/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyDigitalVideoEffectsUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyDigitalVideoEffectsUpdateCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.MixEffects.Key; -internal class MixEffectKeyDigitalVideoEffectsUpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyFillSourceSetCommandTests.cs b/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyFillSourceSetCommandTests.cs index 4fb5ea8..1998842 100644 --- a/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyFillSourceSetCommandTests.cs +++ b/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyFillSourceSetCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.MixEffects.Key; -public class MixEffectKeyFillSourceSetCommandTests : SerializedCommandTestBase +public class MixEffectKeyFillSourceSetCommandTests : TypeScriptLibrarySerializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyFlyKeyframeCommandTests.cs b/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyFlyKeyframeCommandTests.cs index bb15ba9..a39b04a 100644 --- a/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyFlyKeyframeCommandTests.cs +++ b/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyFlyKeyframeCommandTests.cs @@ -7,7 +7,7 @@ namespace AtemSharp.Tests.Commands.MixEffects.Key; // TODO #82: Capture real test data and verify implementation and tests [Ignore("Verify correct byte sequence with ATEM Control software and compare with generated serialization")] -public class MixEffectKeyFlyKeyframeCommandTests : SerializedCommandTestBase { protected override Range[] GetFloatingPointByteRanges() => diff --git a/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyFlyKeyframeStoreCommandTests.cs b/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyFlyKeyframeStoreCommandTests.cs index 5518229..d6ae228 100644 --- a/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyFlyKeyframeStoreCommandTests.cs +++ b/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyFlyKeyframeStoreCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.MixEffects.Key; -public class MixEffectKeyFlyKeyframeStoreCommandTests : SerializedCommandTestBase +public class MixEffectKeyFlyKeyframeStoreCommandTests : TypeScriptLibrarySerializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyFlyKeyframeUpdateCommandTests.cs b/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyFlyKeyframeUpdateCommandTests.cs index a7b85a7..1d7b736 100644 --- a/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyFlyKeyframeUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyFlyKeyframeUpdateCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.MixEffects.Key; -internal class MixEffectKeyFlyKeyframeUpdateCommandTests : DeserializedCommandTestBase +internal class MixEffectKeyFlyKeyframeUpdateCommandTests : TypeScriptLibraryDeserializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyFlyPropertiesUpdateCommandTests.cs b/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyFlyPropertiesUpdateCommandTests.cs index 719b4cc..2f8858b 100644 --- a/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyFlyPropertiesUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyFlyPropertiesUpdateCommandTests.cs @@ -5,7 +5,7 @@ namespace AtemSharp.Tests.Commands.MixEffects.Key; [TestFixture] -internal class MixEffectKeyFlyPropertiesUpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyLumaCommandTests.cs b/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyLumaCommandTests.cs index 04ece30..e9b5af4 100644 --- a/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyLumaCommandTests.cs +++ b/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyLumaCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.MixEffects.Key; [TestFixture] -public class MixEffectKeyLumaCommandTests : SerializedCommandTestBase { /// diff --git a/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyLumaUpdateCommandTests.cs b/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyLumaUpdateCommandTests.cs index 6ec07ef..3619d5d 100644 --- a/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyLumaUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyLumaUpdateCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.MixEffects.Key; [TestFixture] -internal class MixEffectKeyLumaUpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyMaskSetCommandTests.cs b/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyMaskSetCommandTests.cs index 7e619c9..a87e566 100644 --- a/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyMaskSetCommandTests.cs +++ b/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyMaskSetCommandTests.cs @@ -2,7 +2,7 @@ namespace AtemSharp.Tests.Commands.MixEffects.Key; -public class MixEffectKeyMaskSetCommandTests : SerializedCommandTestBase +public class MixEffectKeyMaskSetCommandTests : TypeScriptLibrarySerializedCommandTestBase { protected override Range[] GetFloatingPointByteRanges() => [ (4..6), diff --git a/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyOnAirCommandTests.cs b/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyOnAirCommandTests.cs index 02bcb19..f4fe71f 100644 --- a/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyOnAirCommandTests.cs +++ b/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyOnAirCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.MixEffects.Key; [TestFixture] -public class MixEffectKeyOnAirCommandTests : SerializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyOnAirUpdateCommandTests.cs b/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyOnAirUpdateCommandTests.cs index 04f2f2e..f9581a7 100644 --- a/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyOnAirUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyOnAirUpdateCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.MixEffects.Key; [TestFixture] -internal class MixEffectKeyOnAirUpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyPatternCommandTests.cs b/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyPatternCommandTests.cs index cf91f24..9e96476 100644 --- a/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyPatternCommandTests.cs +++ b/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyPatternCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.MixEffects.Key; -public class MixEffectKeyPatternCommandTests : SerializedCommandTestBase +public class MixEffectKeyPatternCommandTests : TypeScriptLibrarySerializedCommandTestBase { protected override Range[] GetFloatingPointByteRanges() => [ (4..6), // Size diff --git a/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyPatternUpdateCommandTests.cs b/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyPatternUpdateCommandTests.cs index 0cec52c..c079127 100644 --- a/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyPatternUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyPatternUpdateCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.MixEffects.Key; -internal class MixEffectKeyPatternUpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyPropertiesGetCommandTests.cs b/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyPropertiesGetCommandTests.cs index b487ab6..fdfe5b8 100644 --- a/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyPropertiesGetCommandTests.cs +++ b/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyPropertiesGetCommandTests.cs @@ -5,7 +5,7 @@ namespace AtemSharp.Tests.Commands.MixEffects.Key; [TestFixture] -internal class MixEffectKeyPropertiesGetCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyRunToCommandTests.cs b/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyRunToCommandTests.cs index f687b4a..702f83f 100644 --- a/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyRunToCommandTests.cs +++ b/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyRunToCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.MixEffects.Key; // TODO #83: Capture test data for RunToInfinite case -public class MixEffectKeyRunToCommandTests : SerializedCommandTestBase +public class MixEffectKeyRunToCommandTests : TypeScriptLibrarySerializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyTypeSetCommandTests.cs b/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyTypeSetCommandTests.cs index 87e31af..1833768 100644 --- a/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyTypeSetCommandTests.cs +++ b/AtemSharp.Tests/Commands/MixEffects/Key/MixEffectKeyTypeSetCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.MixEffects.Key; -public class MixEffectKeyTypeSetCommandTests : SerializedCommandTestBase +public class MixEffectKeyTypeSetCommandTests : TypeScriptLibrarySerializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/MixEffects/PreviewInputCommandTests.cs b/AtemSharp.Tests/Commands/MixEffects/PreviewInputCommandTests.cs index 210c5aa..32686f9 100644 --- a/AtemSharp.Tests/Commands/MixEffects/PreviewInputCommandTests.cs +++ b/AtemSharp.Tests/Commands/MixEffects/PreviewInputCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.MixEffects; [TestFixture] -public class PreviewInputCommandTests : SerializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/MixEffects/PreviewInputUpdateCommandTests.cs b/AtemSharp.Tests/Commands/MixEffects/PreviewInputUpdateCommandTests.cs index 34f2710..57340f9 100644 --- a/AtemSharp.Tests/Commands/MixEffects/PreviewInputUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/MixEffects/PreviewInputUpdateCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.MixEffects; [TestFixture] -internal class PreviewInputUpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/MixEffects/ProgramInputCommandTests.cs b/AtemSharp.Tests/Commands/MixEffects/ProgramInputCommandTests.cs index 306f4d2..a5e3134 100644 --- a/AtemSharp.Tests/Commands/MixEffects/ProgramInputCommandTests.cs +++ b/AtemSharp.Tests/Commands/MixEffects/ProgramInputCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.MixEffects; [TestFixture] -public class ProgramInputCommandTests : SerializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/MixEffects/ProgramInputUpdateCommandTests.cs b/AtemSharp.Tests/Commands/MixEffects/ProgramInputUpdateCommandTests.cs index 4c5767a..ab29b3a 100644 --- a/AtemSharp.Tests/Commands/MixEffects/ProgramInputUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/MixEffects/ProgramInputUpdateCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.MixEffects; [TestFixture] -internal class ProgramInputUpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/MixEffects/Transition/AutoTransitionCommandTests.cs b/AtemSharp.Tests/Commands/MixEffects/Transition/AutoTransitionCommandTests.cs index 530dde6..5455bad 100644 --- a/AtemSharp.Tests/Commands/MixEffects/Transition/AutoTransitionCommandTests.cs +++ b/AtemSharp.Tests/Commands/MixEffects/Transition/AutoTransitionCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.MixEffects.Transition; -public class AutoTransitionCommandTests : SerializedCommandTestBase +public class AutoTransitionCommandTests : TypeScriptLibrarySerializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/MixEffects/Transition/CutCommandTests.cs b/AtemSharp.Tests/Commands/MixEffects/Transition/CutCommandTests.cs index fd48dfe..961d66e 100644 --- a/AtemSharp.Tests/Commands/MixEffects/Transition/CutCommandTests.cs +++ b/AtemSharp.Tests/Commands/MixEffects/Transition/CutCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.MixEffects.Transition; -public class CutCommandTests : SerializedCommandTestBase +public class CutCommandTests : TypeScriptLibrarySerializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/MixEffects/Transition/PreviewTransitionCommandTests.cs b/AtemSharp.Tests/Commands/MixEffects/Transition/PreviewTransitionCommandTests.cs index bbfc037..fd3ed55 100644 --- a/AtemSharp.Tests/Commands/MixEffects/Transition/PreviewTransitionCommandTests.cs +++ b/AtemSharp.Tests/Commands/MixEffects/Transition/PreviewTransitionCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.MixEffects.Transition; [TestFixture] -public class PreviewTransitionCommandTests : SerializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/MixEffects/Transition/PreviewTransitionUpdateCommandTests.cs b/AtemSharp.Tests/Commands/MixEffects/Transition/PreviewTransitionUpdateCommandTests.cs index f9b3b5f..0b8f48c 100644 --- a/AtemSharp.Tests/Commands/MixEffects/Transition/PreviewTransitionUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/MixEffects/Transition/PreviewTransitionUpdateCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.MixEffects.Transition; [TestFixture] -internal class PreviewTransitionUpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionDigitalVideoEffectCommandTests.cs b/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionDigitalVideoEffectCommandTests.cs index a61b908..9945c0b 100644 --- a/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionDigitalVideoEffectCommandTests.cs +++ b/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionDigitalVideoEffectCommandTests.cs @@ -5,7 +5,7 @@ namespace AtemSharp.Tests.Commands.MixEffects.Transition; [TestFixture] -public class TransitionDigitalVideoEffectCommandTests : SerializedCommandTestBase { protected override Range[] GetFloatingPointByteRanges() => diff --git a/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionDigitalVideoEffectsUpdateCommandTests.cs b/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionDigitalVideoEffectsUpdateCommandTests.cs index 4ddb442..09812b3 100644 --- a/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionDigitalVideoEffectsUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionDigitalVideoEffectsUpdateCommandTests.cs @@ -5,7 +5,7 @@ namespace AtemSharp.Tests.Commands.MixEffects.Transition; [TestFixture] -internal class TransitionDigitalVideoEffectsUpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionDipCommandTests.cs b/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionDipCommandTests.cs index 76c9724..1dfccf4 100644 --- a/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionDipCommandTests.cs +++ b/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionDipCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.MixEffects.Transition; [TestFixture] -public class TransitionDipCommandTests : SerializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionDipUpdateCommandTests.cs b/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionDipUpdateCommandTests.cs index f931790..6617338 100644 --- a/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionDipUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionDipUpdateCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.MixEffects.Transition; [TestFixture] -internal class TransitionDipUpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionMixCommandTests.cs b/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionMixCommandTests.cs index e679036..813f8be 100644 --- a/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionMixCommandTests.cs +++ b/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionMixCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.MixEffects.Transition; [TestFixture] -public class TransitionMixCommandTests : SerializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionMixUpdateCommandTests.cs b/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionMixUpdateCommandTests.cs index 5419264..0270209 100644 --- a/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionMixUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionMixUpdateCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.MixEffects.Transition; [TestFixture] -internal class TransitionMixUpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionPositionCommandTests.cs b/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionPositionCommandTests.cs index 9f60207..e2b671f 100644 --- a/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionPositionCommandTests.cs +++ b/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionPositionCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.MixEffects.Transition; [TestFixture] -public class TransitionPositionCommandTests : SerializedCommandTestBase { protected override Range[] GetFloatingPointByteRanges() => diff --git a/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionPositionUpdateCommandTests.cs b/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionPositionUpdateCommandTests.cs index df7c0a8..4b13b2d 100644 --- a/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionPositionUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionPositionUpdateCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.MixEffects.Transition; [TestFixture] -internal class TransitionPositionUpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionPropertiesCommandTests.cs b/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionPropertiesCommandTests.cs index fa4a3cf..66e2147 100644 --- a/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionPropertiesCommandTests.cs +++ b/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionPropertiesCommandTests.cs @@ -5,7 +5,7 @@ namespace AtemSharp.Tests.Commands.MixEffects.Transition; [TestFixture] -public class TransitionPropertiesCommandTests : SerializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionPropertiesUpdateCommandTests.cs b/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionPropertiesUpdateCommandTests.cs index 2761025..570110c 100644 --- a/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionPropertiesUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionPropertiesUpdateCommandTests.cs @@ -5,7 +5,7 @@ namespace AtemSharp.Tests.Commands.MixEffects.Transition; [TestFixture] -internal class TransitionPropertiesUpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionStingerCommandTests.cs b/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionStingerCommandTests.cs index 1df580f..4e6b591 100644 --- a/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionStingerCommandTests.cs +++ b/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionStingerCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.MixEffects.Transition; [TestFixture] -public class TransitionStingerCommandTests : SerializedCommandTestBase { /// diff --git a/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionStingerUpdateCommandTests.cs b/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionStingerUpdateCommandTests.cs index 9d2cb2b..cd41b4f 100644 --- a/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionStingerUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionStingerUpdateCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.MixEffects.Transition; [TestFixture] -internal class TransitionStingerUpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionWipeCommandTests.cs b/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionWipeCommandTests.cs index 9f35ee3..3bf2d3b 100644 --- a/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionWipeCommandTests.cs +++ b/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionWipeCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.MixEffects.Transition; [TestFixture] -public class TransitionWipeCommandTests : SerializedCommandTestBase { /// diff --git a/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionWipeUpdateCommandTests.cs b/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionWipeUpdateCommandTests.cs index 0f342a8..36ada56 100644 --- a/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionWipeUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/MixEffects/Transition/TransitionWipeUpdateCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.MixEffects.Transition; [TestFixture] -internal class TransitionWipeUpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/PowerStatusCommandTests.cs b/AtemSharp.Tests/Commands/PowerStatusCommandTests.cs index 542d730..749727e 100644 --- a/AtemSharp.Tests/Commands/PowerStatusCommandTests.cs +++ b/AtemSharp.Tests/Commands/PowerStatusCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands; [TestFixture] -internal class PowerStatusCommandTests : DeserializedCommandTestBase +internal class PowerStatusCommandTests : TypeScriptLibraryDeserializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/Recording/RecordingDiskInfoUpdateCommandTests.cs b/AtemSharp.Tests/Commands/Recording/RecordingDiskInfoUpdateCommandTests.cs index db98ad5..f0082f8 100644 --- a/AtemSharp.Tests/Commands/Recording/RecordingDiskInfoUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/Recording/RecordingDiskInfoUpdateCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.Recording; -internal class RecordingDiskInfoUpdateCommandTests : DeserializedCommandTestBase +internal class RecordingDiskInfoUpdateCommandTests : TypeScriptLibraryDeserializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/Recording/RecordingDurationUpdateCommandTests.cs b/AtemSharp.Tests/Commands/Recording/RecordingDurationUpdateCommandTests.cs index 1158eba..899a924 100644 --- a/AtemSharp.Tests/Commands/Recording/RecordingDurationUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/Recording/RecordingDurationUpdateCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.Recording; -internal class RecordingDurationUpdateCommandTests : DeserializedCommandTestBase +internal class RecordingDurationUpdateCommandTests : TypeScriptLibraryDeserializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/Recording/RecordingISOCommandTests.cs b/AtemSharp.Tests/Commands/Recording/RecordingISOCommandTests.cs index e41f76b..d5aca87 100644 --- a/AtemSharp.Tests/Commands/Recording/RecordingISOCommandTests.cs +++ b/AtemSharp.Tests/Commands/Recording/RecordingISOCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.Recording; -public class RecordingIsoCommandTests : SerializedCommandTestBase +public class RecordingIsoCommandTests : TypeScriptLibrarySerializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/Recording/RecordingIsoUpdateCommandTests.cs b/AtemSharp.Tests/Commands/Recording/RecordingIsoUpdateCommandTests.cs index 1e62384..e315e0e 100644 --- a/AtemSharp.Tests/Commands/Recording/RecordingIsoUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/Recording/RecordingIsoUpdateCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.Recording; -internal class RecordingIsoUpdateCommandTests : DeserializedCommandTestBase +internal class RecordingIsoUpdateCommandTests : TypeScriptLibraryDeserializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/Recording/RecordingSettingsCommandTests.cs b/AtemSharp.Tests/Commands/Recording/RecordingSettingsCommandTests.cs index e719934..3354a57 100644 --- a/AtemSharp.Tests/Commands/Recording/RecordingSettingsCommandTests.cs +++ b/AtemSharp.Tests/Commands/Recording/RecordingSettingsCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.Recording; -public class RecordingSettingsCommandTests : SerializedCommandTestBase +public class RecordingSettingsCommandTests : TypeScriptLibrarySerializedCommandTestBase { public class CommandData: CommandDataBase { diff --git a/AtemSharp.Tests/Commands/Recording/RecordingSettingsUpdateCommandTests.cs b/AtemSharp.Tests/Commands/Recording/RecordingSettingsUpdateCommandTests.cs index 3be482b..66811b7 100644 --- a/AtemSharp.Tests/Commands/Recording/RecordingSettingsUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/Recording/RecordingSettingsUpdateCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.Recording; -internal class RecordingSettingsUpdateCommandTests : DeserializedCommandTestBase +internal class RecordingSettingsUpdateCommandTests : TypeScriptLibraryDeserializedCommandTestBase { public class CommandData: CommandDataBase { diff --git a/AtemSharp.Tests/Commands/Recording/RecordingStatusCommandTests.cs b/AtemSharp.Tests/Commands/Recording/RecordingStatusCommandTests.cs index 1e7b993..71613ed 100644 --- a/AtemSharp.Tests/Commands/Recording/RecordingStatusCommandTests.cs +++ b/AtemSharp.Tests/Commands/Recording/RecordingStatusCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.Recording; -public class RecordingStatusCommandTests : SerializedCommandTestBase +public class RecordingStatusCommandTests : TypeScriptLibrarySerializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/Recording/RecordingStatusUpdateCommandTests.cs b/AtemSharp.Tests/Commands/Recording/RecordingStatusUpdateCommandTests.cs index 8699c50..6af132f 100644 --- a/AtemSharp.Tests/Commands/Recording/RecordingStatusUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/Recording/RecordingStatusUpdateCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.Recording; -internal class RecordingStatusUpdateCommandTests : DeserializedCommandTestBase +internal class RecordingStatusUpdateCommandTests : TypeScriptLibraryDeserializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/SerializedCommandTestBase.cs b/AtemSharp.Tests/Commands/SerializedCommandTestBase.cs index 7862192..4430df1 100644 --- a/AtemSharp.Tests/Commands/SerializedCommandTestBase.cs +++ b/AtemSharp.Tests/Commands/SerializedCommandTestBase.cs @@ -1,82 +1,69 @@ +using System.Reflection; +using Argon; +using AtemSharp.Attributes; using AtemSharp.Commands; using AtemSharp.Tests.Batch; using AtemSharp.Tests.TestUtilities.CommandTests; -using JetBrains.Annotations; -using Newtonsoft.Json; +using AtemSharp.Tests.TestUtilities.CommandTests.RecordedTestCases; +using JsonConvert = Newtonsoft.Json.JsonConvert; namespace AtemSharp.Tests.Commands; -public abstract class SerializedCommandTestBase - where TCommand : SerializedCommand - where TTestData : SerializedCommandTestBase.CommandDataBase, new() +[TestFixture] +public abstract class SerializedCommandTestBase where TCommand : SerializedCommand { - /// - /// Override to specify which byte ranges contain floating-point encoded data - /// that should be compared with tolerance for precision differences - /// - protected virtual Range[] GetFloatingPointByteRanges() - { - return []; - } + protected abstract TCommand CreateCommand(IStateHolder state, JObject? creationParameters); + - private bool IsFloatingPointByte(int index, int totalLength) + public static IEnumerable GetTestCases() { - var ranges = GetFloatingPointByteRanges(); - foreach (var range in ranges) - { - var (start, length) = range.GetOffsetAndLength(totalLength); - var end = start + length - 1; - if (index >= start && index <= end) - { - return true; - } - } + var commandAttribute = typeof(TCommand).GetCustomAttribute(); + Assert.That(commandAttribute, Is.Not.Null, $"CommandAttribute is required on command class {typeof(TCommand).Name}"); + + var rawName = commandAttribute.RawName; - return false; + return RecordedTestCase.GetRecordedTestCases(rawName).Select(testCase => new TestCaseData(testCase).SetName(testCase.Name)); } - private bool AreApproximatelyEqual(byte[] actual, byte[] expected) + [Test] + [TestCaseSource(nameof(GetTestCases))] + public void TestSerializedCommand(RecordedTestCase testCase) { - if (actual.Length != expected.Length) - { - return false; - } + // Generate empty state + var state = Helper.CreateDefaultStateHolder(); + + // Create Command + var command = CreateCommand(state, testCase.CommandCreationParameters); - for (var i = 0; i < actual.Length; i++) + // Apply changes to Command + if (testCase.Changes is not null) { - var tolerance = IsFloatingPointByte(i, actual.Length) ? 2 : 0; - if (Math.Abs(actual[i] - expected[i]) > tolerance) - { - // Check if its within the tolerance with carry - return !(Math.Abs(actual[i] - expected[i]) < 256 - tolerance); - } + JsonConvert.PopulateObject(testCase.Changes.ToString(), command); } - return true; + var actualPayload = command.Serialize(testCase.Version); + var expectedPayload = Helper.ParseHexBytes(testCase.Payload); + Helper.CompareSerializedBytes(actualPayload, expectedPayload, GetFloatingPointByteRanges()); } - [UsedImplicitly(ImplicitUseTargetFlags.WithInheritors | ImplicitUseTargetFlags.WithMembers)] - public abstract class CommandDataBase : TestUtilities.CommandTests.CommandDataBase - { - public uint Mask { get; set; } - } - - public static IEnumerable GetTestCases() + /// + /// Override to specify which byte ranges contain floating-point encoded data + /// that should be compared with tolerance for precision differences + /// + protected virtual Range[] GetFloatingPointByteRanges() { - var testCases = Helper.GetTestCases().ToArray(); - Assert.That(testCases.Length, Is.GreaterThan(0), "No test cases found"); - return testCases; + return []; } - public static TestCaseData CreateMergingTestCase( - string propertyName, - TValue firstValue, - TValue secondValue) + protected static TestCaseData CreateMergingTestCase( + string propertyName, + TValue firstValue, + TValue secondValue) { return new TestCaseData(propertyName, firstValue, secondValue).SetName(propertyName); } - public void TestPropertyMerging( + protected void TestPropertyMerging( Func factory, string propertyName, TValue firstValue, @@ -85,8 +72,10 @@ public void TestPropertyMerging( var first = factory(); var second = factory(); - var getter = typeof(TCommand).GetProperty(propertyName)?.GetMethod ?? throw new InvalidOperationException($"No getter for property {typeof(TCommand)}.{propertyName} found"); - var setter = typeof(TCommand).GetProperty(propertyName)?.SetMethod ?? throw new InvalidOperationException($"No setter for property {typeof(TCommand)}.{propertyName} found"); + var getter = typeof(TCommand).GetProperty(propertyName)?.GetMethod ?? + throw new InvalidOperationException($"No getter for property {typeof(TCommand)}.{propertyName} found"); + var setter = typeof(TCommand).GetProperty(propertyName)?.SetMethod ?? + throw new InvalidOperationException($"No setter for property {typeof(TCommand)}.{propertyName} found"); setter.Invoke(first, [firstValue]); setter.Invoke(second, [secondValue]); @@ -95,7 +84,7 @@ public void TestPropertyMerging( Assert.That(getter.Invoke(first, []), Is.EqualTo(secondValue)); } - public void TestPropertyNonMerging( + protected void TestPropertyNonMerging( Func factory, string propertyName, TValue firstValue, @@ -104,8 +93,10 @@ public void TestPropertyNonMerging( var first = factory(); var second = factory(); - var getter = typeof(TCommand).GetProperty(propertyName)?.GetMethod ?? throw new InvalidOperationException($"No getter for property {typeof(TCommand)}.{propertyName} found"); - var setter = typeof(TCommand).GetProperty(propertyName)?.SetMethod ?? throw new InvalidOperationException($"No setter for property {typeof(TCommand)}.{propertyName} found"); + var getter = typeof(TCommand).GetProperty(propertyName)?.GetMethod ?? + throw new InvalidOperationException($"No getter for property {typeof(TCommand)}.{propertyName} found"); + var setter = typeof(TCommand).GetProperty(propertyName)?.SetMethod ?? + throw new InvalidOperationException($"No setter for property {typeof(TCommand)}.{propertyName} found"); setter.Invoke(first, [firstValue]); @@ -113,49 +104,8 @@ public void TestPropertyNonMerging( Assert.That(getter.Invoke(first, []), Is.EqualTo(firstValue)); } - public void TestPropertyMerging_WithWrongType(Func factory) + protected void TestPropertyMerging_WithWrongType(Func factory) { - var command = factory(); Assert.That(factory().TryMergeTo(new MergeableCommand(2)), Is.False); } - - [Test, TestCaseSource(nameof(GetTestCases))] - public void TestSerialization(TestUtilities.CommandTests.TestCaseData testCase) - { - if (testCase.Command.UnknownProperties.Count != 0) - { - Assert.Fail("Unprocessed test data:\n" + JsonConvert.SerializeObject(testCase.Command.UnknownProperties)); - } - - var expectedPayload = testCase.Payload; - - var command = CreateSut(testCase); - command.Flag = testCase.Command.Mask; - - // Act - var actualPayload = command.Serialize(testCase.FirstVersion); - - Assert.That(actualPayload, Has.Length.EqualTo(expectedPayload.Length)); - - // Step 1: Compare non-float bytes exactly - var actualNonFloatBytes = - string.Join("-", actualPayload.Select((b, i) => IsFloatingPointByte(i, actualPayload.Length) ? "XX" : $"{b:X2}")); - var expectedNonFloatBytes = - string.Join("-", expectedPayload.Select((b, i) => IsFloatingPointByte(i, actualPayload.Length) ? "XX" : $"{b:X2}")); - Assert.That(actualNonFloatBytes, Is.EqualTo(expectedNonFloatBytes)); - - // Then try approximate match for floating-point fields - var actualFloatBytes = - string.Join("-", actualPayload.Select((b, i) => !IsFloatingPointByte(i, actualPayload.Length) ? "XX" : $"{b:X2}")); - var expectedFloatBytes = - string.Join("-", expectedPayload.Select((b, i) => !IsFloatingPointByte(i, actualPayload.Length) ? "XX" : $"{b:X2}")); - if (!AreApproximatelyEqual(actualPayload, expectedPayload)) - { - Assert.Fail($"Float-bytes differ more than 2 units\n" + - $"Expected: {expectedFloatBytes}\n" + - $"Actual: {actualFloatBytes}"); - } - } - - protected abstract TCommand CreateSut(TestUtilities.CommandTests.TestCaseData testCase); } diff --git a/AtemSharp.Tests/Commands/Settings/MultiViewers/MultiViewerPropertiesCommandTests.cs b/AtemSharp.Tests/Commands/Settings/MultiViewers/MultiViewerPropertiesCommandTests.cs index 40f7293..9e1f8d7 100644 --- a/AtemSharp.Tests/Commands/Settings/MultiViewers/MultiViewerPropertiesCommandTests.cs +++ b/AtemSharp.Tests/Commands/Settings/MultiViewers/MultiViewerPropertiesCommandTests.cs @@ -7,7 +7,7 @@ namespace AtemSharp.Tests.Commands.Settings.MultiViewers; /// Tests for MultiViewerPropertiesCommand /// [TestFixture] -public class MultiViewerPropertiesCommandTests : SerializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/Settings/MultiViewers/MultiViewerPropertiesUpdateCommandTests.cs b/AtemSharp.Tests/Commands/Settings/MultiViewers/MultiViewerPropertiesUpdateCommandTests.cs index 76f119e..2858ba7 100644 --- a/AtemSharp.Tests/Commands/Settings/MultiViewers/MultiViewerPropertiesUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/Settings/MultiViewers/MultiViewerPropertiesUpdateCommandTests.cs @@ -5,7 +5,7 @@ namespace AtemSharp.Tests.Commands.Settings.MultiViewers; [TestFixture] -internal class MultiViewerPropertiesUpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/Settings/MultiViewers/MultiViewerSourceCommandTests.cs b/AtemSharp.Tests/Commands/Settings/MultiViewers/MultiViewerSourceCommandTests.cs index 81cf2a6..e5d159b 100644 --- a/AtemSharp.Tests/Commands/Settings/MultiViewers/MultiViewerSourceCommandTests.cs +++ b/AtemSharp.Tests/Commands/Settings/MultiViewers/MultiViewerSourceCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.Settings.MultiViewers; [TestFixture] -public class MultiViewerSourceCommandTests : SerializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/Settings/MultiViewers/MultiViewerSourceUpdateCommandTests.cs b/AtemSharp.Tests/Commands/Settings/MultiViewers/MultiViewerSourceUpdateCommandTests.cs index ca85421..859ce9d 100644 --- a/AtemSharp.Tests/Commands/Settings/MultiViewers/MultiViewerSourceUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/Settings/MultiViewers/MultiViewerSourceUpdateCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.Settings.MultiViewers; [TestFixture] -internal class MultiViewerSourceUpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/Settings/MultiViewers/MultiViewerVuOpacityCommandTests.cs b/AtemSharp.Tests/Commands/Settings/MultiViewers/MultiViewerVuOpacityCommandTests.cs index a970656..227a746 100644 --- a/AtemSharp.Tests/Commands/Settings/MultiViewers/MultiViewerVuOpacityCommandTests.cs +++ b/AtemSharp.Tests/Commands/Settings/MultiViewers/MultiViewerVuOpacityCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.Settings.MultiViewers; [TestFixture] -public class MultiViewerVuOpacityCommandTests : SerializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/Settings/MultiViewers/MultiViewerVuOpacityUpdateCommandTests.cs b/AtemSharp.Tests/Commands/Settings/MultiViewers/MultiViewerVuOpacityUpdateCommandTests.cs index 18bfd42..c3742ec 100644 --- a/AtemSharp.Tests/Commands/Settings/MultiViewers/MultiViewerVuOpacityUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/Settings/MultiViewers/MultiViewerVuOpacityUpdateCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.Settings.MultiViewers; [TestFixture] -internal class MultiViewerVuOpacityUpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/Settings/MultiViewers/MultiViewerWindowSafeAreaCommandTests.cs b/AtemSharp.Tests/Commands/Settings/MultiViewers/MultiViewerWindowSafeAreaCommandTests.cs index 202aac9..1dd504b 100644 --- a/AtemSharp.Tests/Commands/Settings/MultiViewers/MultiViewerWindowSafeAreaCommandTests.cs +++ b/AtemSharp.Tests/Commands/Settings/MultiViewers/MultiViewerWindowSafeAreaCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.Settings.MultiViewers; [TestFixture] -public class MultiViewerWindowSafeAreaCommandTests : SerializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/Settings/MultiViewers/MultiViewerWindowSafeAreaUpdateCommandTests.cs b/AtemSharp.Tests/Commands/Settings/MultiViewers/MultiViewerWindowSafeAreaUpdateCommandTests.cs index 9821ae2..d3f4ede 100644 --- a/AtemSharp.Tests/Commands/Settings/MultiViewers/MultiViewerWindowSafeAreaUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/Settings/MultiViewers/MultiViewerWindowSafeAreaUpdateCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.Settings.MultiViewers; [TestFixture] -internal class MultiViewerWindowSafeAreaUpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/Settings/MultiViewers/MultiViewerWindowVuMeterCommandTests.cs b/AtemSharp.Tests/Commands/Settings/MultiViewers/MultiViewerWindowVuMeterCommandTests.cs index 9ccd053..9763303 100644 --- a/AtemSharp.Tests/Commands/Settings/MultiViewers/MultiViewerWindowVuMeterCommandTests.cs +++ b/AtemSharp.Tests/Commands/Settings/MultiViewers/MultiViewerWindowVuMeterCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.Settings.MultiViewers; [TestFixture] -public class MultiViewerWindowVuMeterCommandTests : SerializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/Settings/MultiViewers/MultiViewerWindowVuMeterUpdateCommandTests.cs b/AtemSharp.Tests/Commands/Settings/MultiViewers/MultiViewerWindowVuMeterUpdateCommandTests.cs index 793a4f2..f754fdb 100644 --- a/AtemSharp.Tests/Commands/Settings/MultiViewers/MultiViewerWindowVuMeterUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/Settings/MultiViewers/MultiViewerWindowVuMeterUpdateCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.Settings.MultiViewers; [TestFixture] -internal class MultiViewerWindowVuMeterUpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/Settings/TimeConfigCommandTests.cs b/AtemSharp.Tests/Commands/Settings/TimeConfigCommandTests.cs index 0c6f769..370959b 100644 --- a/AtemSharp.Tests/Commands/Settings/TimeConfigCommandTests.cs +++ b/AtemSharp.Tests/Commands/Settings/TimeConfigCommandTests.cs @@ -5,7 +5,7 @@ namespace AtemSharp.Tests.Commands.Settings; [TestFixture] -public class TimeConfigCommandTests : SerializedCommandTestBase +public class TimeConfigCommandTests : TypeScriptLibrarySerializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/Settings/TimeConfigUpdateCommandTests.cs b/AtemSharp.Tests/Commands/Settings/TimeConfigUpdateCommandTests.cs index 4c25cba..0876ad9 100644 --- a/AtemSharp.Tests/Commands/Settings/TimeConfigUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/Settings/TimeConfigUpdateCommandTests.cs @@ -5,7 +5,7 @@ namespace AtemSharp.Tests.Commands.Settings; [TestFixture] -internal class TimeConfigUpdateCommandTests : DeserializedCommandTestBase +internal class TimeConfigUpdateCommandTests : TypeScriptLibraryDeserializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/Settings/VideoModeCommandTests.cs b/AtemSharp.Tests/Commands/Settings/VideoModeCommandTests.cs index b6732e6..c62cbf2 100644 --- a/AtemSharp.Tests/Commands/Settings/VideoModeCommandTests.cs +++ b/AtemSharp.Tests/Commands/Settings/VideoModeCommandTests.cs @@ -10,7 +10,7 @@ namespace AtemSharp.Tests.Commands.Settings; /// All test cases have Mode=N525i5994NTSC but expect different byte outputs. /// [TestFixture] -public class VideoModeCommandTests : SerializedCommandTestBase +public class VideoModeCommandTests : TypeScriptLibrarySerializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/Settings/VideoModeUpdateCommandTests.cs b/AtemSharp.Tests/Commands/Settings/VideoModeUpdateCommandTests.cs index 9624c3f..684636e 100644 --- a/AtemSharp.Tests/Commands/Settings/VideoModeUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/Settings/VideoModeUpdateCommandTests.cs @@ -10,7 +10,7 @@ namespace AtemSharp.Tests.Commands.Settings; /// All test cases have Mode=N525i5994NTSC but expect different byte inputs. /// [TestFixture] -internal class VideoModeUpdateCommandTests : DeserializedCommandTestBase +internal class VideoModeUpdateCommandTests : TypeScriptLibraryDeserializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/StartupStateClearCommandTests.cs b/AtemSharp.Tests/Commands/StartupStateClearCommandTests.cs index 1ccf96f..dc17048 100644 --- a/AtemSharp.Tests/Commands/StartupStateClearCommandTests.cs +++ b/AtemSharp.Tests/Commands/StartupStateClearCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands; [TestFixture] -public class StartupStateClearCommandTests : SerializedCommandTestBase +public class StartupStateClearCommandTests : TypeScriptLibrarySerializedCommandTestBase { public class CommandData : CommandDataBase; diff --git a/AtemSharp.Tests/Commands/StartupStateSaveCommandTests.cs b/AtemSharp.Tests/Commands/StartupStateSaveCommandTests.cs index 938c234..4c35bd9 100644 --- a/AtemSharp.Tests/Commands/StartupStateSaveCommandTests.cs +++ b/AtemSharp.Tests/Commands/StartupStateSaveCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands; [TestFixture] -public class StartupStateSaveCommandTests : SerializedCommandTestBase +public class StartupStateSaveCommandTests : TypeScriptLibrarySerializedCommandTestBase { public class CommandData : CommandDataBase {} diff --git a/AtemSharp.Tests/Commands/Streaming/StreamingAudioBitratesCommandTests.cs b/AtemSharp.Tests/Commands/Streaming/StreamingAudioBitratesCommandTests.cs index 82acc6f..4cc76c7 100644 --- a/AtemSharp.Tests/Commands/Streaming/StreamingAudioBitratesCommandTests.cs +++ b/AtemSharp.Tests/Commands/Streaming/StreamingAudioBitratesCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.Streaming; -public class StreamingAudioBitratesCommandTests : SerializedCommandTestBase +public class StreamingAudioBitratesCommandTests : TypeScriptLibrarySerializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/Streaming/StreamingAudioBitratesUpdateCommandTests.cs b/AtemSharp.Tests/Commands/Streaming/StreamingAudioBitratesUpdateCommandTests.cs index 9c5e80e..c1e85f0 100644 --- a/AtemSharp.Tests/Commands/Streaming/StreamingAudioBitratesUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/Streaming/StreamingAudioBitratesUpdateCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.Streaming; -internal class StreamingAudioBitratesUpdateCommandTests : DeserializedCommandTestBase +internal class StreamingAudioBitratesUpdateCommandTests : TypeScriptLibraryDeserializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/Streaming/StreamingDurationUpdateCommandTests.cs b/AtemSharp.Tests/Commands/Streaming/StreamingDurationUpdateCommandTests.cs index 48afd52..1679184 100644 --- a/AtemSharp.Tests/Commands/Streaming/StreamingDurationUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/Streaming/StreamingDurationUpdateCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.Streaming; -internal class StreamingDurationUpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/Streaming/StreamingServiceCommandTests.cs b/AtemSharp.Tests/Commands/Streaming/StreamingServiceCommandTests.cs index 307c9d1..cdab61c 100644 --- a/AtemSharp.Tests/Commands/Streaming/StreamingServiceCommandTests.cs +++ b/AtemSharp.Tests/Commands/Streaming/StreamingServiceCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.Streaming; -public class StreamingServiceCommandTests : SerializedCommandTestBase +public class StreamingServiceCommandTests : TypeScriptLibrarySerializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/Streaming/StreamingServiceUpdateCommandTests.cs b/AtemSharp.Tests/Commands/Streaming/StreamingServiceUpdateCommandTests.cs index ff93342..5d98e5e 100644 --- a/AtemSharp.Tests/Commands/Streaming/StreamingServiceUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/Streaming/StreamingServiceUpdateCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.Streaming; -internal class StreamingServiceUpdateCommandTests : DeserializedCommandTestBase +internal class StreamingServiceUpdateCommandTests : TypeScriptLibraryDeserializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/Streaming/StreamingStatsUpdateCommandTests.cs b/AtemSharp.Tests/Commands/Streaming/StreamingStatsUpdateCommandTests.cs index 5a83ef1..7aba2e1 100644 --- a/AtemSharp.Tests/Commands/Streaming/StreamingStatsUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/Streaming/StreamingStatsUpdateCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.Streaming; -internal class StreamingStatsUpdateCommandTests : DeserializedCommandTestBase +internal class StreamingStatsUpdateCommandTests : TypeScriptLibraryDeserializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/Streaming/StreamingStatusCommandTests.cs b/AtemSharp.Tests/Commands/Streaming/StreamingStatusCommandTests.cs index 219c093..c39e8d0 100644 --- a/AtemSharp.Tests/Commands/Streaming/StreamingStatusCommandTests.cs +++ b/AtemSharp.Tests/Commands/Streaming/StreamingStatusCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.Streaming; -public class StreamingStatusCommandTests : SerializedCommandTestBase +public class StreamingStatusCommandTests : TypeScriptLibrarySerializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/Streaming/StreamingStatusUpdateCommandTests.cs b/AtemSharp.Tests/Commands/Streaming/StreamingStatusUpdateCommandTests.cs index efcd32b..4a878b9 100644 --- a/AtemSharp.Tests/Commands/Streaming/StreamingStatusUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/Streaming/StreamingStatusUpdateCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.Streaming; -internal class StreamingStatusUpdateCommandTests : DeserializedCommandTestBase +internal class StreamingStatusUpdateCommandTests : TypeScriptLibraryDeserializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/SuperSource/SuperSourceBorderCommandTests.cs b/AtemSharp.Tests/Commands/SuperSource/SuperSourceBorderCommandTests.cs index 642da90..af252ed 100644 --- a/AtemSharp.Tests/Commands/SuperSource/SuperSourceBorderCommandTests.cs +++ b/AtemSharp.Tests/Commands/SuperSource/SuperSourceBorderCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.SuperSource; -public class SuperSourceBorderCommandTests : SerializedCommandTestBase +public class SuperSourceBorderCommandTests : TypeScriptLibrarySerializedCommandTestBase { protected override Range[] GetFloatingPointByteRanges() => [ diff --git a/AtemSharp.Tests/Commands/SuperSource/SuperSourceBorderUpdateCommandTests.cs b/AtemSharp.Tests/Commands/SuperSource/SuperSourceBorderUpdateCommandTests.cs index 414f78b..a85adce 100644 --- a/AtemSharp.Tests/Commands/SuperSource/SuperSourceBorderUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/SuperSource/SuperSourceBorderUpdateCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.SuperSource; -internal class SuperSourceBorderUpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/SuperSource/SuperSourceBoxParametersCommandTests.cs b/AtemSharp.Tests/Commands/SuperSource/SuperSourceBoxParametersCommandTests.cs index 47ef1f8..21beb2f 100644 --- a/AtemSharp.Tests/Commands/SuperSource/SuperSourceBoxParametersCommandTests.cs +++ b/AtemSharp.Tests/Commands/SuperSource/SuperSourceBoxParametersCommandTests.cs @@ -6,7 +6,7 @@ namespace AtemSharp.Tests.Commands.SuperSource; -public class SuperSourceBoxParametersCommandTests : SerializedCommandTestBase +public class SuperSourceBoxParametersCommandTests : TypeScriptLibrarySerializedCommandTestBase { // Mark all as floating point as it's version dependent where the floating points are protected override Range[] GetFloatingPointByteRanges() => [ diff --git a/AtemSharp.Tests/Commands/SuperSource/SuperSourceBoxParametersUpdateCommandTests.cs b/AtemSharp.Tests/Commands/SuperSource/SuperSourceBoxParametersUpdateCommandTests.cs index 2c9a9fe..fea8fa7 100644 --- a/AtemSharp.Tests/Commands/SuperSource/SuperSourceBoxParametersUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/SuperSource/SuperSourceBoxParametersUpdateCommandTests.cs @@ -5,7 +5,7 @@ namespace AtemSharp.Tests.Commands.SuperSource; -internal class SuperSourceBoxParametersUpdateCommandTests : DeserializedCommandTestBase { [MaxProtocolVersion(ProtocolVersion.V7_5_2)] diff --git a/AtemSharp.Tests/Commands/SuperSource/SuperSourceBoxParametersUpdateCommandV8Tests.cs b/AtemSharp.Tests/Commands/SuperSource/SuperSourceBoxParametersUpdateCommandV8Tests.cs index 9476043..a7a7eb0 100644 --- a/AtemSharp.Tests/Commands/SuperSource/SuperSourceBoxParametersUpdateCommandV8Tests.cs +++ b/AtemSharp.Tests/Commands/SuperSource/SuperSourceBoxParametersUpdateCommandV8Tests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.SuperSource; -internal class SuperSourceBoxParametersUpdateCommandV8Tests : DeserializedCommandTestBase +internal class SuperSourceBoxParametersUpdateCommandV8Tests : TypeScriptLibraryDeserializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/SuperSource/SuperSourceBoxParametersV8CommandTests.cs b/AtemSharp.Tests/Commands/SuperSource/SuperSourceBoxParametersV8CommandTests.cs index 42a3995..d84efa4 100644 --- a/AtemSharp.Tests/Commands/SuperSource/SuperSourceBoxParametersV8CommandTests.cs +++ b/AtemSharp.Tests/Commands/SuperSource/SuperSourceBoxParametersV8CommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.SuperSource; -public class SuperSourceBoxParametersV8CommandTests : SerializedCommandTestBase +public class SuperSourceBoxParametersV8CommandTests : TypeScriptLibrarySerializedCommandTestBase { // Mark all as floating point as it's version dependent where the floating points are protected override Range[] GetFloatingPointByteRanges() => [ diff --git a/AtemSharp.Tests/Commands/SuperSource/SuperSourcePropertiesCommandTests.cs b/AtemSharp.Tests/Commands/SuperSource/SuperSourcePropertiesCommandTests.cs index 0895663..ba0a241 100644 --- a/AtemSharp.Tests/Commands/SuperSource/SuperSourcePropertiesCommandTests.cs +++ b/AtemSharp.Tests/Commands/SuperSource/SuperSourcePropertiesCommandTests.cs @@ -7,7 +7,7 @@ namespace AtemSharp.Tests.Commands.SuperSource; -public class SuperSourcePropertiesCommandTests : SerializedCommandTestBase { protected override Range[] GetFloatingPointByteRanges() => diff --git a/AtemSharp.Tests/Commands/SuperSource/SuperSourcePropertiesUpdateCommandTests.cs b/AtemSharp.Tests/Commands/SuperSource/SuperSourcePropertiesUpdateCommandTests.cs index 3c2a7df..4187e52 100644 --- a/AtemSharp.Tests/Commands/SuperSource/SuperSourcePropertiesUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/SuperSource/SuperSourcePropertiesUpdateCommandTests.cs @@ -7,7 +7,7 @@ namespace AtemSharp.Tests.Commands.SuperSource; -internal class SuperSourcePropertiesUpdateCommandTests : DeserializedCommandTestBase { [MaxProtocolVersion(ProtocolVersion.V7_5_2)] diff --git a/AtemSharp.Tests/Commands/SuperSource/SuperSourcePropertiesUpdateV8CommandTests.cs b/AtemSharp.Tests/Commands/SuperSource/SuperSourcePropertiesUpdateV8CommandTests.cs index 73a5e2b..98cf497 100644 --- a/AtemSharp.Tests/Commands/SuperSource/SuperSourcePropertiesUpdateV8CommandTests.cs +++ b/AtemSharp.Tests/Commands/SuperSource/SuperSourcePropertiesUpdateV8CommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.SuperSource; -internal class SuperSourcePropertiesUpdateV8CommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/SuperSource/SuperSourcePropertiesV8CommandTests.cs b/AtemSharp.Tests/Commands/SuperSource/SuperSourcePropertiesV8CommandTests.cs index aaf681d..ecd7d17 100644 --- a/AtemSharp.Tests/Commands/SuperSource/SuperSourcePropertiesV8CommandTests.cs +++ b/AtemSharp.Tests/Commands/SuperSource/SuperSourcePropertiesV8CommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands.SuperSource; -public class SuperSourcePropertiesV8CommandTests : SerializedCommandTestBase { protected override Range[] GetFloatingPointByteRanges() => diff --git a/AtemSharp.Tests/Commands/TimeCommandTests.cs b/AtemSharp.Tests/Commands/TimeCommandTests.cs index 353babe..769756c 100644 --- a/AtemSharp.Tests/Commands/TimeCommandTests.cs +++ b/AtemSharp.Tests/Commands/TimeCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands; -public class TimeCommandTests : SerializedCommandTestBase +public class TimeCommandTests : TypeScriptLibrarySerializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/TimeUpdateCommandTests.cs b/AtemSharp.Tests/Commands/TimeUpdateCommandTests.cs index 9b256e2..494686d 100644 --- a/AtemSharp.Tests/Commands/TimeUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/TimeUpdateCommandTests.cs @@ -3,7 +3,7 @@ namespace AtemSharp.Tests.Commands; -internal class TimeUpdateCommandTests : DeserializedCommandTestBase +internal class TimeUpdateCommandTests : TypeScriptLibraryDeserializedCommandTestBase { public class CommandData : CommandDataBase { diff --git a/AtemSharp.Tests/Commands/DeserializedCommandTestBase.cs b/AtemSharp.Tests/Commands/TypeScriptLibraryDeserializedCommandTestBase.cs similarity index 92% rename from AtemSharp.Tests/Commands/DeserializedCommandTestBase.cs rename to AtemSharp.Tests/Commands/TypeScriptLibraryDeserializedCommandTestBase.cs index 8018390..4da3dbe 100644 --- a/AtemSharp.Tests/Commands/DeserializedCommandTestBase.cs +++ b/AtemSharp.Tests/Commands/TypeScriptLibraryDeserializedCommandTestBase.cs @@ -4,16 +4,15 @@ using AtemSharp.State; using AtemSharp.State.Info; using AtemSharp.State.Macro; -using AtemSharp.Tests.TestUtilities.CommandTests; using JetBrains.Annotations; using Newtonsoft.Json; using NSubstitute; namespace AtemSharp.Tests.Commands; -internal abstract class DeserializedCommandTestBase +internal abstract class TypeScriptLibraryDeserializedCommandTestBase where TCommand : IDeserializedCommand - where TTestData : DeserializedCommandTestBase.CommandDataBase, new() + where TTestData : TypeScriptLibraryDeserializedCommandTestBase.CommandDataBase, new() { private class TestStateHolder : IStateHolder { @@ -36,7 +35,7 @@ public abstract class CommandDataBase : TestUtilities.CommandTests.CommandDataBa public static IEnumerable GetTestCases() { - var testCases = Helper.GetTestCases().ToArray(); + var testCases = TestUtilities.CommandTests.LibAtemTestCases.Helper.GetTestCases().ToArray(); Assert.That(testCases.Length, Is.GreaterThan(0), "No test cases found"); return testCases; } diff --git a/AtemSharp.Tests/Commands/TypeScriptLibrarySerializedCommandTestBase.cs b/AtemSharp.Tests/Commands/TypeScriptLibrarySerializedCommandTestBase.cs new file mode 100644 index 0000000..0b75692 --- /dev/null +++ b/AtemSharp.Tests/Commands/TypeScriptLibrarySerializedCommandTestBase.cs @@ -0,0 +1,105 @@ +using AtemSharp.Commands; +using AtemSharp.Tests.Batch; +using AtemSharp.Tests.TestUtilities.CommandTests; +using JetBrains.Annotations; +using Newtonsoft.Json; + +namespace AtemSharp.Tests.Commands; + +public abstract class TypeScriptLibrarySerializedCommandTestBase + where TCommand : SerializedCommand + where TTestData : TypeScriptLibrarySerializedCommandTestBase.CommandDataBase, new() +{ + /// + /// Override to specify which byte ranges contain floating-point encoded data + /// that should be compared with tolerance for precision differences + /// + protected virtual Range[] GetFloatingPointByteRanges() + { + return []; + } + + [UsedImplicitly(ImplicitUseTargetFlags.WithInheritors | ImplicitUseTargetFlags.WithMembers)] + public abstract class CommandDataBase : TestUtilities.CommandTests.CommandDataBase + { + public uint Mask { get; set; } + } + + public static IEnumerable GetTestCases() + { + var testCases = TestUtilities.CommandTests.LibAtemTestCases.Helper.GetTestCases().ToArray(); + Assert.That(testCases.Length, Is.GreaterThan(0), "No test cases found"); + return testCases; + } + + public static TestCaseData CreateMergingTestCase( + string propertyName, + TValue firstValue, + TValue secondValue) + { + return new TestCaseData(propertyName, firstValue, secondValue).SetName(propertyName); + } + + public void TestPropertyMerging( + Func factory, + string propertyName, + TValue firstValue, + TValue secondValue) + { + var first = factory(); + var second = factory(); + + var getter = typeof(TCommand).GetProperty(propertyName)?.GetMethod ?? throw new InvalidOperationException($"No getter for property {typeof(TCommand)}.{propertyName} found"); + var setter = typeof(TCommand).GetProperty(propertyName)?.SetMethod ?? throw new InvalidOperationException($"No setter for property {typeof(TCommand)}.{propertyName} found"); + + setter.Invoke(first, [firstValue]); + setter.Invoke(second, [secondValue]); + + Assert.That(second.TryMergeTo(first), Is.True); + Assert.That(getter.Invoke(first, []), Is.EqualTo(secondValue)); + } + + public void TestPropertyNonMerging( + Func factory, + string propertyName, + TValue firstValue, + TValue secondValue) + { + var first = factory(); + var second = factory(); + + var getter = typeof(TCommand).GetProperty(propertyName)?.GetMethod ?? throw new InvalidOperationException($"No getter for property {typeof(TCommand)}.{propertyName} found"); + var setter = typeof(TCommand).GetProperty(propertyName)?.SetMethod ?? throw new InvalidOperationException($"No setter for property {typeof(TCommand)}.{propertyName} found"); + + setter.Invoke(first, [firstValue]); + + Assert.That(second.TryMergeTo(first), Is.True); + Assert.That(getter.Invoke(first, []), Is.EqualTo(firstValue)); + } + + public void TestPropertyMerging_WithWrongType(Func factory) + { + Assert.That(factory().TryMergeTo(new MergeableCommand(2)), Is.False); + } + + [Test, TestCaseSource(nameof(GetTestCases))] + public void TestSerialization(TestUtilities.CommandTests.TestCaseData testCase) + { + if (testCase.Command.UnknownProperties.Count != 0) + { + Assert.Fail("Unprocessed test data:\n" + JsonConvert.SerializeObject(testCase.Command.UnknownProperties)); + } + + var expectedPayload = testCase.Payload; + + var command = CreateSut(testCase); + command.Flag = testCase.Command.Mask; + + // Act + var actualPayload = command.Serialize(testCase.FirstVersion); + + Helper.CompareSerializedBytes(actualPayload, expectedPayload, GetFloatingPointByteRanges()); + } + + protected abstract TCommand CreateSut(TestUtilities.CommandTests.TestCaseData testCase); +} diff --git a/AtemSharp.Tests/Commands/Video/AuxSourceCommandTests.cs b/AtemSharp.Tests/Commands/Video/AuxSourceCommandTests.cs index 224dd83..16dd9bd 100644 --- a/AtemSharp.Tests/Commands/Video/AuxSourceCommandTests.cs +++ b/AtemSharp.Tests/Commands/Video/AuxSourceCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.Video; [TestFixture] -public class AuxSourceCommandTests : SerializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/Commands/Video/AuxSourceUpdateCommandTests.cs b/AtemSharp.Tests/Commands/Video/AuxSourceUpdateCommandTests.cs index 1e2144d..646a17b 100644 --- a/AtemSharp.Tests/Commands/Video/AuxSourceUpdateCommandTests.cs +++ b/AtemSharp.Tests/Commands/Video/AuxSourceUpdateCommandTests.cs @@ -4,7 +4,7 @@ namespace AtemSharp.Tests.Commands.Video; [TestFixture] -internal class AuxSourceUpdateCommandTests : DeserializedCommandTestBase { public class CommandData : CommandDataBase diff --git a/AtemSharp.Tests/TestData/atem-mini-iso-pro.json b/AtemSharp.Tests/TestData/atem-mini-iso-pro.json index 1041123..9931183 100644 --- a/AtemSharp.Tests/TestData/atem-mini-iso-pro.json +++ b/AtemSharp.Tests/TestData/atem-mini-iso-pro.json @@ -1,15 +1,130 @@ { "$comment": "This test data has been captured with Wireshark from my ATEM Mini Pro ISO", "commands": { - "DUMMY": [ + "MSRc": [ { - "name": "A display name for the test case to show in the test list", - "Payload": "00-00-00-00", - "Command": { - "some": "command", - "data": 4 + "Name": "Record Macro #5", + "Payload": "00-05-00-09-00-13-4E-65-77-20-4D-61-63-72-6F-54-68-69-73-20-69-73-20-61-20-6E-65-77-20-4D-61-63-72-6F-00-00", + "ProtocolVersion": "Unknown", + "CommandCreationParameters": { + "MacroId": 5 + }, + "Changes": { + "Name": "New Macro", + "Description": "This is a new Macro" } } + ], + "MAct": [ + { + "Name": "Delete Macro #0", + "Payload": "00-00-05-00", + "CommandCreationParameters": { + "MacroId": 0, + "Action": "Delete" + } + }, + { + "Name": "Run Macro #5", + "Payload": "00-05-00-00", + "CommandCreationParameters": { + "MacroId": 5, + "Action": "Run" + } + }, + { + "Name": "Continue", + "Payload": "FF-FF-04-00", + "CommandCreationParameters": { + "Action": "Continue" + } + }, + { + "Name": "Stop", + "Payload": "FF-FF-01-00", + "CommandCreationParameters": { + "Action": "Stop" + } + }, + { + "Name": "Stop Recording", + "Payload": "FF-FF-02-00", + "CommandCreationParameters": { + "Action": "StopRecord" + } + }, + { + "Name": "Insert 'Wait for user'", + "Payload": "FF-FF-03-00", + "CommandCreationParameters": { + "Action": "InsertUserWait" + } + } + ], + "MSlp": [ + { + "Name": "10 frames", + "Payload": "00-00-00-0A", + "Changes": { + "Frames": 10 + } + }, + { + "Name": "25 frames", + "Payload": "00-00-00-19", + "Changes": { + "Frames": 25 + } + } + ], + "CMPr": [ + { + "Name": "Change name", + "Payload": "01-00-00-01-00-08-00-00-4E-65-77-20-4E-61-6D-65", + "CommandCreationParameters": { + "MacroId": 1 + }, + "Changes": { + "Name": "New Name" + } + }, + { + "Name": "Change description", + "Payload": "02-00-00-01-00-00-00-0F-4E-65-77-20-44-65-73-63-72-69-70-74-69-6F-6E-00", + "CommandCreationParameters": { + "MacroId": 1 + }, + "Changes": { + "Description": "New Description" + } + }, + { + "Name": "Change both", + "Payload": "03-00-00-00-00-08-00-0F-4E-65-77-20-4E-61-6D-65-4E-65-77-20-44-65-73-63-72-69-70-74-69-6F-6E-00", + "CommandCreationParameters": { + "MacroId": 0 + }, + "Changes": { + "Name": "New Name", + "Description": "New Description" + } + } + ], + "MRCP": [ + { + "Name": "Enable looping", + "Changes": { + "Loop": true + }, + "Payload": "01-01-00-00" + }, + { + "Name": "Disable looping", + "Changes": { + "Loop": false + }, + "Payload": "01-00-00-00" + } ] } } diff --git a/AtemSharp.Tests/TestUtilities/CommandTests/Helper.cs b/AtemSharp.Tests/TestUtilities/CommandTests/Helper.cs index 3101d57..d817122 100644 --- a/AtemSharp.Tests/TestUtilities/CommandTests/Helper.cs +++ b/AtemSharp.Tests/TestUtilities/CommandTests/Helper.cs @@ -1,3 +1,6 @@ +using System.Reflection; +using AtemSharp.State.Settings; + namespace AtemSharp.Tests.TestUtilities.CommandTests; public static class Helper @@ -10,11 +13,106 @@ public static byte[] ParseHexBytes(string hexString) return hexString.Split('-').Select(hex => Convert.ToByte(hex, 16)).ToArray(); } - public static IEnumerable GetTestCases() where TTestData : CommandDataBase, new() + public static string GetRessource(string resourceName) + { + var assembly = Assembly.GetExecutingAssembly(); + + using var stream = assembly.GetManifestResourceStream(resourceName); + if (stream == null) + { + throw new FileNotFoundException($"Could not find embedded resource: {resourceName}"); + } + + using var reader = new StreamReader(stream); + var json = reader.ReadToEnd(); + return json; + } + + public static void CompareSerializedBytes(byte[] actualPayload, byte[] expectedPayload, Range[] floatingPointRanges) + { + // Check serialized byte stream + Assert.That(actualPayload, Has.Length.EqualTo(expectedPayload.Length)); + + // Step 1: Compare non-float bytes exactly + var actualNonFloatBytes = + string.Join("-", actualPayload.Select((b, i) => IsFloatingPointByte(i, actualPayload.Length, floatingPointRanges) ? "XX" : $"{b:X2}")); + var expectedNonFloatBytes = + string.Join("-", expectedPayload.Select((b, i) => IsFloatingPointByte(i, actualPayload.Length, floatingPointRanges) ? "XX" : $"{b:X2}")); + Assert.That(actualNonFloatBytes, Is.EqualTo(expectedNonFloatBytes)); + + // Then try approximate match for floating-point fields + var actualFloatBytes = + string.Join("-", actualPayload.Select((b, i) => !IsFloatingPointByte(i, actualPayload.Length, floatingPointRanges) ? "XX" : $"{b:X2}")); + var expectedFloatBytes = + string.Join("-", expectedPayload.Select((b, i) => !IsFloatingPointByte(i, actualPayload.Length, floatingPointRanges) ? "XX" : $"{b:X2}")); + if (!AreApproximatelyEqual(actualPayload, expectedPayload, floatingPointRanges)) + { + Assert.Fail($"Float-bytes differ more than 2 units\n" + + $"Expected: {expectedFloatBytes}\n" + + $"Actual: {actualFloatBytes}"); + } + } + + private static bool IsFloatingPointByte(int index, int totalLength, Range[] ranges) + { + foreach (var range in ranges) + { + var (start, length) = range.GetOffsetAndLength(totalLength); + var end = start + length - 1; + if (index >= start && index <= end) + { + return true; + } + } + + return false; + } + + private static bool AreApproximatelyEqual(byte[] actual, byte[] expected, Range[] floatingPointRanges) + { + if (actual.Length != expected.Length) + { + return false; + } + + for (var i = 0; i < actual.Length; i++) + { + var tolerance = IsFloatingPointByte(i, actual.Length, floatingPointRanges) ? 2 : 0; + if (Math.Abs(actual[i] - expected[i]) > tolerance) + { + // Check if its within the tolerance with carry + return !(Math.Abs(actual[i] - expected[i]) < 256 - tolerance); + } + } + + return true; + } + + public static IStateHolder CreateDefaultStateHolder() { - var libAtemTestCases = LibAtemTestCases.Helper.GetTestCases().ToArray(); - var recordedTestCases = RecordedTestCases.Helper.GetTestCases().ToArray(); + var result = new TestStateHolder(); + + var macro = result.Macros.GetOrCreate(0); + macro.UpdateName("First Macro"); + macro.UpdateDescription("First Description"); + macro.UpdateIsUsed(true); + macro.UpdateHasUnsupportedOps(false); + + macro = result.Macros.GetOrCreate(1); + macro.UpdateName("Second Macro"); + macro.UpdateDescription("Second Description"); + macro.UpdateIsUsed(true); + macro.UpdateHasUnsupportedOps(true); + + for (ushort i = 2; i < 100; i++) + { + macro = result.Macros.GetOrCreate(i); + macro.UpdateIsUsed(false); + } + + result.State.Settings.VideoMode = VideoMode.P1080p25; + result.State.Info.MacroPool.MacroCount = 100; - return libAtemTestCases.Concat(recordedTestCases); + return result; } } diff --git a/AtemSharp.Tests/TestUtilities/CommandTests/LibAtemTestCases/Helper.cs b/AtemSharp.Tests/TestUtilities/CommandTests/LibAtemTestCases/Helper.cs index cac6b7b..1745e77 100644 --- a/AtemSharp.Tests/TestUtilities/CommandTests/LibAtemTestCases/Helper.cs +++ b/AtemSharp.Tests/TestUtilities/CommandTests/LibAtemTestCases/Helper.cs @@ -8,18 +8,7 @@ public static class Helper { public static TestCaseData[] LoadTestCases(string commandRawName) where TTestData : CommandDataBase, new() { - // Load the test data file from embedded resources - var assembly = Assembly.GetExecutingAssembly(); - var resourceName = "AtemSharp.Tests.TestData.libatem-data.json"; - - using var stream = assembly.GetManifestResourceStream(resourceName); - if (stream == null) - { - throw new FileNotFoundException($"Could not find embedded resource: {resourceName}"); - } - - using var reader = new StreamReader(stream); - var json = reader.ReadToEnd(); + var json = CommandTests.Helper.GetRessource("AtemSharp.Tests.TestData.libatem-data.json"); var allTestCases = JsonConvert.DeserializeObject(json) ?? []; var commandTestCases = allTestCases.Where(tc => tc.Name == commandRawName).ToArray(); diff --git a/AtemSharp.Tests/TestUtilities/CommandTests/RecordedTestCases/Helper.cs b/AtemSharp.Tests/TestUtilities/CommandTests/RecordedTestCases/Helper.cs deleted file mode 100644 index cc1f57a..0000000 --- a/AtemSharp.Tests/TestUtilities/CommandTests/RecordedTestCases/Helper.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System.Reflection; -using AtemSharp.Attributes; -using Newtonsoft.Json; - -namespace AtemSharp.Tests.TestUtilities.CommandTests.RecordedTestCases; - -public static class Helper -{ - public static IEnumerable GetTestCases() where TTestData : CommandDataBase, new() - { - var commandAttribute = typeof(TCommand).GetCustomAttribute(); - Assert.That(commandAttribute, Is.Not.Null, $"CommandAttribute is required on command class {typeof(TCommand).Name}"); - - var rawName = commandAttribute.RawName; - - var assembly = Assembly.GetExecutingAssembly(); - var resourceName = "AtemSharp.Tests.TestData.atem-mini-iso-pro.json"; - - using var stream = assembly.GetManifestResourceStream(resourceName); - if (stream == null) - { - throw new FileNotFoundException($"Could not find embedded resource: {resourceName}"); - } - - using var reader = new StreamReader(stream); - var json = reader.ReadToEnd(); - var allTestCases = JsonConvert.DeserializeObject(json) ?? new Recordings(); - if (!allTestCases.Commands.TryGetValue(rawName, out var cases)) - { - yield break; - } - - foreach (var c in cases) - { - var testCase = new TestCaseData - { - Command = c.Command.ToObject()!, - Payload = CommandTests.Helper.ParseHexBytes(c.Payload), - Json = c.Command.ToString() - }; - - yield return new TestCaseData(testCase).SetName(c.Name); - } - } - -} diff --git a/AtemSharp.Tests/TestUtilities/CommandTests/RecordedTestCases/PartialTestCase.cs b/AtemSharp.Tests/TestUtilities/CommandTests/RecordedTestCases/PartialTestCase.cs deleted file mode 100644 index ca0e4b4..0000000 --- a/AtemSharp.Tests/TestUtilities/CommandTests/RecordedTestCases/PartialTestCase.cs +++ /dev/null @@ -1,23 +0,0 @@ -using JetBrains.Annotations; -using Newtonsoft.Json.Linq; - -namespace AtemSharp.Tests.TestUtilities.CommandTests.RecordedTestCases; - -[UsedImplicitly] -public class PartialTestCase -{ - /// - /// The name of the test case - /// - public string Name { get; set; } = string.Empty; - - /// - /// The payload of the command - /// - public string Payload { get; set; } = string.Empty; - - /// - /// The actual command data - /// - public JToken Command { get; set; } = new JObject(); -} diff --git a/AtemSharp.Tests/TestUtilities/CommandTests/RecordedTestCases/RecordedTestCase.cs b/AtemSharp.Tests/TestUtilities/CommandTests/RecordedTestCases/RecordedTestCase.cs new file mode 100644 index 0000000..0a381a3 --- /dev/null +++ b/AtemSharp.Tests/TestUtilities/CommandTests/RecordedTestCases/RecordedTestCase.cs @@ -0,0 +1,22 @@ +using Argon; +using AtemSharp.State.Info; + +namespace AtemSharp.Tests.TestUtilities.CommandTests.RecordedTestCases; + +public class RecordedTestCase +{ + public string Name { get; set; } = string.Empty; + public JObject? Changes { get; set; } + + public JObject? CommandCreationParameters { get; set; } + + public string Payload { get; set; } = string.Empty; + public ProtocolVersion Version { get; set; } = ProtocolVersion.Unknown; + + public static IEnumerable GetRecordedTestCases(string rawName) + { + var json = Helper.GetRessource("AtemSharp.Tests.TestData.atem-mini-iso-pro.json"); + var allCases = JsonConvert.DeserializeObject>(json)["commands"].ToObject>() ?? []; + return !allCases.TryGetValue(rawName, out var testCases) ? Enumerable.Empty() : testCases; + } +} diff --git a/AtemSharp.Tests/TestUtilities/CommandTests/RecordedTestCases/Recordings.cs b/AtemSharp.Tests/TestUtilities/CommandTests/RecordedTestCases/Recordings.cs deleted file mode 100644 index 4f5cf45..0000000 --- a/AtemSharp.Tests/TestUtilities/CommandTests/RecordedTestCases/Recordings.cs +++ /dev/null @@ -1,7 +0,0 @@ - -namespace AtemSharp.Tests.TestUtilities.CommandTests.RecordedTestCases; - -public class Recordings -{ - public Dictionary Commands { get; set; } = new(); -} diff --git a/AtemSharp.sln b/AtemSharp.sln index 5090fd7..9f794ea 100644 --- a/AtemSharp.sln +++ b/AtemSharp.sln @@ -26,6 +26,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GitHub", "GitHub", "{2EF9AD EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PacketDecoder", "PacketDecoder\PacketDecoder.csproj", "{4ED09CC2-7DB8-4A91-AECF-EF762349AE9C}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AtemSharp.Json", "AtemSharp.Json\AtemSharp.Json.csproj", "{FD82C729-B921-40BC-BC44-FE378A09C100}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -60,5 +62,9 @@ Global {4ED09CC2-7DB8-4A91-AECF-EF762349AE9C}.Debug|Any CPU.Build.0 = Debug|Any CPU {4ED09CC2-7DB8-4A91-AECF-EF762349AE9C}.Release|Any CPU.ActiveCfg = Release|Any CPU {4ED09CC2-7DB8-4A91-AECF-EF762349AE9C}.Release|Any CPU.Build.0 = Release|Any CPU + {FD82C729-B921-40BC-BC44-FE378A09C100}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FD82C729-B921-40BC-BC44-FE378A09C100}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FD82C729-B921-40BC-BC44-FE378A09C100}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FD82C729-B921-40BC-BC44-FE378A09C100}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection EndGlobal diff --git a/AtemSharp/AtemSharp.csproj b/AtemSharp/AtemSharp.csproj index 04f1cb6..e39ca39 100644 --- a/AtemSharp/AtemSharp.csproj +++ b/AtemSharp/AtemSharp.csproj @@ -5,6 +5,9 @@ enable enable true + + + AtemSharp Markus Palcer C# library for connecting with ATEM switchers diff --git a/AtemSharp/Commands/Macro/MacroAddTimedPauseCommand.cs b/AtemSharp/Commands/Macro/MacroAddTimedPauseCommand.cs index b59a4d5..21ac14b 100644 --- a/AtemSharp/Commands/Macro/MacroAddTimedPauseCommand.cs +++ b/AtemSharp/Commands/Macro/MacroAddTimedPauseCommand.cs @@ -10,13 +10,5 @@ public partial class MacroAddTimedPauseCommand : SerializedCommand [SerializedField(2)] private ushort _frames; internal override bool TryMergeTo(SerializedCommand other) - { - if (other is not MacroAddTimedPauseCommand target) - { - return false; - } - - target.Frames += Frames; - return true; - } + => false; } diff --git a/AtemSharp/Commands/Macro/MacroPropertiesCommand.cs b/AtemSharp/Commands/Macro/MacroPropertiesCommand.cs index 86218e0..df83d65 100644 --- a/AtemSharp/Commands/Macro/MacroPropertiesCommand.cs +++ b/AtemSharp/Commands/Macro/MacroPropertiesCommand.cs @@ -5,6 +5,10 @@ namespace AtemSharp.Commands.Macro; /// /// Used to change the name and description of a macro after recording it /// +/// +/// ATEM Control Software updates name and description by sending one command for each, +/// but I verified that you can send it with both at the same time, too. +/// // This class needs to be serialized manually, because the buffer size is // dynamic which is not supported by code generation [Command("CMPr")] @@ -43,13 +47,24 @@ public string Description /// public override byte[] Serialize(ProtocolVersion version) { - var buffer = new byte[SerializationExtensions.PadToMultiple(8 + _name.Length + _description.Length, 4)]; + var nameLength = _nameIsDirty ? _name.Length : 0; + var descriptionLength = _descriptionIsDirty ? _description.Length : 0; + + var buffer = new byte[SerializationExtensions.PadToMultiple(8 + nameLength + descriptionLength, 4)]; buffer.WriteUInt8((byte)Flag, 0); buffer.WriteUInt16BigEndian(_id, 2); - buffer.WriteUInt16BigEndian((ushort)_name.Length, 4); - buffer.WriteUInt16BigEndian((ushort)_description.Length, 6); - buffer.WriteString(_name, 8); - buffer.WriteString(_description, 8 + _name.Length); + buffer.WriteUInt16BigEndian((ushort)nameLength, 4); + buffer.WriteUInt16BigEndian((ushort)descriptionLength, 6); + + if (_nameIsDirty) + { + buffer.WriteString(_name, 8); + } + + if (_descriptionIsDirty) + { + buffer.WriteString(_description, 8 + nameLength); + } return buffer; } diff --git a/AtemSharp/Types/ItemCollection.cs b/AtemSharp/Types/ItemCollection.cs index 01d1643..327b5fa 100644 --- a/AtemSharp/Types/ItemCollection.cs +++ b/AtemSharp/Types/ItemCollection.cs @@ -87,4 +87,6 @@ public void Remove(TId id) { _items.Remove(id); } + + public IReadOnlyDictionary AsReadOnly() => _items.AsReadOnly(); } diff --git a/Run-Coverage.ps1 b/Run-Coverage.ps1 index 3f2d775..8da0941 100644 --- a/Run-Coverage.ps1 +++ b/Run-Coverage.ps1 @@ -1,3 +1,7 @@ +param ( + [switch]$openhtml = $false +) + # Remove old reports Get-ChildItem -Path . -Recurse -Filter coverage.cobertura.xml | Remove-Item @@ -30,8 +34,13 @@ dotnet tool restore dotnet tool run reportgenerator ` -reports:$reportsArg ` "-targetdir:$targetDir" ` - "-filefilters:-*.g.cs" ` - "-reporttypes:$reportType" + "-reporttypes:$reportType" ` + "-filefilters:-*.g.cs" + +New-Item -Path "$targetDir" -Name ".gitignore" -ItemType "File" -Value "*" -Force | Out-Null +Write-Host "Coverage report written to $((Get-Item .).FullName)\coverage-report\index.html" -New-Item -Path "$targetDir" -Name ".gitignore" -ItemType "File" -Value "*" -Force -Write-Host "Coverage report written to coverage-report\index.html" +# Open the HTML report automatically (Windows) +if ($openhtml) { + Start-Process "coverage-report\index.html" +}