protected override void Check()
		{
			var c1 = new C5();
			var c2 = new C6();
			var c3 = new C6();
			var m = new Model();

			m.AddRootComponents(c2, c1, c3);
			m.Bind(c1.RequiredPorts.M = c2.ProvidedPorts.N);
			m.Bind(c1.RequiredPorts.M = c3.ProvidedPorts.N);

			Tests.RaisesWith<AmbiguousBindingsException>(() => m.Seal(),
				e => e.RequiredPort.ShouldBe(m.Metadata.RootComponent.Subcomponents[1].RequiredPorts[0]));
		}
		protected override void Check()
		{
			var c = new C4();
			var m = new Model();
			m.AddRootComponent(c);
			m.Bind(c.RequiredPorts.M = c.ProvidedPorts.A);

			Tests.RaisesWith<AmbiguousBindingsException>(() => m.Seal(),
				e => e.RequiredPort.ShouldBe(m.Metadata.RootComponent.Subcomponents[0].RequiredPorts[0]));
		}
Example #3
0
		protected override void Check()
		{
			var x = new X();
			var y = new Y();
			var m = new Model();

			m.AddRootComponents(x, y);
			m.Bind(y.RequiredPorts.M = x.ProvidedPorts.N);
			m.Seal();

			m.Metadata.Bindings.Length.ShouldBe(1);
		}
Example #4
0
		protected override void Check()
		{
			var x1 = new X1();
			var x2 = new X2();
			var m = new Model();

			m.AddRootComponents(new X3(x1, x2));
			m.Bind(x1.RequiredPorts.M = x2.ProvidedPorts.M);
			m.Seal();

			m.Metadata.Bindings.Length.ShouldBe(1);
		}
Example #5
0
		protected override void Check()
		{
			var x1 = new X1();
			var x2 = new X2();
			var m = new Model();

			m.AddRootComponents(new X3(x1, x2));
			m.Bind(x1.RequiredPorts.M = x2.ProvidedPorts.M);
			m.Seal();

			m.Metadata.Bindings[0].DeclaringComponent.ShouldBe(m.Metadata.RootComponent);
			m.Metadata.Bindings[0].ProvidedPort.ShouldBe(x2.Metadata.ProvidedPorts[0]);
			m.Metadata.Bindings[0].RequiredPort.ShouldBe(x1.Metadata.RequiredPorts[0]);
		}
Example #6
0
		private void Q(X2 x1, X2 x2, Model m)
		{
			m.Bind(x1.RequiredPorts.N = x2.ProvidedPorts.M);
			this.In.GetModel().Bind(x1.RequiredPorts.N = x2.ProvidedPorts.M);
		}
		private static void Bind(Model m, X x)
		{
			m.Bind(x.RequiredPorts.N = x.ProvidedPorts.M);
		}