public static void MetaDataService_ComponentIdForProfile(IWrapper wrapper) { var service = new MetaDataService( wrapper.Pipeline.FlowElements .Where(e => typeof(IOnPremiseDeviceDetectionEngine).IsAssignableFrom(e.GetType())) .Cast <IOnPremiseDeviceDetectionEngine>() .ToArray()); var comonentFor15364 = service.ComponentIdForProfile(15364); var comonentFor17017 = service.ComponentIdForProfile(17017); var comonentFor17470 = service.ComponentIdForProfile(17470); var comonentFor18092 = service.ComponentIdForProfile(18092); var comonentFor999999999 = service.ComponentIdForProfile(999999999); var comonentFor0 = service.ComponentIdForProfile(0); // Expect 5 components: // hardware, platform, browser, crawler and metrics. // metrics does not actually exist in the data file and // does not have a default profile so it will be null. Assert.AreEqual((byte)1, comonentFor15364); Assert.AreEqual((byte)2, comonentFor17017); Assert.AreEqual((byte)3, comonentFor17470); Assert.AreEqual((byte)4, comonentFor18092); Assert.IsNull(comonentFor999999999); Assert.IsNull(comonentFor0); }