Example #1
0
        public void GetComponentTypes()
        {
            var pipeline = new TestBuildPipelineWithComponents();
            var configB  = BuildConfiguration.CreateInstance(c => c.SetComponent <TestBuildComponentB>());
            var configA  = BuildConfiguration.CreateInstance(c =>
            {
                c.SetComponent <TestBuildComponentA>();
                c.AddDependency(configB);
            });
            var context = new TestContextBase(pipeline, configA);

            Assert.That(context.GetComponentTypes(), Is.EquivalentTo(new[] { typeof(TestBuildComponentA), typeof(TestBuildComponentB) }));

            configA.SetComponent <TestBuildComponentC>();
            Assert.Throws <InvalidOperationException>(() => context.GetComponentTypes());
        }