예제 #1
0
        public async Task Settings_Should_Be_Grouped()
        {
            // Arrange
            // The TestSettingDefinitionsProvider should be executed by module system

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

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

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

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

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

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

            setting2.Properties[SettingUiConst.Group1].ShouldBe("TestGroup1");
            setting2.Properties[SettingUiConst.Group2].ShouldBe("TestGroup2");
            setting2.Properties[SettingUiConst.Type].ShouldBe("checkbox");
        }
예제 #2
0
 public virtual Task <List <SettingGroup> > GroupSettingDefinitionsAsync()
 {
     return(_service.GroupSettingDefinitionsAsync());
 }