Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tests] Every Tests in own projects #508

Merged
merged 4 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions src/DCS-BIOS.Tests/DCS-BIOS.Tests.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0-windows</TargetFramework>
<RootNamespace>DCS_BIOS.Tests</RootNamespace>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>disable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ExpectedObjects" Version="3.5.4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="8.0.0" />
<PackageReference Include="xunit" Version="2.7.0" />
<PackageReference Include="xunit.runner.console" Version="2.7.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\DCSFPCommon\src\DCS-BIOS\DCS-BIOS.csproj" />
<ProjectReference Include="..\Tests.Common\Tests.Common.csproj" />
</ItemGroup>

</Project>
16 changes: 16 additions & 0 deletions src/DCS-BIOS.Tests/Serialization/Common/JSonSettings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using Newtonsoft.Json;

namespace DCS_BIOS.Tests.Serialization.Common {
internal static class JSonSettings
{
public static JsonSerializerSettings JsonDefaultSettings = new()
{
TypeNameHandling = TypeNameHandling.All,
ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
Error = (sender, args) =>
{
throw new System.Exception($"JSON Serialization Error.{args.ErrorContext.Error.Message}");
}
};
}
}
10 changes: 10 additions & 0 deletions src/DCS-BIOS.Tests/Serialization/Common/RepositorySerialized.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System;
using Tests.Common;

