Skip to content

Commit

Permalink
Tests (#14)
Browse files Browse the repository at this point in the history
* Add tests
  • Loading branch information
vov4uk committed May 4, 2022
1 parent c145ef2 commit 25688fc
Show file tree
Hide file tree
Showing 99 changed files with 2,750 additions and 1,075 deletions.
117 changes: 117 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# NOTE: Requires **VS2019 16.3** or later

# Rules for Hik.Client
# Description: Code analysis rules for Hik.Client.csproj.

# Code files
[*.{cs,vb}]


dotnet_diagnostic.CA1821.severity = warning

dotnet_diagnostic.CA2213.severity = warning

dotnet_diagnostic.CA2231.severity = warning

dotnet_diagnostic.SA0001.severity = none

dotnet_diagnostic.SA1101.severity = none

dotnet_diagnostic.SA1200.severity = none

dotnet_diagnostic.SA1600.severity = none

dotnet_diagnostic.SA1629.severity = none

dotnet_diagnostic.SA1633.severity = none

dotnet_diagnostic.S5443.severity = none

# SA1401: Fields should be private
dotnet_diagnostic.SA1401.severity = none

[*.{cs,vb}]
#### Naming styles ####

# Naming rules

dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i

dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case

dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case

# Symbol specifications

dotnet_naming_symbols.interface.applicable_kinds = interface
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.interface.required_modifiers =

dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.types.required_modifiers =

dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.non_field_members.required_modifiers =

# Naming styles

dotnet_naming_style.begins_with_i.required_prefix = I
dotnet_naming_style.begins_with_i.required_suffix =
dotnet_naming_style.begins_with_i.word_separator =
dotnet_naming_style.begins_with_i.capitalization = pascal_case

dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.capitalization = pascal_case

dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.capitalization = pascal_case
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
dotnet_style_prefer_auto_properties = true:silent
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
dotnet_style_prefer_conditional_expression_over_return = true:silent
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_compound_assignment = true:suggestion
dotnet_style_prefer_simplified_interpolation = true:suggestion
dotnet_style_namespace_match_folder = true:suggestion
dotnet_style_operator_placement_when_wrapping = beginning_of_line
tab_width = 4
indent_size = 4
end_of_line = crlf

[*.cs]
csharp_using_directive_placement = outside_namespace:silent
csharp_prefer_simple_using_statement = true:suggestion
csharp_prefer_braces = true:silent
csharp_style_namespace_declarations = block_scoped:silent
csharp_style_expression_bodied_methods = false:silent
csharp_style_expression_bodied_constructors = false:silent
csharp_style_expression_bodied_operators = false:silent
csharp_style_expression_bodied_properties = true:silent
csharp_style_expression_bodied_indexers = true:silent
csharp_style_expression_bodied_accessors = true:silent
csharp_style_expression_bodied_lambdas = true:silent
csharp_style_expression_bodied_local_functions = false:silent
csharp_style_throw_expression = true:suggestion
csharp_style_prefer_null_check_over_type_check = true:suggestion
csharp_prefer_simple_default_expression = true:suggestion
csharp_style_prefer_local_over_anonymous_function = true:suggestion
csharp_indent_labels = one_less_than_current
21 changes: 20 additions & 1 deletion Hik.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ VisualStudioVersion = 17.0.31912.275
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Hik.Client", "src\Hik.Client\Hik.Client.csproj", "{1E49A7B7-1549-4566-84AA-A073179FE013}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Hik.Client.Tests", "src\Tests\Hik.Tests\Hik.Client.Tests.csproj", "{941C4E4E-2898-4A78-AF93-7A7E6EB87DA3}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Hik.Client.Tests", "Tests\Hik.Tests\Hik.Client.Tests.csproj", "{941C4E4E-2898-4A78-AF93-7A7E6EB87DA3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Hik.DataAccess", "src\Hik.DataAccess\Hik.DataAccess.csproj", "{398BC768-99BB-4601-AD47-A987EFFA0252}"
EndProject
Expand All @@ -19,6 +19,15 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JobHost", "src\JobHost\JobH
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{15507225-11CE-4713-8452-3885F5A6F3E1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Job.Tests", "Tests\Job.Tests\Job.Tests.csproj", "{C3FE1EEF-59B1-4890-9389-43D90D9C3A43}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E4D958FE-B559-4989-8F1B-A13207CEE32A}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Hik.DataAccess.Tests", "Tests\Hik.DataAccess.Tests\Hik.DataAccess.Tests.csproj", "{6531F185-58E1-45A5-8F1F-CCFC74FE863A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -53,12 +62,22 @@ Global
{D261541B-BBAF-48BF-8B94-0E46690DBE03}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D261541B-BBAF-48BF-8B94-0E46690DBE03}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D261541B-BBAF-48BF-8B94-0E46690DBE03}.Release|Any CPU.Build.0 = Release|Any CPU
{C3FE1EEF-59B1-4890-9389-43D90D9C3A43}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C3FE1EEF-59B1-4890-9389-43D90D9C3A43}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C3FE1EEF-59B1-4890-9389-43D90D9C3A43}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C3FE1EEF-59B1-4890-9389-43D90D9C3A43}.Release|Any CPU.Build.0 = Release|Any CPU
{6531F185-58E1-45A5-8F1F-CCFC74FE863A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6531F185-58E1-45A5-8F1F-CCFC74FE863A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6531F185-58E1-45A5-8F1F-CCFC74FE863A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6531F185-58E1-45A5-8F1F-CCFC74FE863A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{941C4E4E-2898-4A78-AF93-7A7E6EB87DA3} = {15507225-11CE-4713-8452-3885F5A6F3E1}
{C3FE1EEF-59B1-4890-9389-43D90D9C3A43} = {15507225-11CE-4713-8452-3885F5A6F3E1}
{6531F185-58E1-45A5-8F1F-CCFC74FE863A} = {15507225-11CE-4713-8452-3885F5A6F3E1}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {BC11C5EE-74C4-497D-9A6F-46A53EC063DF}
Expand Down
5 changes: 0 additions & 5 deletions Sonar.cmd

This file was deleted.

29 changes: 29 additions & 0 deletions Tests/Hik.DataAccess.Tests/Hik.DataAccess.Tests.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AutoFixture.Xunit2" Version="4.17.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
<PackageReference Include="Moq" Version="4.17.2" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.1.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Hik.DataAccess\Hik.DataAccess.csproj" />
</ItemGroup>

</Project>
Loading

0 comments on commit 25688fc

Please sign in to comment.