private string GetSetObjectPropertyResponse(string address) { var queries = UrlHelpers.CrackUrl(address); PropertyInfo info; if (typeof(TObjectProperty) == typeof(ObjectProperty)) { info = BaseSetObjectPropertyParameters <TObjectProperty> .GetPropertyInfoViaTypeLookup((Enum)(object)property); } else if (typeof(TObjectProperty) == typeof(ChannelProperty)) { info = BaseSetObjectPropertyParameters <TObjectProperty> .GetPropertyInfoViaPropertyParameter <Channel>((Enum)(object)property); } else { throw new NotImplementedException($"Handler for object property type {nameof(TObjectProperty)} is not implemented"); } var queryName = BaseSetObjectPropertyParameters <TObjectProperty> .GetParameterNameStatic((Enum)(object)property, info); if (typeof(TObjectProperty) == typeof(ChannelProperty)) { queryName += "1"; //Channel ID used for tests } var val = queries[queryName]; Assert.IsTrue(val == expectedValue, $"The value of property '{property.ToString().ToLower()}' did not match the expected value. Expected '{expectedValue}', received: '{val}'"); return("OK"); }
/// <summary> /// Retrieves an object that defines the dynamic parameters of this cmdlet. /// </summary> /// <returns>An object that defines the dynamic parameters of this cmdlet.</returns> public object GetDynamicParameters() { if (dynamicParams == null) { dynamicParams = new DynamicParameterSet <ChannelProperty>( new[] { ParameterSet.Dynamic, ParameterSet.DynamicManual }, e => BaseSetObjectPropertyParameters <ChannelProperty> .GetPropertyInfoViaPropertyParameter <Channel>(e).Property ); } return(dynamicParams.Parameters); }