Skip to content

Commit

Permalink
Update unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MichielOda committed Nov 26, 2024
1 parent 21cc247 commit 7463f2b
Show file tree
Hide file tree
Showing 27 changed files with 1,420 additions and 44 deletions.
38 changes: 0 additions & 38 deletions DMProtocolTests/AssemblyInitialize.cs

This file was deleted.

16 changes: 10 additions & 6 deletions DMProtocolTests/DMProtocolTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<Compile Remove="TestFiles\**" />
</ItemGroup>

<ItemGroup>
<Content Include="TestFiles\**">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.6.3" />
Expand All @@ -22,10 +32,4 @@
<ProjectReference Include="..\DMProtocol\DMProtocol.csproj" />
</ItemGroup>

<ItemGroup>
<None Update="TestFiles.zip">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
6 changes: 6 additions & 0 deletions DMProtocolTests/FactoryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ public async Task FromRepositoryAsyncTestAsync()

// Verify assembly from DLLs folder is included.
Assert.IsNotNull(builder.Assemblies.FirstOrDefault(a => a.AssemblyFilePath.EndsWith("ClassLibX.dll")));

// Verify if Trending template is present
Assert.AreEqual(1, builder.TrendTemplates.Count);
}

[TestMethod]
Expand Down Expand Up @@ -76,6 +79,9 @@ public async Task FromRepositoryAsyncTestOverrideVersionAsync()

// Verify assembly from DLLs folder is included.
Assert.IsNotNull(builder.Assemblies.FirstOrDefault(a => a.AssemblyFilePath.EndsWith("ClassLibX.dll")));

// Verify if Trending template is present
Assert.AreEqual(1, builder.TrendTemplates.Count);
}
}
}
Binary file removed DMProtocolTests/TestFiles.zip
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This folder contains default templates to be used by the protocol.
Allowed names:
"Template_Alarm_Default.xml"
"Trending_Template_Default.xml"
"Information_Template_Default.xml"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?xml version="1.0" encoding="utf-8" ?>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<Project>
<PropertyGroup>
<PlatformTarget>x86</PlatformTarget>
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
</PropertyGroup>
<PropertyGroup Condition="$([System.Text.RegularExpressions.Regex]::IsMatch($(MSBuildProjectName), '^QAction_([0-9]+)$'))">
<DefineConstants>$(DefineConstants);DCFv1;DBInfo;ALARM_SQUASHING</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="$([System.Text.RegularExpressions.Regex]::IsMatch($(MSBuildProjectName), '^QAction_([0-9]+)$')) and '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugType>full</DebugType>
<CodeAnalysisRuleSet>..\Internal\Code Analysis\qaction-debug.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="$([System.Text.RegularExpressions.Regex]::IsMatch($(MSBuildProjectName), '^QAction_([0-9]+)$')) and '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<CodeAnalysisRuleSet>..\Internal\Code Analysis\qaction-release.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<AdditionalFiles Include="..\Internal\Code Analysis\stylecop.json">
<Link>Properties\stylecop.json</Link>
</AdditionalFiles>
<Content Include="..\Internal\.editorconfig">
<Link>Properties\.editorconfig</Link>
</Content>
</ItemGroup>
<ItemGroup>
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This folder contains DLL files that should be placed under the ProtocolScripts folder of DataMiner for this solution to work correctly.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Looking for README.md? Check your Solution Root folder. This folder can be used to add documentation related to this solution.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
root = true

[*]
indent_style = tab
indent_size = 4
tab_width = 4
end_of_line = crlf
trim_trailing_whitespace = true

[*.cs]
dotnet_sort_system_directives_first = true
Loading

0 comments on commit 7463f2b

Please sign in to comment.