Skip to content

Commit cf84603

Browse files
committed
Adding test project; fixing readme stuff
1 parent ca4042e commit cf84603

8 files changed

Lines changed: 441 additions & 16 deletions

File tree

Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
# This file is adapted from the dotnet runtime .editorconfig file, licensed under the MIT license.
2+
# You can find the original file here: https://github.com/dotnet/runtime/blob/main/.editorconfig.
3+
# Also, some inspiration from the Roslyn .editorconfig file, found here: https://github.com/dotnet/roslyn/blob/main/.editorconfig.
4+
# Analysis and style options are detailed here: https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/overview?tabs=net-8.
5+
6+
# Top-most EditorConfig file
7+
root = true
8+
9+
# Default settings (all files)
10+
[*]
11+
insert_final_newline = true
12+
indent_style = space
13+
trim_trailing_whitespace = true
14+
15+
# C# files
16+
[*.cs]
17+
18+
# Line preferences
19+
max_line_length = 120
20+
csharp_new_line_before_open_brace = all
21+
csharp_new_line_before_else = true
22+
csharp_new_line_before_catch = true
23+
csharp_new_line_before_finally = true
24+
csharp_new_line_before_members_in_object_initializers = false
25+
csharp_new_line_before_members_in_anonymous_types = true
26+
csharp_new_line_between_query_expression_clauses = true
27+
28+
# Indentation preferences
29+
indent_size = 4
30+
csharp_indent_block_contents = true
31+
csharp_indent_braces = false
32+
csharp_indent_case_contents = true
33+
csharp_indent_case_contents_when_block = false
34+
csharp_indent_switch_labels = true
35+
csharp_indent_labels = one_less_than_current
36+
37+
# Modifier preferences
38+
csharp_preferred_modifier_order = public, private, protected, internal, file, static, extern, new, virtual, abstract, sealed, override, readonly, unsafe, required, volatile, async:suggestion
39+
40+
# Avoid "this." unless absolutely necessary
41+
dotnet_style_qualification_for_field = false:suggestion
42+
dotnet_style_qualification_for_property = false:suggestion
43+
dotnet_style_qualification_for_method = false:suggestion
44+
dotnet_style_qualification_for_event = false:suggestion
45+
46+
# Name all constant fields using PascalCase
47+
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = error
48+
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
49+
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
50+
dotnet_naming_symbols.constant_fields.applicable_kinds = field
51+
dotnet_naming_symbols.constant_fields.required_modifiers = const
52+
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
53+
54+
# Private static fields should be _PascalCase
55+
dotnet_naming_rule.static_fields_should_have_prefix.severity = error
56+
dotnet_naming_rule.static_fields_should_have_prefix.symbols = static_fields
57+
dotnet_naming_rule.static_fields_should_have_prefix.style = static_prefix_style
58+
dotnet_naming_symbols.static_fields.applicable_kinds = field
59+
dotnet_naming_symbols.static_fields.required_modifiers = static
60+
dotnet_naming_symbols.static_fields.applicable_accessibilities = private, private_protected
61+
dotnet_naming_style.static_prefix_style.required_prefix = _
62+
dotnet_naming_style.static_prefix_style.capitalization = pascal_case
63+
64+
# Private fields should be _camelCase
65+
dotnet_naming_rule.camel_case_for_private_internal_fields.severity = error
66+
dotnet_naming_rule.camel_case_for_private_internal_fields.symbols = private_internal_fields
67+
dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style
68+
dotnet_naming_symbols.private_internal_fields.applicable_kinds = field
69+
dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private
70+
dotnet_naming_style.camel_case_underscore_style.required_prefix = _
71+
dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case
72+
73+
# Code style defaults
74+
csharp_using_directive_placement = outside_namespace:error
75+
dotnet_sort_system_directives_first = true
76+
csharp_prefer_braces = true:silent
77+
csharp_preserve_single_line_blocks = true
78+
csharp_preserve_single_line_statements = false
79+
csharp_prefer_static_local_function = true:suggestion
80+
csharp_prefer_simple_using_statement = false:none
81+
csharp_style_prefer_switch_expression = true:suggestion
82+
dotnet_style_readonly_field = true:suggestion
83+
84+
# Expression-level preferences
85+
dotnet_style_object_initializer = true:suggestion
86+
dotnet_style_collection_initializer = true:suggestion
87+
dotnet_style_prefer_collection_expression = true:suggestion
88+
dotnet_style_explicit_tuple_names = true:suggestion
89+
dotnet_style_coalesce_expression = true:suggestion
90+
dotnet_style_null_propagation = true:suggestion
91+
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
92+
dotnet_style_prefer_inferred_tuple_names = true:suggestion
93+
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
94+
dotnet_style_prefer_auto_properties = true:suggestion
95+
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
96+
dotnet_style_prefer_conditional_expression_over_return = true:silent
97+
csharp_prefer_simple_default_expression = true:suggestion
98+
99+
# Expression-bodied members
100+
csharp_style_expression_bodied_methods = false
101+
csharp_style_expression_bodied_constructors = true:silent
102+
csharp_style_expression_bodied_operators = true:silent
103+
csharp_style_expression_bodied_properties = true:silent
104+
csharp_style_expression_bodied_indexers = true:silent
105+
csharp_style_expression_bodied_accessors = true:silent
106+
csharp_style_expression_bodied_lambdas = true:silent
107+
csharp_style_expression_bodied_local_functions = true:silent
108+
109+
# Pattern matching
110+
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
111+
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
112+
csharp_style_inlined_variable_declaration = true:suggestion
113+
114+
# Null checking preferences
115+
csharp_style_throw_expression = true:suggestion
116+
csharp_style_conditional_delegate_call = true:suggestion
117+
118+
# Other features
119+
csharp_style_prefer_index_operator = false:none
120+
csharp_style_prefer_range_operator = false:none
121+
csharp_style_pattern_local_over_anonymous_function = false:none
122+
123+
# Space preferences
124+
csharp_space_after_cast = true
125+
csharp_space_after_colon_in_inheritance_clause = true
126+
csharp_space_after_comma = true
127+
csharp_space_after_dot = false
128+
csharp_space_after_keywords_in_control_flow_statements = true
129+
csharp_space_after_semicolon_in_for_statement = true
130+
csharp_space_around_binary_operators = before_and_after
131+
csharp_space_around_declaration_statements = false
132+
csharp_space_before_colon_in_inheritance_clause = true
133+
csharp_space_before_comma = false
134+
csharp_space_before_dot = false
135+
csharp_space_before_open_square_brackets = false
136+
csharp_space_before_semicolon_in_for_statement = false
137+
csharp_space_between_empty_square_brackets = false
138+
csharp_space_between_method_call_empty_parameter_list_parentheses = false
139+
csharp_space_between_method_call_name_and_opening_parenthesis = false
140+
csharp_space_between_method_call_parameter_list_parentheses = false
141+
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
142+
csharp_space_between_method_declaration_name_and_open_parenthesis = false
143+
csharp_space_between_method_declaration_parameter_list_parentheses = false
144+
csharp_space_between_square_brackets = false
145+
146+
# Style rules not covered by CodeAnalysis ruleset
147+
# Require braces on all control flow statements
148+
dotnet_diagnostic.IDE0011.severity = error
149+
# Results of expressions must be used
150+
dotnet_diagnostic.IDE0058.severity = none
151+
# Do not assign values if they are not used
152+
dotnet_diagnostic.IDE0059.severity = error
153+
# Do not have unused parameters in methods
154+
dotnet_diagnostic.IDE0060.severity = error
155+
# Dispose objects before losing scope
156+
dotnet_diagnostic.CA2000.severity = error
157+
158+
# JSON files
159+
[*.json]
160+
indent_size = 2
161+
162+
# Xml project files
163+
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,nativeproj,locproj}]
164+
indent_size = 2
165+
166+
[*.{csproj,vbproj,proj,nativeproj,locproj}]
167+
charset = utf-8
168+
169+
# Xml build files
170+
[*.builds]
171+
indent_size = 2
172+
173+
# Xml files
174+
[*.{xml,stylecop,resx,ruleset}]
175+
indent_size = 2
176+
177+
# Xml config files
178+
[*.{props,targets,config,nuspec}]
179+
indent_size = 2
180+
181+
# YAML config files
182+
[*.{yml,yaml}]
183+
indent_size = 2
184+
185+
# Shell scripts
186+
[*.sh]
187+
end_of_line = lf
188+
189+
[*.{cmd,bat}]
190+
end_of_line = crlf
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
global using Microsoft.VisualStudio.TestTools.UnitTesting;
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<Nullable>enable</Nullable>
7+
8+
<IsPackable>false</IsPackable>
9+
<IsTestProject>true</IsTestProject>
10+
</PropertyGroup>
11+
12+
<ItemGroup>
13+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0"/>
14+
<PackageReference Include="MSTest.TestAdapter" Version="3.0.4"/>
15+
<PackageReference Include="MSTest.TestFramework" Version="3.0.4"/>
16+
<PackageReference Include="coverlet.collector" Version="6.0.0"/>
17+
</ItemGroup>
18+
19+
</Project>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
namespace GuardianClient.Tests;
2+
3+
[TestClass]
4+
public class UnitTest1
5+
{
6+
[TestMethod]
7+
public void TestMethod1()
8+
{
9+
}
10+
}

