diff --git a/Tests/aweXpect.Reflection.Tests/Filters/ConstructorFilters.WithInParameter.Tests.cs b/Tests/aweXpect.Reflection.Tests/Filters/ConstructorFilters.WithInParameter.Tests.cs index fe268f48..b05edbac 100644 --- a/Tests/aweXpect.Reflection.Tests/Filters/ConstructorFilters.WithInParameter.Tests.cs +++ b/Tests/aweXpect.Reflection.Tests/Filters/ConstructorFilters.WithInParameter.Tests.cs @@ -59,12 +59,110 @@ public async Task WithType_WithName_ShouldFilterForConstructorsWithInParameterOf } } + public sealed class DescriptionTests + { + [Fact] + public async Task ParameterlessFilter_ShouldMatchConstructorWithOnlySomeInParameters() + { + Filtered.Constructors constructors = In.AssemblyContaining() + .Constructors().WithInParameter(); + + await That(constructors).Contains(MixedConstructor()); + } + + [Fact] + public async Task OfType_ShouldDescribeWithInModifier() + { + Filtered.Constructors constructors = In.AssemblyContaining() + .Constructors().WithInParameter(); + + await That(constructors.GetDescription()).Contains("with in modifier"); + } + + [Fact] + public async Task OfTypeWithName_ShouldDescribeWithInModifier() + { + Filtered.Constructors constructors = In.AssemblyContaining() + .Constructors().WithInParameter("value"); + + await That(constructors.GetDescription()).Contains("with in modifier"); + } + + [Fact] + public async Task ByName_ShouldDescribeWithInModifier() + { + Filtered.Constructors constructors = In.AssemblyContaining() + .Constructors().WithInParameter("value"); + + await That(constructors.GetDescription()).Contains("with in modifier"); + } + + [Fact] + public async Task ExactlyOfType_ShouldDescribeWithInModifier() + { + Filtered.Constructors constructors = In.AssemblyContaining() + .Constructors().WithInParameterExactly(); + + await That(constructors.GetDescription()).Contains("with in modifier"); + } + + [Fact] + public async Task ExactlyOfTypeWithName_ShouldDescribeWithInModifier() + { + Filtered.Constructors constructors = In.AssemblyContaining() + .Constructors().WithInParameterExactly("value"); + + await That(constructors.GetDescription()).Contains("with in modifier"); + } + +#pragma warning disable CA2263 + [Fact] + public async Task OfType_UsingType_ShouldDescribeWithInModifier() + { + Filtered.Constructors constructors = In.AssemblyContaining() + .Constructors().WithInParameter(typeof(int)); + + await That(constructors.GetDescription()).Contains("with in modifier"); + } + + [Fact] + public async Task OfTypeWithName_UsingType_ShouldDescribeWithInModifier() + { + Filtered.Constructors constructors = In.AssemblyContaining() + .Constructors().WithInParameter(typeof(int), "value"); + + await That(constructors.GetDescription()).Contains("with in modifier"); + } + + [Fact] + public async Task ExactlyOfType_UsingType_ShouldDescribeWithInModifier() + { + Filtered.Constructors constructors = In.AssemblyContaining() + .Constructors().WithInParameterExactly(typeof(int)); + + await That(constructors.GetDescription()).Contains("with in modifier"); + } + + [Fact] + public async Task ExactlyOfTypeWithName_UsingType_ShouldDescribeWithInModifier() + { + Filtered.Constructors constructors = In.AssemblyContaining() + .Constructors().WithInParameterExactly(typeof(int), "value"); + + await That(constructors.GetDescription()).Contains("with in modifier"); + } +#pragma warning restore CA2263 + } + private static ConstructorInfo? InParameterConstructor() => typeof(ClassWithInParameterConstructor).GetConstructors().Single(); private static ConstructorInfo? PlainConstructor() => typeof(ClassWithPlainConstructor).GetConstructors().Single(); + private static ConstructorInfo? MixedConstructor() + => typeof(ClassWithMixedConstructor).GetConstructors().Single(); + // ReSharper disable UnusedMember.Local // ReSharper disable UnusedParameter.Local private class ClassWithInParameterConstructor @@ -80,6 +178,13 @@ public ClassWithPlainConstructor(int value) { } } + + private class ClassWithMixedConstructor + { + public ClassWithMixedConstructor(in int value, string other) + { + } + } // ReSharper restore UnusedParameter.Local // ReSharper restore UnusedMember.Local } diff --git a/Tests/aweXpect.Reflection.Tests/Filters/ConstructorFilters.WithOptionalParameter.Tests.cs b/Tests/aweXpect.Reflection.Tests/Filters/ConstructorFilters.WithOptionalParameter.Tests.cs index 280631c8..ec2a0165 100644 --- a/Tests/aweXpect.Reflection.Tests/Filters/ConstructorFilters.WithOptionalParameter.Tests.cs +++ b/Tests/aweXpect.Reflection.Tests/Filters/ConstructorFilters.WithOptionalParameter.Tests.cs @@ -59,12 +59,110 @@ public async Task WithType_WithName_ShouldFilterForConstructorsWithOptionalParam } } + public sealed class DescriptionTests + { + [Fact] + public async Task ParameterlessFilter_ShouldMatchConstructorWithOnlySomeOptionalParameters() + { + Filtered.Constructors constructors = In.AssemblyContaining() + .Constructors().WithOptionalParameter(); + + await That(constructors).Contains(MixedConstructor()); + } + + [Fact] + public async Task OfType_ShouldDescribeWithOptionalModifier() + { + Filtered.Constructors constructors = In.AssemblyContaining() + .Constructors().WithOptionalParameter(); + + await That(constructors.GetDescription()).Contains("with optional modifier"); + } + + [Fact] + public async Task OfTypeWithName_ShouldDescribeWithOptionalModifier() + { + Filtered.Constructors constructors = In.AssemblyContaining() + .Constructors().WithOptionalParameter("value"); + + await That(constructors.GetDescription()).Contains("with optional modifier"); + } + + [Fact] + public async Task ByName_ShouldDescribeWithOptionalModifier() + { + Filtered.Constructors constructors = In.AssemblyContaining() + .Constructors().WithOptionalParameter("value"); + + await That(constructors.GetDescription()).Contains("with optional modifier"); + } + + [Fact] + public async Task ExactlyOfType_ShouldDescribeWithOptionalModifier() + { + Filtered.Constructors constructors = In.AssemblyContaining() + .Constructors().WithOptionalParameterExactly(); + + await That(constructors.GetDescription()).Contains("with optional modifier"); + } + + [Fact] + public async Task ExactlyOfTypeWithName_ShouldDescribeWithOptionalModifier() + { + Filtered.Constructors constructors = In.AssemblyContaining() + .Constructors().WithOptionalParameterExactly("value"); + + await That(constructors.GetDescription()).Contains("with optional modifier"); + } + +#pragma warning disable CA2263 + [Fact] + public async Task OfType_UsingType_ShouldDescribeWithOptionalModifier() + { + Filtered.Constructors constructors = In.AssemblyContaining() + .Constructors().WithOptionalParameter(typeof(int)); + + await That(constructors.GetDescription()).Contains("with optional modifier"); + } + + [Fact] + public async Task OfTypeWithName_UsingType_ShouldDescribeWithOptionalModifier() + { + Filtered.Constructors constructors = In.AssemblyContaining() + .Constructors().WithOptionalParameter(typeof(int), "value"); + + await That(constructors.GetDescription()).Contains("with optional modifier"); + } + + [Fact] + public async Task ExactlyOfType_UsingType_ShouldDescribeWithOptionalModifier() + { + Filtered.Constructors constructors = In.AssemblyContaining() + .Constructors().WithOptionalParameterExactly(typeof(int)); + + await That(constructors.GetDescription()).Contains("with optional modifier"); + } + + [Fact] + public async Task ExactlyOfTypeWithName_UsingType_ShouldDescribeWithOptionalModifier() + { + Filtered.Constructors constructors = In.AssemblyContaining() + .Constructors().WithOptionalParameterExactly(typeof(int), "value"); + + await That(constructors.GetDescription()).Contains("with optional modifier"); + } +#pragma warning restore CA2263 + } + private static ConstructorInfo? OptionalParameterConstructor() => typeof(ClassWithOptionalParameterConstructor).GetConstructors().Single(); private static ConstructorInfo? PlainConstructor() => typeof(ClassWithPlainConstructor).GetConstructors().Single(); + private static ConstructorInfo? MixedConstructor() + => typeof(ClassWithMixedConstructor).GetConstructors().Single(); + // ReSharper disable UnusedMember.Local // ReSharper disable UnusedParameter.Local private class ClassWithOptionalParameterConstructor @@ -80,6 +178,13 @@ public ClassWithPlainConstructor(int value) { } } + + private class ClassWithMixedConstructor + { + public ClassWithMixedConstructor(string other, int value = 0) + { + } + } // ReSharper restore UnusedParameter.Local // ReSharper restore UnusedMember.Local } diff --git a/Tests/aweXpect.Reflection.Tests/Filters/ConstructorFilters.WithOutParameter.Tests.cs b/Tests/aweXpect.Reflection.Tests/Filters/ConstructorFilters.WithOutParameter.Tests.cs index 6b4f8fdf..4a5c1b59 100644 --- a/Tests/aweXpect.Reflection.Tests/Filters/ConstructorFilters.WithOutParameter.Tests.cs +++ b/Tests/aweXpect.Reflection.Tests/Filters/ConstructorFilters.WithOutParameter.Tests.cs @@ -59,12 +59,110 @@ public async Task WithType_WithName_ShouldFilterForConstructorsWithOutParameterO } } + public sealed class DescriptionTests + { + [Fact] + public async Task ParameterlessFilter_ShouldMatchConstructorWithOnlySomeOutParameters() + { + Filtered.Constructors constructors = In.AssemblyContaining() + .Constructors().WithOutParameter(); + + await That(constructors).Contains(MixedConstructor()); + } + + [Fact] + public async Task OfType_ShouldDescribeWithOutModifier() + { + Filtered.Constructors constructors = In.AssemblyContaining() + .Constructors().WithOutParameter(); + + await That(constructors.GetDescription()).Contains("with out modifier"); + } + + [Fact] + public async Task OfTypeWithName_ShouldDescribeWithOutModifier() + { + Filtered.Constructors constructors = In.AssemblyContaining() + .Constructors().WithOutParameter("value"); + + await That(constructors.GetDescription()).Contains("with out modifier"); + } + + [Fact] + public async Task ByName_ShouldDescribeWithOutModifier() + { + Filtered.Constructors constructors = In.AssemblyContaining() + .Constructors().WithOutParameter("value"); + + await That(constructors.GetDescription()).Contains("with out modifier"); + } + + [Fact] + public async Task ExactlyOfType_ShouldDescribeWithOutModifier() + { + Filtered.Constructors constructors = In.AssemblyContaining() + .Constructors().WithOutParameterExactly(); + + await That(constructors.GetDescription()).Contains("with out modifier"); + } + + [Fact] + public async Task ExactlyOfTypeWithName_ShouldDescribeWithOutModifier() + { + Filtered.Constructors constructors = In.AssemblyContaining() + .Constructors().WithOutParameterExactly("value"); + + await That(constructors.GetDescription()).Contains("with out modifier"); + } + +#pragma warning disable CA2263 + [Fact] + public async Task OfType_UsingType_ShouldDescribeWithOutModifier() + { + Filtered.Constructors constructors = In.AssemblyContaining() + .Constructors().WithOutParameter(typeof(int)); + + await That(constructors.GetDescription()).Contains("with out modifier"); + } + + [Fact] + public async Task OfTypeWithName_UsingType_ShouldDescribeWithOutModifier() + { + Filtered.Constructors constructors = In.AssemblyContaining() + .Constructors().WithOutParameter(typeof(int), "value"); + + await That(constructors.GetDescription()).Contains("with out modifier"); + } + + [Fact] + public async Task ExactlyOfType_UsingType_ShouldDescribeWithOutModifier() + { + Filtered.Constructors constructors = In.AssemblyContaining() + .Constructors().WithOutParameterExactly(typeof(int)); + + await That(constructors.GetDescription()).Contains("with out modifier"); + } + + [Fact] + public async Task ExactlyOfTypeWithName_UsingType_ShouldDescribeWithOutModifier() + { + Filtered.Constructors constructors = In.AssemblyContaining() + .Constructors().WithOutParameterExactly(typeof(int), "value"); + + await That(constructors.GetDescription()).Contains("with out modifier"); + } +#pragma warning restore CA2263 + } + private static ConstructorInfo? OutParameterConstructor() => typeof(ClassWithOutParameterConstructor).GetConstructors().Single(); private static ConstructorInfo? PlainConstructor() => typeof(ClassWithPlainConstructor).GetConstructors().Single(); + private static ConstructorInfo? MixedConstructor() + => typeof(ClassWithMixedConstructor).GetConstructors().Single(); + // ReSharper disable UnusedMember.Local // ReSharper disable UnusedParameter.Local private class ClassWithOutParameterConstructor @@ -81,6 +179,14 @@ public ClassWithPlainConstructor(int value) { } } + + private class ClassWithMixedConstructor + { + public ClassWithMixedConstructor(out int value, string other) + { + value = 0; + } + } // ReSharper restore UnusedParameter.Local // ReSharper restore UnusedMember.Local } diff --git a/Tests/aweXpect.Reflection.Tests/Filters/ConstructorFilters.WithParameterExactly.Tests.cs b/Tests/aweXpect.Reflection.Tests/Filters/ConstructorFilters.WithParameterExactly.Tests.cs index 10616818..59e84a29 100644 --- a/Tests/aweXpect.Reflection.Tests/Filters/ConstructorFilters.WithParameterExactly.Tests.cs +++ b/Tests/aweXpect.Reflection.Tests/Filters/ConstructorFilters.WithParameterExactly.Tests.cs @@ -48,7 +48,7 @@ await That(constructors).IsEqualTo([ typeof(TestClass).GetConstructor([typeof(DummyBase),])!, ]).InAnyOrder(); await That(constructors.GetDescription()) - .IsEqualTo("constructors with parameter of exact type ").AsPrefix(); + .Contains("and name equal to \"parameter\""); } [Fact] @@ -91,7 +91,7 @@ await That(constructors).IsEqualTo([ typeof(TestClass).GetConstructor([typeof(DummyBase),])!, ]).InAnyOrder(); await That(constructors.GetDescription()) - .IsEqualTo("constructors with parameter of exact type ").AsPrefix(); + .Contains("and name equal to \"parameter\""); } } diff --git a/Tests/aweXpect.Reflection.Tests/Filters/ConstructorFilters.WithParameterModifier.Tests.cs b/Tests/aweXpect.Reflection.Tests/Filters/ConstructorFilters.WithParameterModifier.Tests.cs index c0e1f8cb..f42f451b 100644 --- a/Tests/aweXpect.Reflection.Tests/Filters/ConstructorFilters.WithParameterModifier.Tests.cs +++ b/Tests/aweXpect.Reflection.Tests/Filters/ConstructorFilters.WithParameterModifier.Tests.cs @@ -31,6 +31,9 @@ public async Task WithOutModifier_ShouldFilterForOutParameterOfType() await That(constructors).Contains(OutIntConstructor()); await That(constructors).DoesNotContain(PlainIntConstructor()); + await That(constructors.GetDescription()) + .IsEqualTo("constructors with parameter of type int and with out modifier in assembly") + .AsPrefix(); } [Fact] @@ -41,6 +44,9 @@ public async Task WithInModifier_ShouldFilterForInParameterOfType() await That(constructors).Contains(InIntConstructor()); await That(constructors).DoesNotContain(PlainIntConstructor()); + await That(constructors.GetDescription()) + .IsEqualTo("constructors with parameter of type int and with in modifier in assembly") + .AsPrefix(); } [Fact] @@ -51,6 +57,9 @@ public async Task WithOptionalModifier_ShouldFilterForOptionalParameterOfType() await That(constructors).Contains(OptionalIntConstructor()); await That(constructors).DoesNotContain(PlainIntConstructor()); + await That(constructors.GetDescription()) + .IsEqualTo("constructors with parameter of type int and with optional modifier in assembly") + .AsPrefix(); } [Fact] @@ -60,6 +69,9 @@ public async Task WithParamsModifier_ShouldFilterForParamsParameterOfType() .Constructors().WithParameter().WithParamsModifier(); await That(constructors).Contains(ParamsIntConstructor()); + await That(constructors.GetDescription()) + .IsEqualTo("constructors with parameter of type int[] and with params modifier in assembly") + .AsPrefix(); } } diff --git a/Tests/aweXpect.Reflection.Tests/Filters/ConstructorFilters.WithParamsParameter.Tests.cs b/Tests/aweXpect.Reflection.Tests/Filters/ConstructorFilters.WithParamsParameter.Tests.cs index 9f57505f..deaefd12 100644 --- a/Tests/aweXpect.Reflection.Tests/Filters/ConstructorFilters.WithParamsParameter.Tests.cs +++ b/Tests/aweXpect.Reflection.Tests/Filters/ConstructorFilters.WithParamsParameter.Tests.cs @@ -59,12 +59,110 @@ public async Task WithType_WithName_ShouldFilterForConstructorsWithParamsParamet } } + public sealed class DescriptionTests + { + [Fact] + public async Task ParameterlessFilter_ShouldMatchConstructorWithOnlySomeParamsParameters() + { + Filtered.Constructors constructors = In.AssemblyContaining() + .Constructors().WithParamsParameter(); + + await That(constructors).Contains(MixedConstructor()); + } + + [Fact] + public async Task OfType_ShouldDescribeWithParamsModifier() + { + Filtered.Constructors constructors = In.AssemblyContaining() + .Constructors().WithParamsParameter(); + + await That(constructors.GetDescription()).Contains("with params modifier"); + } + + [Fact] + public async Task OfTypeWithName_ShouldDescribeWithParamsModifier() + { + Filtered.Constructors constructors = In.AssemblyContaining() + .Constructors().WithParamsParameter("values"); + + await That(constructors.GetDescription()).Contains("with params modifier"); + } + + [Fact] + public async Task ByName_ShouldDescribeWithParamsModifier() + { + Filtered.Constructors constructors = In.AssemblyContaining() + .Constructors().WithParamsParameter("values"); + + await That(constructors.GetDescription()).Contains("with params modifier"); + } + + [Fact] + public async Task ExactlyOfType_ShouldDescribeWithParamsModifier() + { + Filtered.Constructors constructors = In.AssemblyContaining() + .Constructors().WithParamsParameterExactly(); + + await That(constructors.GetDescription()).Contains("with params modifier"); + } + + [Fact] + public async Task ExactlyOfTypeWithName_ShouldDescribeWithParamsModifier() + { + Filtered.Constructors constructors = In.AssemblyContaining() + .Constructors().WithParamsParameterExactly("values"); + + await That(constructors.GetDescription()).Contains("with params modifier"); + } + +#pragma warning disable CA2263 + [Fact] + public async Task OfType_UsingType_ShouldDescribeWithParamsModifier() + { + Filtered.Constructors constructors = In.AssemblyContaining() + .Constructors().WithParamsParameter(typeof(int[])); + + await That(constructors.GetDescription()).Contains("with params modifier"); + } + + [Fact] + public async Task OfTypeWithName_UsingType_ShouldDescribeWithParamsModifier() + { + Filtered.Constructors constructors = In.AssemblyContaining() + .Constructors().WithParamsParameter(typeof(int[]), "values"); + + await That(constructors.GetDescription()).Contains("with params modifier"); + } + + [Fact] + public async Task ExactlyOfType_UsingType_ShouldDescribeWithParamsModifier() + { + Filtered.Constructors constructors = In.AssemblyContaining() + .Constructors().WithParamsParameterExactly(typeof(int[])); + + await That(constructors.GetDescription()).Contains("with params modifier"); + } + + [Fact] + public async Task ExactlyOfTypeWithName_UsingType_ShouldDescribeWithParamsModifier() + { + Filtered.Constructors constructors = In.AssemblyContaining() + .Constructors().WithParamsParameterExactly(typeof(int[]), "values"); + + await That(constructors.GetDescription()).Contains("with params modifier"); + } +#pragma warning restore CA2263 + } + private static ConstructorInfo? ParamsParameterConstructor() => typeof(ClassWithParamsParameterConstructor).GetConstructors().Single(); private static ConstructorInfo? PlainConstructor() => typeof(ClassWithPlainConstructor).GetConstructors().Single(); + private static ConstructorInfo? MixedConstructor() + => typeof(ClassWithMixedConstructor).GetConstructors().Single(); + // ReSharper disable UnusedMember.Local // ReSharper disable UnusedParameter.Local private class ClassWithParamsParameterConstructor @@ -80,6 +178,13 @@ public ClassWithPlainConstructor(int[] values) { } } + + private class ClassWithMixedConstructor + { + public ClassWithMixedConstructor(string other, params int[] values) + { + } + } // ReSharper restore UnusedParameter.Local // ReSharper restore UnusedMember.Local } diff --git a/Tests/aweXpect.Reflection.Tests/Filters/ConstructorFilters.WithRefParameter.Tests.cs b/Tests/aweXpect.Reflection.Tests/Filters/ConstructorFilters.WithRefParameter.Tests.cs index fe09456a..4a3135d2 100644 --- a/Tests/aweXpect.Reflection.Tests/Filters/ConstructorFilters.WithRefParameter.Tests.cs +++ b/Tests/aweXpect.Reflection.Tests/Filters/ConstructorFilters.WithRefParameter.Tests.cs @@ -59,12 +59,110 @@ public async Task WithType_WithName_ShouldFilterForConstructorsWithRefParameterO } } + public sealed class DescriptionTests + { + [Fact] + public async Task ParameterlessFilter_ShouldMatchConstructorWithOnlySomeRefParameters() + { + Filtered.Constructors constructors = In.AssemblyContaining() + .Constructors().WithRefParameter(); + + await That(constructors).Contains(MixedConstructor()); + } + + [Fact] + public async Task OfType_ShouldDescribeWithRefModifier() + { + Filtered.Constructors constructors = In.AssemblyContaining() + .Constructors().WithRefParameter(); + + await That(constructors.GetDescription()).Contains("with ref modifier"); + } + + [Fact] + public async Task OfTypeWithName_ShouldDescribeWithRefModifier() + { + Filtered.Constructors constructors = In.AssemblyContaining() + .Constructors().WithRefParameter("value"); + + await That(constructors.GetDescription()).Contains("with ref modifier"); + } + + [Fact] + public async Task ByName_ShouldDescribeWithRefModifier() + { + Filtered.Constructors constructors = In.AssemblyContaining() + .Constructors().WithRefParameter("value"); + + await That(constructors.GetDescription()).Contains("with ref modifier"); + } + + [Fact] + public async Task ExactlyOfType_ShouldDescribeWithRefModifier() + { + Filtered.Constructors constructors = In.AssemblyContaining() + .Constructors().WithRefParameterExactly(); + + await That(constructors.GetDescription()).Contains("with ref modifier"); + } + + [Fact] + public async Task ExactlyOfTypeWithName_ShouldDescribeWithRefModifier() + { + Filtered.Constructors constructors = In.AssemblyContaining() + .Constructors().WithRefParameterExactly("value"); + + await That(constructors.GetDescription()).Contains("with ref modifier"); + } + +#pragma warning disable CA2263 + [Fact] + public async Task OfType_UsingType_ShouldDescribeWithRefModifier() + { + Filtered.Constructors constructors = In.AssemblyContaining() + .Constructors().WithRefParameter(typeof(int)); + + await That(constructors.GetDescription()).Contains("with ref modifier"); + } + + [Fact] + public async Task OfTypeWithName_UsingType_ShouldDescribeWithRefModifier() + { + Filtered.Constructors constructors = In.AssemblyContaining() + .Constructors().WithRefParameter(typeof(int), "value"); + + await That(constructors.GetDescription()).Contains("with ref modifier"); + } + + [Fact] + public async Task ExactlyOfType_UsingType_ShouldDescribeWithRefModifier() + { + Filtered.Constructors constructors = In.AssemblyContaining() + .Constructors().WithRefParameterExactly(typeof(int)); + + await That(constructors.GetDescription()).Contains("with ref modifier"); + } + + [Fact] + public async Task ExactlyOfTypeWithName_UsingType_ShouldDescribeWithRefModifier() + { + Filtered.Constructors constructors = In.AssemblyContaining() + .Constructors().WithRefParameterExactly(typeof(int), "value"); + + await That(constructors.GetDescription()).Contains("with ref modifier"); + } +#pragma warning restore CA2263 + } + private static ConstructorInfo? RefParameterConstructor() => typeof(ClassWithRefParameterConstructor).GetConstructors().Single(); private static ConstructorInfo? PlainConstructor() => typeof(ClassWithPlainConstructor).GetConstructors().Single(); + private static ConstructorInfo? MixedConstructor() + => typeof(ClassWithMixedConstructor).GetConstructors().Single(); + // ReSharper disable UnusedMember.Local // ReSharper disable UnusedParameter.Local private class ClassWithRefParameterConstructor @@ -81,6 +179,14 @@ public ClassWithPlainConstructor(int value) { } } + + private class ClassWithMixedConstructor + { + public ClassWithMixedConstructor(ref int value, string other) + { + value = 0; + } + } // ReSharper restore UnusedParameter.Local // ReSharper restore UnusedMember.Local }