예제 #1
0
        public void CreateObject()
        {
            var instance = _pipeline.Create <DomainType>();

            Assert.That(instance.String, Is.EqualTo("construction"));
            Assert.That(instance.CtorCalled, Is.True);
        }
예제 #2
0
 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));
     }
 }
예제 #3
0
 /// <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);
 }
예제 #4
0
        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);
        }