示例#1
0
        public async Task FindAsync_ShouldWorkProperly_WithExistingFeatureName()
        {
            var result = await blogFeatureRepository.FindAsync(testData.Blog_Id, testData.BlogFeature_1_FeatureName);

            result.ShouldNotBeNull();
            result.FeatureName.ShouldBe(testData.BlogFeature_1_FeatureName);
            result.IsEnabled.ShouldBe(testData.BlogFeature_1_Enabled);
        }
        public async Task SetAsync_ShouldWorkProperly_WithNonExistingFeature()
        {
            var dto = new BlogFeatureInputDto
            {
                FeatureName = "My.Awesome.Feature",
                IsEnabled   = true
            };

            await blogFeatureAdminAppService.SetAsync(testData.Blog_Id, dto);

            var feature = await blogFeatureRepository.FindAsync(testData.Blog_Id, dto.FeatureName);

            feature.ShouldNotBeNull();
            feature.BlogId.ShouldBe(testData.Blog_Id);
            feature.IsEnabled.ShouldBe(dto.IsEnabled);
        }