Skip to content
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
8 changes: 7 additions & 1 deletion .github/workflows/project-regular-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,10 @@ jobs:
- name: Build Solution
run: dotnet build --no-restore -c Release
- name: Run Tests
run: dotnet test
run: |
dotnet test \
--coverage \
--coverage-output-format cobertura \
--coverage-output .coverage/coverage.cobertura.xml \
--report-trx \
--results-directory .coverage
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,11 @@ bld/
# visual studio code
.vscode/

# dotnet sdk
global.json

# generated file
**/Generated/**/*.cs
**/.benchmark/**
**/**/*.dll
.coverage/

# generated schemas
**/*.schema.json
Expand Down
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<CodeAnalysisTreatWarningsAsErrors>true</CodeAnalysisTreatWarningsAsErrors>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<EnableNUnitRunner>true</EnableNUnitRunner>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
<PackageVersion Include="Microsoft.Extensions.TimeProvider.Testing" Version="10.3.0" />
<PackageVersion Include="Microsoft.NET.Build.Containers" Version="10.0.103" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.3.0" />
<PackageVersion Include="Microsoft.Testing.Extensions.CodeCoverage" Version="18.5.2" />
<PackageVersion Include="Microsoft.Testing.Extensions.TrxReport" Version="2.1.0" />
<PackageVersion Include="Moq" Version="4.20.72" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.4" />
<PackageVersion Include="NUnit" Version="4.5.0" />
Expand Down
6 changes: 3 additions & 3 deletions csharp/CSharp/PropertiesAndFields.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ namespace CSharp;

public class PropertiesAndFields(ILogger<PropertiesAndFields> _logger)
{
string _filed = "field";
string _field = "field";

public string WithOutFieldKeyword { get => _filed; set => _filed = value; }
public string WithOutFieldKeyword { get => _field; set => _field = value; }
public string WithFieldKeyword { get; set => field = value.Trim(); } = "WithField";

public void FieldKeyword()
{
_logger.LogInformation($"_field => '{_filed}'");
_logger.LogInformation($"_field => '{_field}'");
_logger.LogInformation($"WithOutFieldKeyword => '{WithOutFieldKeyword}'");
_logger.LogInformation($"WithFieldKeyword => '{WithFieldKeyword}'");
}
Expand Down
5 changes: 5 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"test": {
"runner": "Microsoft.Testing.Platform"
}
}
4 changes: 1 addition & 3 deletions model-binders/ModelBinders/IQuery.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
namespace ModelBinders;

public interface IQuery<TModel> : IDictionary<Guid, TModel>
{
}
public interface IQuery<TModel> : IDictionary<Guid, TModel>;
4 changes: 1 addition & 3 deletions model-binders/ModelBinders/ModelOne.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@ public class ModelOne(Guid _id, string _name)
public string Name => _name;
}

public class ModelOnes : Dictionary<Guid, ModelOne>, IQuery<ModelOne>
{
}
public class ModelOnes : Dictionary<Guid, ModelOne>, IQuery<ModelOne>;
4 changes: 1 addition & 3 deletions model-binders/ModelBinders/ModelTwo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@ public class ModelTwo(Guid _id, string _name)
public string Name => _name;
}

public class ModelTwos : Dictionary<Guid, ModelTwo>, IQuery<ModelTwo>
{
}
public class ModelTwos : Dictionary<Guid, ModelTwo>, IQuery<ModelTwo>;
7 changes: 3 additions & 4 deletions unit-testing/UnitTesting/UnitTesting.csproj
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.TimeProvider.Testing" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="Microsoft.Testing.Extensions.CodeCoverage" />
<PackageReference Include="Microsoft.Testing.Extensions.TrxReport" />
<PackageReference Include="Moq" />
<PackageReference Include="NUnit" />
<PackageReference Include="NUnit3TestAdapter" />
<PackageReference Include="NUnit.Analyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Shouldly" />
</ItemGroup>

Expand Down