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
36 changes: 25 additions & 11 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,19 @@ dotnet_diagnostic.CA2009.severity=error
dotnet_diagnostic.CA2008.severity=error
dotnet_diagnostic.CA2007.severity=warning
dotnet_diagnostic.CA2000.severity=suggestion
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_operator_placement_when_wrapping = beginning_of_line
tab_width = 4
end_of_line = crlf
dotnet_style_explicit_tuple_names = true:suggestion

[project.json]
indent_size = 2
Expand All @@ -66,7 +79,7 @@ csharp_indent_braces = false
csharp_indent_case_contents = true
csharp_indent_case_contents_when_block = true
csharp_indent_switch_labels = true
csharp_indent_labels = one_less_than_current
csharp_indent_labels = no_change

# Modifier preferences
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion
Expand Down Expand Up @@ -117,13 +130,13 @@ dotnet_naming_style.camel_case_underscore_style.required_prefix = _
dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case

# Code style defaults
csharp_using_directive_placement = outside_namespace:suggestion
csharp_using_directive_placement = outside_namespace:silent
dotnet_sort_system_directives_first = true
csharp_prefer_braces = true:silent
csharp_preserve_single_line_blocks = true:none
csharp_preserve_single_line_statements = false:none
csharp_prefer_static_local_function = true:suggestion
csharp_prefer_simple_using_statement = false:none
csharp_prefer_simple_using_statement = true:suggestion
csharp_style_prefer_switch_expression = true:suggestion
csharp_style_namespace_declarations = block_scoped:silent
csharp_style_prefer_method_group_conversion = true:silent
Expand Down Expand Up @@ -155,14 +168,14 @@ dotnet_style_prefer_simplified_interpolation = true:suggestion
dotnet_style_namespace_match_folder = true:suggestion

# Expression-bodied members
csharp_style_expression_bodied_methods = true:suggestion
csharp_style_expression_bodied_constructors = true:suggestion
csharp_style_expression_bodied_operators = true:suggestion
csharp_style_expression_bodied_properties = true:suggestion
csharp_style_expression_bodied_indexers = true:suggestion
csharp_style_expression_bodied_accessors = true:suggestion
csharp_style_expression_bodied_lambdas = true:suggestion
csharp_style_expression_bodied_local_functions = true:suggestion
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

# Pattern matching
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
Expand Down Expand Up @@ -519,6 +532,7 @@ dotnet_diagnostic.RCS1195.severity=error
dotnet_diagnostic.RCS1214.severity=error

dotnet_diagnostic.IDE1006.severity=none
csharp_prefer_system_threading_lock = true:suggestion

# C++ Files
[*.{cpp,h,in}]
Expand Down
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
</ItemGroup>
<ItemGroup Condition="!$(IsTestProject) AND !$(IsBenchmarkProject)">
<PackageReference Include="stylecop.analyzers" Version="1.2.0-beta.556" PrivateAssets="all" />
<PackageReference Include="Roslynator.Analyzers" Version="4.12.10" PrivateAssets="All" />
<PackageReference Include="Roslynator.Analyzers" Version="4.13.1" PrivateAssets="All" />
</ItemGroup>
<ItemGroup Condition="!$(IsTestProject) AND !$(IsBenchmarkProject)">
<AdditionalFiles Include="$(MSBuildThisFileDirectory)stylecop.json" Link="stylecop.json" />
Expand Down
3 changes: 3 additions & 0 deletions src/Directory.build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,7 @@
<PropertyGroup Condition="$(TargetFramework.StartsWith('net8'))">
<DefineConstants>$(DefineConstants);NETSTANDARD;PORTABLE;P_LINQ;SUPPORTS_BINDINGLIST</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="$(TargetFramework.StartsWith('net9'))">
<DefineConstants>$(DefineConstants);NETSTANDARD;PORTABLE;P_LINQ;SUPPORTS_BINDINGLIST</DefineConstants>
</PropertyGroup>
</Project>

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public void Add()
{
_collection.Add(1);

_results.Messages.Count.Should().BeGreaterOrEqualTo(1);
_results.Messages.Count.Should().BeGreaterThanOrEqualTo(1);
_results.Data.Count.Should().Be(1);
_results.Data.Items[0].Should().Be(1);
}
Expand Down
17 changes: 6 additions & 11 deletions src/DynamicData.Tests/Cache/TransformAsyncFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ public void Remove()
[Fact]
public async Task RemoveFlowsToTheEnd()
{
var transform = 0;
var count = 100;
ReadOnlyObservableCollection<Person> collection;

Expand All @@ -100,15 +99,8 @@ public async Task RemoveFlowsToTheEnd()
cache.Connect()
.TransformAsync(async person =>
{
try
{
await Task.Delay(Random.Shared.Next(1, 12));
return person;
}
finally
{
transform++;
}
await Task.Delay(Random.Shared.Next(1, 12));
return person;
})
.Bind(out collection)
.Subscribe();
Expand All @@ -119,8 +111,11 @@ public async Task RemoveFlowsToTheEnd()
cache.RemoveKey(p.Name);
}

await collection.ToObservableChangeSet().Take(count * 2);
// Add one event as an initial empty change set is sent
// NOTE TO SELF: How did this test previously work !
var changes = await collection.ToObservableChangeSet().Take(count * 2 + 1).ToList();

changes.Count.Should().Be(201);
collection.Count.Should().Be(0);
}

Expand Down
20 changes: 10 additions & 10 deletions src/DynamicData.Tests/DynamicData.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
<Project Sdk="MSBuild.Sdk.Extras">
<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFrameworks>net9.0</TargetFrameworks>
<NoWarn>$(NoWarn);CS0618;CA1801;CA1812;CA1816;CA1062;CA1063;CS8767;CS8602;CS8618;IDE1006</NoWarn>
<XunitVersion>2.7.0</XunitVersion>
<XunitVersion>2.*</XunitVersion>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\DynamicData\DynamicData.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Bogus" Version="35.6.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="Bogus" Version="35.*" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.*" />
<PackageReference Include="xunit" Version="$(XunitVersion)" />
<PackageReference Include="xunit.runner.console" Version="$(XunitVersion)" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.0" />
<PackageReference Include="Verify.Xunit" Version="23.7.2" />
<PackageReference Include="FluentAssertions" Version="6.12.2" />
<PackageReference Include="Microsoft.Reactive.Testing" Version="6.0.1" />
<PackageReference Include="PublicApiGenerator" Version="11.1.0" />
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PackageReference Include="xunit.runner.visualstudio" Version="3.*" />
<PackageReference Include="Verify.Xunit" Version="30.*" />
<PackageReference Include="AwesomeAssertions" Version="8.*" />
<PackageReference Include="Microsoft.Reactive.Testing" Version="6.*" />
<PackageReference Include="PublicApiGenerator" Version="11.*" />
<PackageReference Include="coverlet.collector" Version="6.*">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion src/DynamicData/DynamicData.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net462;net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net462;net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<IsPackable>true</IsPackable>
<ImplicitUsings>enable</ImplicitUsings>
Expand Down
Loading