public void CreateObject() { var instance = _pipeline.Create <DomainType>(); Assert.That(instance.String, Is.EqualTo("construction")); Assert.That(instance.CtorCalled, Is.True); }
public void AddPipeline(IPipeline pipeline) { pipeline.Create(Context); lock (_lock) { _pipelines[pipeline.Group].Add(pipeline); _pipelines[pipeline.Group].Sort((a, b) => a.Order.CompareTo(b.Order)); } }
/// <summary> /// Initializes a new instance of the <see cref="AprsPacketSpout" /> class. /// </summary> /// <param name="pipeline">The pipeline.</param> public AprsPacketSpout(IPipeline<byte[]> pipeline) { _user = ConfigurationManager.AppSettings["user"]; var password = ConfigurationManager.AppSettings["password"] ?? "-1"; _hostname = ConfigurationManager.AppSettings["hostname"]; _port = int.Parse(ConfigurationManager.AppSettings["port"]); _logon = Encoding.UTF8.GetBytes("user " + _user + " pass " + password + "\n"); _pipeline = pipeline.Create(string.Empty); }
private T CreateCyclicInstance <T> (IPipeline pipeline) where T : ReferencingSerializableType { var instance = pipeline.Create <T> (); var referenceObject = new ReferencedType(); instance.ReferencedObject = referenceObject; referenceObject.ReferencingObject = instance; return(instance); }