From 0a7543a80342871e735eea42574cae70454c8043 Mon Sep 17 00:00:00 2001 From: enisn Date: Fri, 19 Mar 2021 16:34:28 +0300 Subject: [PATCH] CmsKit - Update TagRepository Tests --- .../Volo/CmsKit/Tags/EfCoreTagRepository.cs | 4 ++-- .../Tags/TagRepository_Test.cs | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Tags/EfCoreTagRepository.cs b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Tags/EfCoreTagRepository.cs index f22da7bce7..3949ec61a4 100644 --- a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Tags/EfCoreTagRepository.cs +++ b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Tags/EfCoreTagRepository.cs @@ -96,8 +96,8 @@ namespace Volo.CmsKit.Tags .WhereIf( !filter.IsNullOrEmpty(), x => - x.Name.ToLower().Contains(filter) || - x.EntityType.ToLower().Contains(filter)); + x.Name.ToLower().Contains(filter.ToLower()) || + x.EntityType.ToLower().Contains(filter.ToLower())); } } } diff --git a/modules/cms-kit/test/Volo.CmsKit.TestBase/Tags/TagRepository_Test.cs b/modules/cms-kit/test/Volo.CmsKit.TestBase/Tags/TagRepository_Test.cs index 18cc12df68..97034f9f21 100644 --- a/modules/cms-kit/test/Volo.CmsKit.TestBase/Tags/TagRepository_Test.cs +++ b/modules/cms-kit/test/Volo.CmsKit.TestBase/Tags/TagRepository_Test.cs @@ -112,5 +112,22 @@ namespace Volo.CmsKit.Tags 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); + } } } \ No newline at end of file