forked from fluentassertions/fluentassertions
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
50961b7
commit 5a364dc
Showing
3 changed files
with
52 additions
and
2 deletions.
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
Tests/FluentAssertions.Specs/Common/TypeExtensionsSpecs.GetProperties.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters