public void IsComponentOverridden() { var pipeline = new TestBuildPipelineWithComponents(); var configB = BuildConfiguration.CreateInstance(c => c.SetComponent <TestBuildComponentA>()); var configA = BuildConfiguration.CreateInstance(c => { c.SetComponent <TestBuildComponentA>(); c.SetComponent <TestBuildComponentB>(); c.AddDependency(configB); }); var context = new TestContextBase(pipeline, configA); Assert.That(context.IsComponentOverridden <TestBuildComponentA>(), Is.True); Assert.That(context.IsComponentOverridden <TestBuildComponentB>(), Is.False); Assert.Throws <InvalidOperationException>(() => context.IsComponentOverridden <TestBuildComponentC>()); Assert.Throws <ArgumentNullException>(() => context.IsComponentOverridden(null)); Assert.Throws <InvalidOperationException>(() => context.IsComponentOverridden(typeof(object))); Assert.Throws <InvalidOperationException>(() => context.IsComponentOverridden(typeof(TestBuildComponentInvalid))); }