public void CandidatesTypesCollectionWithNullReferenceWillSetEmptyEmtpyInstrumentedTypes() { Type[] candidateTypes = new Type[] { null }; MockInstallerBuilder builder = new MockInstallerBuilder(candidateTypes, typeof(InstrumentationAAttribute)); Assert.AreEqual(0, builder.InstrumentedTypes.Count); }
public void BuilderWillFillInstallerWithCreatedChildInstallers() { Type[] candidateTypes = new Type[] { typeof(InstrumentedTypeWithAAttribute), typeof(InstrumentedTypeWithAAndBAttributes) }; MockInstallerBuilder builder = new MockInstallerBuilder(candidateTypes, typeof(InstrumentationAAttribute)); Installer parentInstaller = new Installer(); }
public void InstrumentedCandidateTypesCollectionWithoutCorrectAttributeTypesWillSetEmtpyInstrumentedTypes() { Type[] candidateTypes = new Type[] { typeof(InstrumentedTypeWithoutAttributes), typeof(InstrumentedTypeWithBAttribute) }; MockInstallerBuilder builder = new MockInstallerBuilder(candidateTypes, typeof(InstrumentationAAttribute)); Assert.AreEqual(0, builder.InstrumentedTypes.Count); }
public void InstrumentedCandidateTypesCollectionWithCorrectAttributeTypesWillSetNonEmtpyInstrumentedTypes() { Type[] candidateTypes = new Type[] { typeof(InstrumentedTypeWithAAttribute), typeof(InstrumentedTypeWithAAndBAttributes) }; MockInstallerBuilder builder = new MockInstallerBuilder(candidateTypes, typeof(InstrumentationAAttribute)); Assert.AreEqual(2, builder.InstrumentedTypes.Count); Assert.IsTrue(builder.InstrumentedTypes.Contains(typeof(InstrumentedTypeWithAAttribute))); Assert.IsTrue(builder.InstrumentedTypes.Contains(typeof(InstrumentedTypeWithAAndBAttributes))); }
public void BuilderWillOnlyKeepTypesBothInstrumentedAndWithTheCorrectAttribute() { Type[] candidateTypes = new Type[] { typeof(TypeWithoutAttributes), typeof(TypeWithBAttribute), typeof(TypeWithAAttribute), typeof(TypeWithAAndBAttributes), typeof(InstrumentedTypeWithoutAttributes), typeof(InstrumentedTypeWithBAttribute), typeof(InstrumentedTypeWithAAttribute), null, typeof(InstrumentedTypeWithAAndBAttributes) }; MockInstallerBuilder builder = new MockInstallerBuilder(candidateTypes, typeof(InstrumentationAAttribute)); Assert.AreEqual(2, builder.InstrumentedTypes.Count); Assert.IsTrue(builder.InstrumentedTypes.Contains(typeof(InstrumentedTypeWithAAttribute))); Assert.IsTrue(builder.InstrumentedTypes.Contains(typeof(InstrumentedTypeWithAAndBAttributes))); }