public void GetInstrumentInfo_DLS_SimOnly() { TestRuntime.AssertSystemVersion(PlatformName.iOS, 7, 0, throwIfOtherPlatform: false); if (Runtime.Arch == Arch.DEVICE) { Assert.Ignore("Use local file system (need a smaller sample)"); } using (NSUrl url = new NSUrl(local_dls)) { var info = SoundBank.GetInstrumentInfo(url); Assert.That(info.Length, Is.EqualTo(235), "Length"); var first = info [0]; Assert.That(first.Dictionary.Count, Is.EqualTo((nuint)4), "first.Count"); Assert.That(first.Name, Is.EqualTo("Piano 1 "), "first.name"); Assert.That(first.MSB, Is.EqualTo(121), "first.MSB"); Assert.That(first.LSB, Is.EqualTo(0), "first.LSB"); Assert.That(first.Program, Is.EqualTo(0), "first.program"); var last = info [234].Dictionary; Assert.That(last.Count, Is.EqualTo((nuint)4), "last.Count"); Assert.That(last [InstrumentInfo.NameKey].ToString(), Is.EqualTo("SFX "), "last.Name"); Assert.That((last [InstrumentInfo.MSBKey] as NSNumber).Int32Value, Is.EqualTo(120), "last.MSB"); Assert.That((last [InstrumentInfo.LSBKey] as NSNumber).Int32Value, Is.EqualTo(0), "last.LSB"); Assert.That((last [InstrumentInfo.ProgramKey] as NSNumber).Int32Value, Is.EqualTo(56), "last.Program"); } }
public void GetInstrumentInfo() { TestRuntime.AssertSystemVersion(PlatformName.iOS, 7, 0, throwIfOtherPlatform: false); TestRuntime.AssertSystemVersion(PlatformName.MacOSX, 10, 9, throwIfOtherPlatform: false); Assert.Throws <ArgumentNullException> (delegate { SoundBank.GetInstrumentInfo(null); }, "null"); using (NSUrl url = new NSUrl("http://www.xamarin.com")) { Assert.Null(SoundBank.GetInstrumentInfo(url), "Not a SoundBank"); } }
public void GetInstrumentInfo() { if (!TestRuntime.CheckSystemAndSDKVersion(7, 0)) { Assert.Ignore("requires iOS 7"); } Assert.Throws <ArgumentNullException> (delegate { SoundBank.GetInstrumentInfo(null); }, "null"); using (NSUrl url = new NSUrl("http://www.xamarin.com")) { Assert.Null(SoundBank.GetInstrumentInfo(url), "Not a SoundBank"); } }