From 16c29cf7d3b1ad5ea75f6368beab91e1ce5b0c35 Mon Sep 17 00:00:00 2001 From: Dennis Doomen Date: Fri, 18 Oct 2024 20:53:55 +0200 Subject: [PATCH] SAVEPOINT --- .../TypeExtensionsSpecs.GetProperties.cs | 40 +++++++++++++++++++ .../FluentAssertions.Specs.csproj | 1 + 2 files changed, 41 insertions(+) diff --git a/Tests/FluentAssertions.Specs/Common/TypeExtensionsSpecs.GetProperties.cs b/Tests/FluentAssertions.Specs/Common/TypeExtensionsSpecs.GetProperties.cs index 8a2cd8a17..816de6721 100644 --- a/Tests/FluentAssertions.Specs/Common/TypeExtensionsSpecs.GetProperties.cs +++ b/Tests/FluentAssertions.Specs/Common/TypeExtensionsSpecs.GetProperties.cs @@ -1,9 +1,49 @@ +#if NET6_0_OR_GREATER +using Xunit; + namespace FluentAssertions.Specs.Common; public partial class TypeExtensionsSpecs { public class GetProperties { + [Fact] + public void Test() + { + // Act + var properties = typeof(SuperClass).GetProperties(); + + // Assert + properties.Should().HaveCount(4); + } + + private class SuperClass : BaseClass, IInterfaceWithDefaultProperty + { + public string NormalProperty { get; set; } + + public new int NewProperty { get; set; } + + public string BarProperty { get; set; } + + public string FooProperty { get; set; } + } + + private class BaseClass + { + public string NewProperty { get; set; } + } + + private interface IInterfaceWithDefaultProperty : IInterfaceWithSingleProperty + { + string FooProperty { get; set; } + + string DefaultProperty => "Default"; + } + private interface IInterfaceWithSingleProperty + { + string BarProperty { get; set; } + } } } +#endif diff --git a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj index e79bf1df4..503ae2861 100644 --- a/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj +++ b/Tests/FluentAssertions.Specs/FluentAssertions.Specs.csproj @@ -7,6 +7,7 @@ false $(NoWarn),IDE0052,1573,1591,1712,CS8002 full + 12