-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ksqlDb.RestApi.Client]: PropertyInfoExtractor renamed to MemberInfoE…
…xtractor
- Loading branch information
1 parent
d9c24f7
commit 66f9f16
Showing
3 changed files
with
72 additions
and
39 deletions.
There are no files selected for viewing
71 changes: 71 additions & 0 deletions
71
Tests/ksqlDB.RestApi.Client.Tests/Metadata/MemberInfoExtractorTests.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,71 @@ | ||
using System.Linq.Expressions; | ||
using FluentAssertions; | ||
using ksqlDb.RestApi.Client.Metadata; | ||
using ksqlDb.RestApi.Client.Tests.FluentAPI.Builders; | ||
using NUnit.Framework; | ||
|
||
namespace ksqlDb.RestApi.Client.Tests.Metadata | ||
{ | ||
public class MemberInfoExtractorTests | ||
{ | ||
[Test] | ||
public void GetMembers() | ||
{ | ||
//Arrange | ||
Expression<Func<Payment, decimal>> propertyExpression = c => c.Amount; | ||
|
||
//Act | ||
var memberInfos = propertyExpression.GetMembers().ToList(); | ||
|
||
//Assert | ||
memberInfos.Count().Should().Be(1); | ||
memberInfos.First().Item1.Should().Be(nameof(Payment.Amount)); | ||
} | ||
|
||
[Test] | ||
public void GetPropertyMemberInfo() | ||
{ | ||
//Arrange | ||
Expression<Func<Payment, decimal>> propertyExpression = c => c.Amount; | ||
|
||
//Act | ||
var memberInfo = propertyExpression.GetMemberInfo(); | ||
|
||
//Assert | ||
memberInfo.Name.Should().Be(nameof(Payment.Amount)); | ||
} | ||
|
||
internal record PaymentWithFields | ||
{ | ||
public string Id = null!; | ||
public decimal Amount; | ||
} | ||
|
||
[Test] | ||
public void GetFieldMembers() | ||
{ | ||
//Arrange | ||
Expression<Func<PaymentWithFields, decimal>> propertyExpression = c => c.Amount; | ||
|
||
//Act | ||
var memberInfos = propertyExpression.GetMembers().ToList(); | ||
|
||
//Assert | ||
memberInfos.Count().Should().Be(1); | ||
memberInfos.First().Item1.Should().Be(nameof(PaymentWithFields.Amount)); | ||
} | ||
|
||
[Test] | ||
public void GetFieldMemberInfo() | ||
{ | ||
//Arrange | ||
Expression<Func<PaymentWithFields, decimal>> propertyExpression = c => c.Amount; | ||
|
||
//Act | ||
var memberInfo = propertyExpression.GetMemberInfo(); | ||
|
||
//Assert | ||
memberInfo.Name.Should().Be(nameof(PaymentWithFields.Amount)); | ||
} | ||
} | ||
} |
38 changes: 0 additions & 38 deletions
38
Tests/ksqlDB.RestApi.Client.Tests/Metadata/PropertyInfoExtractorTests.cs
This file was deleted.
Oops, something went wrong.
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