public void GetSetNullComponentList() { TestRuntime.AssertXcodeVersion(9, 0); var types = new List <AudioTypeOutput> { AudioTypeOutput.Generic, AudioTypeOutput.Remote, AudioTypeOutput.VoiceProcessingIO }; foreach (var t in types) { var resources = new ResourceUsageInfo(); resources.IOKitUserClient = new string[] { "CustomUserClient1" }; resources.MachLookUpGlobalName = new string[] { "MachServiceName1" }; resources.NetworkClient = false; resources.TemporaryExceptionReadWrite = false; var componentInfo = new AudioComponentInfo(); componentInfo.Type = t.ToString(); componentInfo.Subtype = "XMPL"; componentInfo.Name = "XMPL"; componentInfo.Version = 1; componentInfo.ResourceUsage = resources; var component = AudioComponent.FindComponent(t); if (component == null) { continue; } //monotouchtests does not have permissions to deal with the hwd. Assert.Throws <ArgumentNullException> (() => component.ComponentList = null); } }
public void GetSetComponentList() { TestRuntime.AssertXcodeVersion(9, 0); #if !MONOMAC var types = new List <AudioTypeOutput> { AudioTypeOutput.Generic, AudioTypeOutput.Remote, AudioTypeOutput.VoiceProcessingIO }; #else var types = new List <AudioTypeOutput> { AudioTypeOutput.Generic, AudioTypeOutput.Default, AudioTypeOutput.HAL, AudioTypeOutput.System, AudioTypeOutput.VoiceProcessingIO }; #endif foreach (var t in types) { var resources = new ResourceUsageInfo(); resources.IOKitUserClient = new string[] { "CustomUserClient1" }; resources.MachLookUpGlobalName = new string[] { "MachServiceName1" }; resources.NetworkClient = false; resources.TemporaryExceptionReadWrite = false; var componentInfo = new AudioComponentInfo(); componentInfo.Type = t.ToString(); componentInfo.Subtype = "XMPL"; componentInfo.Name = "XMPL"; componentInfo.Version = 1; componentInfo.ResourceUsage = resources; var component = AudioComponent.FindComponent(t); if (component == null) { continue; } var l = component.ComponentList; Assert.IsNull(l, "List is not null."); l = new AudioComponentInfo[] { componentInfo }; //monotouchtests does not have permissions to deal with the hwd. Assert.Throws <InvalidOperationException> (() => component.ComponentList = l); } }