private static void TryResolveByStreamAndPropNameBoth(StreamTypeService service) { // Test lookup by stream name and prop name PropertyResolutionDescriptor desc = service.ResolveByStreamAndPropName( "s4", "Volume", false); Assert.AreEqual(3, desc.StreamNum); Assert.AreEqual(typeof(long?), desc.PropertyType); Assert.AreEqual("Volume", desc.PropertyName); Assert.AreEqual("s4", desc.StreamName); Assert.AreEqual(typeof(SupportMarketDataBean), desc.StreamEventType.UnderlyingType); try { service.ResolveByStreamAndPropName("xxx", "Volume", false); Assert.Fail(); } catch (StreamNotFoundException ex) { // Expected } try { service.ResolveByStreamAndPropName("s4", "xxxx", false); Assert.Fail(); } catch (PropertyNotFoundException ex) { // Expected } }
private static void TryResolveByPropertyName(StreamTypeService service) { // Test lookup by property name only PropertyResolutionDescriptor desc = service.ResolveByPropertyName( "Volume", false); Assert.AreEqual(3, (desc.StreamNum)); Assert.AreEqual(typeof(long?), desc.PropertyType); Assert.AreEqual("Volume", desc.PropertyName); Assert.AreEqual("s4", desc.StreamName); Assert.AreEqual(typeof(SupportMarketDataBean), desc.StreamEventType.UnderlyingType); try { service.ResolveByPropertyName("BoolPrimitive", false); Assert.Fail(); } catch (DuplicatePropertyException ex) { // Expected } try { service.ResolveByPropertyName("xxxx", false); Assert.Fail(); } catch (PropertyNotFoundException ex) { // Expected } }
private static void TryResolveByStreamAndPropNameInOne(StreamTypeService service) { // Test lookup by stream name and prop name PropertyResolutionDescriptor desc = service.ResolveByStreamAndPropName( "s4.Volume", false); Assert.AreEqual(3, desc.StreamNum); Assert.AreEqual(typeof(long?), desc.PropertyType); Assert.AreEqual("Volume", desc.PropertyName); Assert.AreEqual("s4", desc.StreamName); Assert.AreEqual(typeof(SupportMarketDataBean), desc.StreamEventType.UnderlyingType); try { service.ResolveByStreamAndPropName("xxx.Volume", false); Assert.Fail(); } catch (PropertyNotFoundException ex) { // Expected } try { service.ResolveByStreamAndPropName("s4.xxxx", false); Assert.Fail(); } catch (PropertyNotFoundException ex) { // Expected } // resolve by event type alias (table name) desc = service.ResolveByStreamAndPropName("SupportMarketDataBean.Volume", false); Assert.AreEqual(3, desc.StreamNum); // resolve by engine URI plus event type alias desc = service.ResolveByStreamAndPropName( "default.SupportMarketDataBean.Volume", false); Assert.AreEqual(3, desc.StreamNum); }