public void buildTest1() { ComponentId componetId = new ComponentId("Test1", 1, 0, 0, ".Net FrameWork 3.5"); ComponentContext expected = new DefaultComponentContext(componetId); String name = "IComponent_1"; String interfaceName = "IDL:scs/core/IComponent:1.0"; MarshalByRefObject servant = new IComponentServant(expected); expected.AddFacet(name, interfaceName, servant); name = "IComponent_2"; interfaceName = "IDL:scs/core/IComponent:1.0"; servant = new IComponentServant(expected); expected.AddFacet(name, interfaceName, servant); name = "IMetaInterface_3"; interfaceName = "IDL:scs/core/IMetaInterface:1.0"; servant = new IMetaInterfaceServant(expected); expected.AddFacet(name, interfaceName, servant); String componentModel = Resources.Component1; TextReader file = new StringReader(componentModel); XmlTextReader componentInformation = new XmlTextReader(file); XmlComponentBuilder target = new XmlComponentBuilder(componentInformation); ComponentContext actual = target.build(); Assert.IsTrue(expected.Equals(actual)); }
public void buildTest3() { ComponentId componetId = new ComponentId("Test1", 1, 0, 0, ".Net FrameWork 3.5"); ComponentContext expected = new DefaultComponentContext(componetId); String componentModel = Resources.Component6; TextReader file = new StringReader(componentModel); XmlTextReader componentInformation = new XmlTextReader(file); XmlComponentBuilder builder = new XmlComponentBuilder(componentInformation); ComponentContext actual = builder.build(); Assert.IsTrue(expected.Equals(actual)); }
public void buildTest2() { ComponentId componetId = new ComponentId("Test1", 1, 0, 0, ".Net FrameWork 3.5"); ComponentContext expected = new DefaultComponentContext(componetId); String name = "Receptacle1"; String interfaceName = "IDL:scs/core/IMetaInterface:1.0"; expected.AddReceptacle(name, interfaceName, false); name = "Receptacle2"; interfaceName = "IDL:scs/core/IMetaInterface:1.0"; expected.AddReceptacle(name, interfaceName, true); name = "Receptacle3"; interfaceName = "IDL:scs/core/IComponent:1.0"; expected.AddReceptacle(name, interfaceName, false); String componentModel = Resources.Component5; TextReader file = new StringReader(componentModel); XmlTextReader componentInformation = new XmlTextReader(file); XmlComponentBuilder target = new XmlComponentBuilder(componentInformation); ComponentContext actual = target.build(); Assert.IsTrue(expected.Equals(actual)); }