|
|
@ -109,7 +109,7 @@ public class TestBlackListDataService
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
[Fact]
|
|
|
|
public void GetBannedUser_Success_Positive_Value()
|
|
|
|
public void GetBannedUser_Success_Positive_Value_Ordered_None()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_dbContext.BlackLists.Add(new BlackListEntity { Email = "email@email.com", ExpirationDate = new DateOnly(2024, 03, 30) });
|
|
|
|
_dbContext.BlackLists.Add(new BlackListEntity { Email = "email@email.com", ExpirationDate = new DateOnly(2024, 03, 30) });
|
|
|
|
_dbContext.BlackLists.Add(new BlackListEntity { Email = "eemail@email.com", ExpirationDate = new DateOnly(2024, 03, 30) });
|
|
|
|
_dbContext.BlackLists.Add(new BlackListEntity { Email = "eemail@email.com", ExpirationDate = new DateOnly(2024, 03, 30) });
|
|
|
@ -119,6 +119,31 @@ public class TestBlackListDataService
|
|
|
|
Assert.Equal(3, banResult.Count());
|
|
|
|
Assert.Equal(3, banResult.Count());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
|
|
|
public void GetBannedUser_Success_Positive_Value_Ordered_Email()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_dbContext.BlackLists.Add(new BlackListEntity { Email = "email@email.com", ExpirationDate = new DateOnly(2024, 03, 30) });
|
|
|
|
|
|
|
|
_dbContext.BlackLists.Add(new BlackListEntity { Email = "eemail@email.com", ExpirationDate = new DateOnly(2024, 03, 30) });
|
|
|
|
|
|
|
|
_dbContext.BlackLists.Add(new BlackListEntity { Email = "eeemail@email.com", ExpirationDate = new DateOnly(2024, 03, 30) });
|
|
|
|
|
|
|
|
_dbContext.SaveChanges();
|
|
|
|
|
|
|
|
var banResult = _blackListDataService.GetBannedUsers(1, 3, BlackListOdrerCriteria.ByEmail);
|
|
|
|
|
|
|
|
Assert.Equal(3, banResult.Count());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
|
|
|
public void GetBannedUser_Success_Positive_Value_Ordered_ExpirationDate()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_dbContext.BlackLists.Add(new BlackListEntity { Email = "email@email.com", ExpirationDate = new DateOnly(2024, 03, 30) });
|
|
|
|
|
|
|
|
_dbContext.BlackLists.Add(new BlackListEntity { Email = "eemail@email.com", ExpirationDate = new DateOnly(2024, 03, 30) });
|
|
|
|
|
|
|
|
_dbContext.BlackLists.Add(new BlackListEntity { Email = "eeemail@email.com", ExpirationDate = new DateOnly(2024, 03, 30) });
|
|
|
|
|
|
|
|
_dbContext.SaveChanges();
|
|
|
|
|
|
|
|
var banResult = _blackListDataService.GetBannedUsers(1, 3, BlackListOdrerCriteria.ByExpirationDate);
|
|
|
|
|
|
|
|
Assert.Equal(3, banResult.Count());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
[Fact]
|
|
|
|
public void GetBannedUser_Success_Negative_Value()
|
|
|
|
public void GetBannedUser_Success_Negative_Value()
|
|
|
|
{
|
|
|
|
{
|
|
|
|