public void CreateOptionsMgr_For_Network_Pipe() { //Arrange PipeFactory pfac = new PipeFactory(); INetworkPipe pipe = pfac.CreateNetworkPipe(); OptionsMgrFactory fac = new OptionsMgrFactory(); //Act IPipeOptionsMgr mgr = fac.CreateOptionsMgr(pipe); //Assert Assert.NotNull(mgr); Assert.IsType(typeof(PipeOptionsMgr), mgr); }
public void CreateSettingsMgr_For_Network_Pipe() { //Arrange var pfac = new PipeFactory(); INetworkPipe pipe = pfac.CreateNetworkPipe(); var fac = new SettingsMgrFactory(); //Act IPipeSettingsMgr mgr = fac.CreateSettingsMgr(pipe); //Assert Assert.NotNull(mgr); Assert.IsType(typeof(PipeSettingsMgr), mgr); }
public void CreateNeutralPipe() { //Arrange Guid id = Guid.NewGuid(); Type expectedType = typeof(NeutralPipe); var fac = new PipeFactory(); //Act INeutralPipe iPipe = fac.CreateNeutralPipe(id); //Assert Assert.NotNull(iPipe); NeutralPipe pipe = iPipe as NeutralPipe; Assert.NotNull(pipe); Assert.IsType(expectedType, pipe); Assert.NotNull(pipe.SettingsMgr); Assert.NotNull(pipe.OptionsMgr); Assert.Equal(id, pipe.Id); }
public OutputPortMgrIntegrationWithOutputPortsFixture() { _pipeFactory = new PipeFactory(); }
public bool Connect() { bool result = false; if (IsInitialPortSet && IsFinalPortSet) { OnConnectionCreating(new PlumbingEventArgs(PlumbingAction.Initiate)); if (NetworkPipe == null) { //TODO use container using (PipeFactory pf = new PipeFactory()) { NetworkPipe = pf.CreateNetworkPipe(); } } SourceNetworkPort.Add(NetworkPipe); NetworkPipe.SourceNetworkPort = SourceNetworkPort; DestinationNetworkPort.InboundPipe = NetworkPipe; NetworkPipe.DestinationNetworkPort = DestinationNetworkPort; OnConnectionCreated(new PlumbingEventArgs(PlumbingAction.Complete)); result = true; } return result; }
internal INetworkPipe CreateNetworkPipeModel(Guid id) { INetworkPipe pipe = null; using (PipeFactory fac = new PipeFactory()) { pipe = fac.CreateNetworkPipe(id); } return pipe; }
public bool Connect() { bool result = false; if (IsInitialPortSet && IsFinalPortSet) { OnConnectionCreating(new PlumbingEventArgs(PlumbingAction.Initiate)); if (DataPipe == null) { // allow for mocking //TODO use container PipeFactory pf = new PipeFactory(); DataPipe = pf.CreateDataPipe(); } SourceDataPort.Add(DataPipe); DataPipe.SourceDataPort = SourceDataPort; DestinationDataPort.InboundPipe = DataPipe; DataPipe.DestinationDataPort = DestinationDataPort; OnConnectionCreated(new PlumbingEventArgs(PlumbingAction.Complete)); result = true; } return result; }
internal IPipe ReConstitute(IPipeTicket ticket) { IPipe pipe = null; //TODO - should use container here using (PipeFactory fac = new PipeFactory()) { if (ticket.ContentType == BlobType.Data) pipe = fac.CreateDataPipe(ticket.PipeId); else if (ticket.ContentType == BlobType.Network) pipe = fac.CreateNetworkPipe(ticket.PipeId); } return pipe; }