public void NoBinderInstanceReturnedIfNoAttributeOnSourceClass() { NoListenerSource source = new NoListenerSource(); InstrumentationAttacherFactory factory = new InstrumentationAttacherFactory(); ConfigurationReflectionCache reflectionCache = new ConfigurationReflectionCache(); IInstrumentationAttacher createdAttacher = factory.CreateBinder(source, new object[0], reflectionCache); Assert.AreSame(typeof(NoBindingInstrumentationAttacher), createdAttacher.GetType()); }
public void ExplicitBinderInstanceReturnedIfTwoArgumentAttributeOnSourceClass() { ExplicitBindingSource source = new ExplicitBindingSource(); InstrumentationAttacherFactory factory = new InstrumentationAttacherFactory(); ConfigurationReflectionCache reflectionCache = new ConfigurationReflectionCache(); IInstrumentationAttacher createdAttacher = factory.CreateBinder(source, new object[0], reflectionCache); Assert.AreSame(typeof(ExplicitInstrumentationAttacher), createdAttacher.GetType()); }
public void InstrumentationUsesExplicitBinder() { byte[] key = Guid.NewGuid().ToByteArray(); InstrumentationAttacherFactory attacherFactory = new InstrumentationAttacherFactory(); IInstrumentationAttacher binder = attacherFactory.CreateBinder(provider.GetInstrumentationEventProvider(), new object[] { "foo", true, true, true }, new ConfigurationReflectionCache()); binder.BindInstrumentation(); Assert.AreSame(typeof(ExplicitInstrumentationAttacher), binder.GetType()); }