Browse Source

CmsKit - Update TagRepository Tests

pull/8143/head
enisn 6 years ago
parent
commit
0a7543a803
  1. 4
      modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Tags/EfCoreTagRepository.cs
  2. 17
      modules/cms-kit/test/Volo.CmsKit.TestBase/Tags/TagRepository_Test.cs

4
modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Tags/EfCoreTagRepository.cs

@ -96,8 +96,8 @@ namespace Volo.CmsKit.Tags
.WhereIf( .WhereIf(
!filter.IsNullOrEmpty(), !filter.IsNullOrEmpty(),
x => x =>
x.Name.ToLower().Contains(filter) || x.Name.ToLower().Contains(filter.ToLower()) ||
x.EntityType.ToLower().Contains(filter)); x.EntityType.ToLower().Contains(filter.ToLower()));
} }
} }
} }

17
modules/cms-kit/test/Volo.CmsKit.TestBase/Tags/TagRepository_Test.cs

@ -112,5 +112,22 @@ namespace Volo.CmsKit.Tags
tags.Count.ShouldBe(0); tags.Count.ShouldBe(0);
} }
[Fact]
public async Task Should_GetList_With_Filter()
{
var tags = await _tagRepository.GetListAsync(_cmsKitTestData.TagName_1);
tags.ShouldNotBeNull();
tags.Count.ShouldBe(1);
}
[Fact]
public async Task Should_GetCount_With_Filter()
{
var count = await _tagRepository.GetCountAsync(_cmsKitTestData.TagName_1);
count.ShouldBe(1);
}
} }
} }
Loading…
Cancel
Save