public async Task Settings_Should_Be_Grouped()
        {
            // Arrange
            // The TestSettingDefinitionsProvider should be executed by module system

            // Act
            var groups = await _service.GroupSettingDefinitions();

            // Assert
            var group = groups.Single(g => g.GroupName == "TestGroup1");

            group.GroupDisplayName.ShouldBe("TestGroup1");
            group.SettingDefinitions.Count().ShouldBe(2);

            // The property values of the Test.Setting1 are set with "WithProperty" method
            var setting1 = group.SettingDefinitions.Single(sd => sd.Name == "Test.Setting1");

            setting1.Properties[AbpSettingManagementMvcUIConst.Group1].ShouldBe("TestGroup1");
            setting1.Properties[AbpSettingManagementMvcUIConst.Group2].ShouldBe("TestGroup2");
            setting1.Properties[AbpSettingManagementMvcUIConst.Type].ShouldBe("number");

            // The property values of the Test.Setting2 are from the TestSettingProperties.json file
            var setting2 = group.SettingDefinitions.Single(sd => sd.Name == "Test.Setting2");

            setting2.Properties[AbpSettingManagementMvcUIConst.Group1].ShouldBe("TestGroup1");
            setting2.Properties[AbpSettingManagementMvcUIConst.Group2].ShouldBe("TestGroup2");
            setting2.Properties[AbpSettingManagementMvcUIConst.Type].ShouldBe("checkbox");
        }
Esempio n. 2
0
 public async Task OnGetAsync()
 {
     Groups = await _settingManagementUIAppService.GroupSettingDefinitions();
 }