Update examples
This commit is contained in:
+48
-2
@@ -12,19 +12,37 @@ public sealed class CustomerSearchFilterInitializationRuleTest
|
||||
#region Tests
|
||||
|
||||
[Fact]
|
||||
public void If_the_filter_is_empty___Defaults_are_applied()
|
||||
public void If_the_filter_is_empty___The_skip_default_is_applied()
|
||||
{
|
||||
var filter = new CustomerSearchFilter();
|
||||
|
||||
var initialized = new CustomerSearchFilterInitializationRule().Initialize(filter);
|
||||
|
||||
initialized.Skip.Should().Be(0);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void If_the_filter_is_empty___The_take_default_is_applied()
|
||||
{
|
||||
var filter = new CustomerSearchFilter();
|
||||
|
||||
var initialized = new CustomerSearchFilterInitializationRule().Initialize(filter);
|
||||
|
||||
initialized.Take.Should().Be(50);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void If_the_filter_is_empty___The_sort_by_default_is_applied()
|
||||
{
|
||||
var filter = new CustomerSearchFilter();
|
||||
|
||||
var initialized = new CustomerSearchFilterInitializationRule().Initialize(filter);
|
||||
|
||||
initialized.SortBy.Should().Be(nameof(Customer.LastName));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void If_the_filter_is_already_configured___Values_are_kept()
|
||||
public void If_the_filter_is_already_configured___The_skip_is_kept()
|
||||
{
|
||||
var filter = new CustomerSearchFilter
|
||||
{
|
||||
@@ -36,7 +54,35 @@ public sealed class CustomerSearchFilterInitializationRuleTest
|
||||
var initialized = new CustomerSearchFilterInitializationRule().Initialize(filter);
|
||||
|
||||
initialized.Skip.Should().Be(10);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void If_the_filter_is_already_configured___The_take_is_kept()
|
||||
{
|
||||
var filter = new CustomerSearchFilter
|
||||
{
|
||||
Skip = 10,
|
||||
Take = 5,
|
||||
SortBy = nameof(Customer.EMail)
|
||||
};
|
||||
|
||||
var initialized = new CustomerSearchFilterInitializationRule().Initialize(filter);
|
||||
|
||||
initialized.Take.Should().Be(5);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void If_the_filter_is_already_configured___The_sort_by_is_kept()
|
||||
{
|
||||
var filter = new CustomerSearchFilter
|
||||
{
|
||||
Skip = 10,
|
||||
Take = 5,
|
||||
SortBy = nameof(Customer.EMail)
|
||||
};
|
||||
|
||||
var initialized = new CustomerSearchFilterInitializationRule().Initialize(filter);
|
||||
|
||||
initialized.SortBy.Should().Be(nameof(Customer.EMail));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user