namespace DCS_BIOS.Tests.Serialization.Common {
internal class RepositorySerialized : RepositorySerializedBase
{
public RepositorySerialized() : base(@"Serialization\Resources", "DCS-BIOS.Tests") {
}
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using DCS_BIOS.Serialized;
using DCSFP.Tests.Serialization.Common;
using Newtonsoft.Json;
using DCS_BIOS.Tests.Serialization.Common;
using Tests.Common;
using Xunit;

namespace DCSFP.Tests.Serialization
{
namespace DCS_BIOS.Tests.Serialization {

/// <summary>
/// Note: SelectedArgumentValue is private set but should reflect the last value passed to one of the 'Specifiedfields*'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using DCS_BIOS.Serialized;
using DCSFP.Tests.Serialization.Common;
using Newtonsoft.Json;
using DCS_BIOS.Tests.Serialization.Common;
using Tests.Common;
using Xunit;

namespace DCSFP.Tests.Serialization
{
namespace DCS_BIOS.Tests.Serialization {

public static class DCSBIOSInput_SerializeTests {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using DCS_BIOS.Serialized;
using DCSFP.Tests.Serialization.Common;
using Newtonsoft.Json;
using DCS_BIOS.Tests.Serialization.Common;
using Xunit;
using Tests.Common;

namespace DCSFP.Tests.Serialization
{
namespace DCS_BIOS.Tests.Serialization {

/// <summary>
/// Note : Can't set 'Formula' because on how the set property calls to 'ExtractDCSBIOSOutputsInFormula'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using DCS_BIOS.Serialized;
using DCSFP.Tests.Serialization.Common;
using Newtonsoft.Json;
using DCS_BIOS.Tests.Serialization.Common;
using Tests.Common;
using Xunit;

namespace DCSFP.Tests.Serialization
{
namespace DCS_BIOS.Tests.Serialization {

public static class DCSBIOSOutput_SerializeTests {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
using NonVisuals.Panels.StreamDeck.Panels;
using Xunit;

namespace DCSFP.Tests.NonVisuals
namespace DCSFlightpanels.Tests.NonVisuals
{
public class CloneTests {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using NonVisuals.KeyEmulation;
using Xunit;

namespace DCSFP.Tests.NonVisuals
namespace DCSFlightpanels.Tests.NonVisuals
{
public class CopyPackageTests
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using NonVisuals.Panels.StreamDeck.Panels;
using Xunit;

namespace DCSFP.Tests.NonVisuals
namespace DCSFlightpanels.Tests.NonVisuals
{
[Collection("Sequential")]
public class EventHandlerSubscriptionTests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
using System.Windows.Forms;
using MEF;

namespace DCSFP.Tests
{
namespace DCSFlightpanels.Tests {
/*
* Use this class as a template for your plugin.
* Reference the MEF project where the interface and necessary files are located.
Expand Down
56 changes: 42 additions & 14 deletions src/DCSFlightpanels.sln
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
.editorconfig = .editorconfig
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DCSFP.Tests", "DCSFP.Tests\DCSFP.Tests.csproj", "{D80E361D-35C3-4DBD-855B-B6E5F93FC9A5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HidLibrary", "HidLibrary\HidLibrary.csproj", "{727A27D0-6A57-48E3-B704-A47FA93F66BE}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SamplePanelEventPlugin2", "SamplePanelEventPlugin2\SamplePanelEventPlugin2.csproj", "{09DB3707-5B46-41CF-AC10-B1ADCD0087A6}"
Expand All @@ -34,6 +32,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClassLibraryCommon", "DCSFP
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NonVisuals.Tests", "NonVisuals.Tests\NonVisuals.Tests.csproj", "{973ECF33-FC33-4D4D-84C5-40DFD0B04B68}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DCS-BIOS.Tests", "DCS-BIOS.Tests\DCS-BIOS.Tests.csproj", "{00A76CB2-FDD8-42DB-A9EB-FDCF8EED01DA}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tests.Common", "Tests.Common\Tests.Common.csproj", "{E5DCEEF2-CD72-4AD2-BDB7-969160FD3E1C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DCSFlightpanels.Tests", "DCSFlightpanels.Tests\DCSFlightpanels.Tests.csproj", "{7792092E-4A93-4F54-880B-ABB014CB4624}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -92,18 +96,6 @@ Global
{0C0196B3-2442-4838-A587-C51660136F9C}.Release|x64.Build.0 = Release|Any CPU
{0C0196B3-2442-4838-A587-C51660136F9C}.Release|x86.ActiveCfg = Release|Any CPU
{0C0196B3-2442-4838-A587-C51660136F9C}.Release|x86.Build.0 = Release|Any CPU
{D80E361D-35C3-4DBD-855B-B6E5F93FC9A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D80E361D-35C3-4DBD-855B-B6E5F93FC9A5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D80E361D-35C3-4DBD-855B-B6E5F93FC9A5}.Debug|x64.ActiveCfg = Debug|Any CPU
{D80E361D-35C3-4DBD-855B-B6E5F93FC9A5}.Debug|x64.Build.0 = Debug|Any CPU
{D80E361D-35C3-4DBD-855B-B6E5F93FC9A5}.Debug|x86.ActiveCfg = Debug|Any CPU
{D80E361D-35C3-4DBD-855B-B6E5F93FC9A5}.Debug|x86.Build.0 = Debug|Any CPU
{D80E361D-35C3-4DBD-855B-B6E5F93FC9A5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D80E361D-35C3-4DBD-855B-B6E5F93FC9A5}.Release|Any CPU.Build.0 = Release|Any CPU
{D80E361D-35C3-4DBD-855B-B6E5F93FC9A5}.Release|x64.ActiveCfg = Release|Any CPU
{D80E361D-35C3-4DBD-855B-B6E5F93FC9A5}.Release|x64.Build.0 = Release|Any CPU
{D80E361D-35C3-4DBD-855B-B6E5F93FC9A5}.Release|x86.ActiveCfg = Release|Any CPU
{D80E361D-35C3-4DBD-855B-B6E5F93FC9A5}.Release|x86.Build.0 = Release|Any CPU
{727A27D0-6A57-48E3-B704-A47FA93F66BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{727A27D0-6A57-48E3-B704-A47FA93F66BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{727A27D0-6A57-48E3-B704-A47FA93F66BE}.Debug|x64.ActiveCfg = Debug|Any CPU
Expand Down Expand Up @@ -200,6 +192,42 @@ Global
{973ECF33-FC33-4D4D-84C5-40DFD0B04B68}.Release|x64.Build.0 = Release|Any CPU
{973ECF33-FC33-4D4D-84C5-40DFD0B04B68}.Release|x86.ActiveCfg = Release|Any CPU
{973ECF33-FC33-4D4D-84C5-40DFD0B04B68}.Release|x86.Build.0 = Release|Any CPU
{00A76CB2-FDD8-42DB-A9EB-FDCF8EED01DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{00A76CB2-FDD8-42DB-A9EB-FDCF8EED01DA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{00A76CB2-FDD8-42DB-A9EB-FDCF8EED01DA}.Debug|x64.ActiveCfg = Debug|Any CPU
{00A76CB2-FDD8-42DB-A9EB-FDCF8EED01DA}.Debug|x64.Build.0 = Debug|Any CPU
{00A76CB2-FDD8-42DB-A9EB-FDCF8EED01DA}.Debug|x86.ActiveCfg = Debug|Any CPU
{00A76CB2-FDD8-42DB-A9EB-FDCF8EED01DA}.Debug|x86.Build.0 = Debug|Any CPU
{00A76CB2-FDD8-42DB-A9EB-FDCF8EED01DA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{00A76CB2-FDD8-42DB-A9EB-FDCF8EED01DA}.Release|Any CPU.Build.0 = Release|Any CPU
{00A76CB2-FDD8-42DB-A9EB-FDCF8EED01DA}.Release|x64.ActiveCfg = Release|Any CPU
{00A76CB2-FDD8-42DB-A9EB-FDCF8EED01DA}.Release|x64.Build.0 = Release|Any CPU
{00A76CB2-FDD8-42DB-A9EB-FDCF8EED01DA}.Release|x86.ActiveCfg = Release|Any CPU
{00A76CB2-FDD8-42DB-A9EB-FDCF8EED01DA}.Release|x86.Build.0 = Release|Any CPU
{E5DCEEF2-CD72-4AD2-BDB7-969160FD3E1C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E5DCEEF2-CD72-4AD2-BDB7-969160FD3E1C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E5DCEEF2-CD72-4AD2-BDB7-969160FD3E1C}.Debug|x64.ActiveCfg = Debug|Any CPU
{E5DCEEF2-CD72-4AD2-BDB7-969160FD3E1C}.Debug|x64.Build.0 = Debug|Any CPU
{E5DCEEF2-CD72-4AD2-BDB7-969160FD3E1C}.Debug|x86.ActiveCfg = Debug|Any CPU
{E5DCEEF2-CD72-4AD2-BDB7-969160FD3E1C}.Debug|x86.Build.0 = Debug|Any CPU
{E5DCEEF2-CD72-4AD2-BDB7-969160FD3E1C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E5DCEEF2-CD72-4AD2-BDB7-969160FD3E1C}.Release|Any CPU.Build.0 = Release|Any CPU
{E5DCEEF2-CD72-4AD2-BDB7-969160FD3E1C}.Release|x64.ActiveCfg = Release|Any CPU
{E5DCEEF2-CD72-4AD2-BDB7-969160FD3E1C}.Release|x64.Build.0 = Release|Any CPU
{E5DCEEF2-CD72-4AD2-BDB7-969160FD3E1C}.Release|x86.ActiveCfg = Release|Any CPU
{E5DCEEF2-CD72-4AD2-BDB7-969160FD3E1C}.Release|x86.Build.0 = Release|Any CPU
{7792092E-4A93-4F54-880B-ABB014CB4624}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7792092E-4A93-4F54-880B-ABB014CB4624}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7792092E-4A93-4F54-880B-ABB014CB4624}.Debug|x64.ActiveCfg = Debug|Any CPU
{7792092E-4A93-4F54-880B-ABB014CB4624}.Debug|x64.Build.0 = Debug|Any CPU
{7792092E-4A93-4F54-880B-ABB014CB4624}.Debug|x86.ActiveCfg = Debug|Any CPU
{7792092E-4A93-4F54-880B-ABB014CB4624}.Debug|x86.Build.0 = Debug|Any CPU
{7792092E-4A93-4F54-880B-ABB014CB4624}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7792092E-4A93-4F54-880B-ABB014CB4624}.Release|Any CPU.Build.0 = Release|Any CPU
{7792092E-4A93-4F54-880B-ABB014CB4624}.Release|x64.ActiveCfg = Release|Any CPU
{7792092E-4A93-4F54-880B-ABB014CB4624}.Release|x64.Build.0 = Release|Any CPU
{7792092E-4A93-4F54-880B-ABB014CB4624}.Release|x86.ActiveCfg = Release|Any CPU
{7792092E-4A93-4F54-880B-ABB014CB4624}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
4 changes: 4 additions & 0 deletions src/NonVisuals.Tests/NonVisuals.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ExpectedObjects" Version="3.5.4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="8.0.0" />
<PackageReference Include="xunit" Version="2.7.0" />
<PackageReference Include="xunit.runner.console" Version="2.7.0">
<PrivateAssets>all</PrivateAssets>
Expand All @@ -20,7 +22,9 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\DCS-BIOS.Tests\DCS-BIOS.Tests.csproj" />
<ProjectReference Include="..\NonVisuals\NonVisuals.csproj" />
<ProjectReference Include="..\Tests.Common\Tests.Common.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
using DCSFP.Tests.Serialization.Common;
using DCS_BIOS.Tests.Serialization;
using Newtonsoft.Json;
using NonVisuals.Interfaces;
using NonVisuals.Panels.StreamDeck;
using NonVisuals.Tests.Serialization.Common;
using Tests.Common;
using Xunit;

namespace DCSFP.Tests.Serialization {
namespace NonVisuals.Tests.Serialization {
public class ActionTypeDCSBIOS_SerializeTests {
[Fact]
public static void ActionTypeDCSBIOS_ShouldBeSerializable() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
using DCSFP.Tests.Serialization.Common;
using Newtonsoft.Json;
using Newtonsoft.Json;
using NonVisuals.Interfaces;
using NonVisuals.Panels.StreamDeck;
using NonVisuals.Tests.Serialization.Common;
using Tests.Common;
using Xunit;

namespace DCSFP.Tests.Serialization {
namespace NonVisuals.Tests.Serialization {

public static class ActionTypeKey_SerializeTests {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
using DCSFP.Tests.Serialization.Common;
using Newtonsoft.Json;
using Newtonsoft.Json;
using NonVisuals.Interfaces;
using NonVisuals.Panels.StreamDeck;
using NonVisuals.Tests.Serialization.Common;
using Tests.Common;
using Xunit;

namespace DCSFP.Tests.Serialization {
namespace NonVisuals.Tests.Serialization {
public class ActionTypeLayer_SerializeTests {
[Fact]
public static void ActionTypeLayer_ShouldBeSerializable() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
using DCSFP.Tests.Serialization.Common;
using Newtonsoft.Json;
using Newtonsoft.Json;
using NonVisuals.Interfaces;
using NonVisuals.Panels.StreamDeck;
using NonVisuals.Tests.Serialization.Common;
using Tests.Common;
using Xunit;

namespace DCSFP.Tests.Serialization {
namespace NonVisuals.Tests.Serialization {
public class ActionTypeOS_SerializeTests {

[Fact]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
using DCSFP.Tests.Serialization.Common;
using Newtonsoft.Json;
using Newtonsoft.Json;
using NonVisuals.Panels.Saitek;
using NonVisuals.Panels.Saitek.Panels;
using NonVisuals.Tests.Serialization.Common;
using Tests.Common;
using Xunit;

namespace DCSFP.Tests.Serialization {
namespace NonVisuals.Tests.Serialization {

public static class BIPLight_SerializeTests {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
using DCSFP.Tests.Serialization.Common;
using Newtonsoft.Json;
using Newtonsoft.Json;
using NonVisuals.BindingClasses.BIP;
using NonVisuals.Tests.Serialization.Common;
using Tests.Common;
using Xunit;

namespace DCSFP.Tests.Serialization {
namespace NonVisuals.Tests.Serialization {
public class BIPLinkFarmingPanel_SerializeTests {
[Fact]
public static void BIPLinkFarmingPanel_ShouldBeSerializable() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
using System.Collections.Generic;
using DCSFP.Tests.Serialization.Common;
using Newtonsoft.Json;
using Newtonsoft.Json;
using NonVisuals.BindingClasses.BIP;
using NonVisuals.Tests.Serialization.Common;
using System.Collections.Generic;
using Tests.Common;
using Xunit;

namespace DCSFP.Tests.Serialization {
namespace NonVisuals.Tests.Serialization {
public class BIPLinkPZ55_SerializeTests {

[Fact]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
using DCSFP.Tests.Serialization.Common;
using Newtonsoft.Json;
using Newtonsoft.Json;
using NonVisuals.BindingClasses.BIP;
using NonVisuals.Tests.Serialization.Common;
using Tests.Common;
using Xunit;

namespace DCSFP.Tests.Serialization {
namespace NonVisuals.Tests.Serialization {
public class BIPLinkPZ69_SerializeTests {
[Fact]
public static void BIPLinkPZ69_ShouldBeSerializable() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
using DCSFP.Tests.Serialization.Common;
using Newtonsoft.Json;
using Newtonsoft.Json;
using NonVisuals.BindingClasses.BIP;
using NonVisuals.Tests.Serialization.Common;
using Tests.Common;
using Xunit;

namespace DCSFP.Tests.Serialization {
namespace NonVisuals.Tests.Serialization {
public class BIPLinkPZ70_SerializeTests {
[Fact]
public static void BIPLinkPZ70_ShouldBeSerializable() {
Expand Down
Loading
Loading