interface type fixes & unit test improvements

This commit is contained in:
Hasan Manzak
2023-02-23 01:11:34 +03:00
parent b73f748dba
commit 7ec97810f7
17 changed files with 884 additions and 586 deletions

View File

@@ -10,5 +10,8 @@ namespace SieveUnitTests.Entities
[Sieve(CanFilter = true, CanSort = true)]
public DateTimeOffset DateCreated { get; set; } = DateTimeOffset.UtcNow;
public string DeletedBy { get; set; }
public DateTime? DeletedAt { get; set; }
}
}

View File

@@ -30,5 +30,10 @@ namespace SieveUnitTests.Entities
public Comment TopComment { get; set; }
public Comment FeaturedComment { get; set; }
public string CreatedBy { get; set; }
public DateTime? CreatedAt { get; set; }
public string UpdatedBy { get; set; }
public DateTime? UpdatedAt { get; set; }
}
}

View File

@@ -4,8 +4,12 @@ namespace SieveUnitTests.Entities
{
public class SieveConfigurationForPost : ISieveConfiguration
{
public void Configure(SievePropertyMapper mapper)
public static void ConfigureStatic(SievePropertyMapper mapper)
{
mapper
.Property<Post>(p => p.Id)
.CanSort();
mapper.Property<Post>(p => p.ThisHasNoAttributeButIsAccessible)
.CanSort()
.CanFilter()
@@ -32,6 +36,21 @@ namespace SieveUnitTests.Entities
.Property<Post>(p => p.DateCreated)
.CanSort()
.HasName("CreateDate");
mapper
.Property<Post>(post => post.DeletedBy)
.CanSort()
.HasName("DeletedBy");
mapper
.Property<Post>(post => post.UpdatedBy)
.CanFilter()
.HasName("UpdatedBy");
}
public void Configure(SievePropertyMapper mapper)
{
ConfigureStatic(mapper);
}
}
}