public ListSettingsGroupsResponse ListSettingsGroups(ListSettingsGroupsRequest request)
			{
				throw new NotImplementedException();
			}
		public void TestCacheListSettingsGroups()
		{
			var cache = new TestCacheClient();
			cache.ClearCache();

			var service = new TestConfigurationService();
			object request = new ListSettingsGroupsRequest();
			object response = new ListSettingsGroupsResponse(new List<SettingsGroupDescriptor>());
			var invocation = new TestInvocation
			{
				Target = service,
				Method = typeof(IApplicationConfigurationReadService).GetMethod("ListSettingsGroups", BindingFlags.FlattenHierarchy | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public),
				TargetType = typeof(IApplicationConfigurationReadService),
				Request = request,
				Response = response
			};

			var directive = new ResponseCachingDirective(true, TimeSpan.FromMinutes(1), ResponseCachingSite.Server);
			var advice = new ConcreteResponseCachingAdvice(directive);
			advice.Intercept(invocation);

			var cacheEntry = cache.Get("ListSettingsGroups", new CacheGetOptions(""));
			Assert.IsNotNull(cacheEntry);

			request = new ImportSettingsGroupRequest(
				new SettingsGroupDescriptor("Test", new Version(1,0), "Test", "Test", true), 
				new List<SettingsPropertyDescriptor>(new[]{new SettingsPropertyDescriptor("Test", "Test", "Test", SettingScope.User, "Test") }));
			response = new ImportSettingsGroupResponse();

			invocation = new TestInvocation
			{
				Target = service,
				Method = typeof(IConfigurationService).GetMethod("ImportSettingsGroup", BindingFlags.FlattenHierarchy | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public),
				TargetType = typeof(IConfigurationService),
				Request = request,
				Response = response
			};

			advice = new ConcreteResponseCachingAdvice(null);
			advice.Intercept(invocation);

			cacheEntry = cache.Get("ListSettingsGroups", new CacheGetOptions(""));
			Assert.IsNull(cacheEntry);
		}
Beispiel #3
0
		public ListSettingsGroupsResponse ListSettingsGroups(ListSettingsGroupsRequest request)
		{
			var broker = PersistenceContext.GetBroker<IConfigurationSettingsGroupBroker>();
			return new ListSettingsGroupsResponse(
				CollectionUtils.Map(broker.FindAll(), (ConfigurationSettingsGroup g) => g.GetDescriptor()));
		}