GuardianClient/GuardianClient.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
Microsoft Visual Studio Solution File, Format Version 12.00
33
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GuardianClient", "GuardianClient\GuardianClient.csproj", "{1C8D741D-B920-44FA-9A15-648DEA7FF8D2}"
44
EndProject
5+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GuardianClient.Tests", "GuardianClient.Tests\GuardianClient.Tests.csproj", "{1F456D3E-3935-4EB1-A1EC-422494765C7B}"
6+
EndProject
57
Global
68
GlobalSection(SolutionConfigurationPlatforms) = preSolution
79
Debug|Any CPU = Debug|Any CPU
@@ -12,5 +14,9 @@ Global
1214
{1C8D741D-B920-44FA-9A15-648DEA7FF8D2}.Debug|Any CPU.Build.0 = Debug|Any CPU
1315
{1C8D741D-B920-44FA-9A15-648DEA7FF8D2}.Release|Any CPU.ActiveCfg = Release|Any CPU
1416
{1C8D741D-B920-44FA-9A15-648DEA7FF8D2}.Release|Any CPU.Build.0 = Release|Any CPU
17+
{1F456D3E-3935-4EB1-A1EC-422494765C7B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
18+
{1F456D3E-3935-4EB1-A1EC-422494765C7B}.Debug|Any CPU.Build.0 = Debug|Any CPU
19+
{1F456D3E-3935-4EB1-A1EC-422494765C7B}.Release|Any CPU.ActiveCfg = Release|Any CPU
20+
{1F456D3E-3935-4EB1-A1EC-422494765C7B}.Release|Any CPU.Build.0 = Release|Any CPU
1521
EndGlobalSection
1622
EndGlobal
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
2+
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=479d3588_002Deea6_002D4885_002D93dc_002D5f5d64ceb4d6/@EntryIndexedValue">&lt;SessionState ContinuousTestingMode="0" IsActive="True" Name="All tests from Solution" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"&gt;
3+
&lt;Solution /&gt;
4+
&lt;/SessionState&gt;</s:String></wpf:ResourceDictionary>

0 commit comments

Comments
 (0)