示例#1
0
        public ConditionTest()
            : base(LogicOf <ICondition> .New((x) =>
        {
            //tests "adjustment" idiom for Conditions
            //we adjust by ANDing a switch that we turn off and on

            //get the old eval.  we'll be expecting this value with the switch on
            var oldEval = x.Evaluate();

            //the adjustment is an AND with a conditional bool that we switch on and off
            var switchCond = StrategizedConditionOf <bool> .New((cond) =>
            {
                return(new bool?(cond));
            }).AddContext(false);

            //apply the adjustment
            var newX = x.Adjust((cond) =>
            {
                return(cond.And(switchCond));
            });

            //if we evaluate the adjusted condition it should eval to false due to the switch condition
            var adjustedEval = newX.Evaluate();
            Condition.Requires(adjustedEval).IsEqualTo(false);

            //switch on
            switchCond.Context = true;
            adjustedEval       = newX.Evaluate();
            Condition.Requires(adjustedEval).IsEqualTo(oldEval);
        }))
        {
        }
示例#2
0
 public ValueOfTest()
     : base(LogicOf <IValueOf <string> > .New((x) =>
 {
     //TESTS HERE
 }))
 {
 }
示例#3
0
        public ThrottleTest()
            : base(LogicOf <Nothing> .New((x) =>
        {
            NaturalThrottle.New(1);

            int count = 0;
            var logic = Logic.New(() =>
            {
                count++;
                Thread.Sleep(2000);
            });

            var throttled = logic.Throttle(1);

            Action act1 = new Action(() => { throttled.Perform(); });
            Action act2 = new Action(() => { throttled.Perform(); });
            act1.EnqueueToThreadPool();
            act2.EnqueueToThreadPool();
            Thread.Sleep(1000);
            Condition.Requires(count).IsEqualTo(1);
            Thread.Sleep(1000);
            Condition.Requires(count).IsEqualTo(1);
            Thread.Sleep(2000);
            Condition.Requires(count).IsEqualTo(2);
        }))
        {
        }
 public ObservingLogicDecoration(ILogic decorated, LogicOf <ILogic> preObservation,
                                 LogicOf <ILogic> postObservation)
     : base(decorated)
 {
     this.PostObservation = postObservation;
     this.PreObservation  = preObservation;
 }
示例#5
0
 public ObservingConditionDecoration(ICondition decorated, LogicOf <ICondition> preObservation,
                                     LogicOf <ICondition> postObservation)
     : base(decorated)
 {
     this.PostObservation = postObservation;
     this.PreObservation  = preObservation;
 }
 public ObservingConditionDecoration(ICondition decorated, LogicOf<ICondition> preObservation,
     LogicOf<ICondition> postObservation)
     : base(decorated)
 {
     this.PostObservation = postObservation;
     this.PreObservation = preObservation;
 }
示例#7
0
 public ObservingValueOfDecoration(IValueOf <T> decorated, LogicOf <IValueOf <T> > preObservation,
                                   LogicOf <IValueOf <T> > postObservation)
     : base(decorated)
 {
     this.PostObservation = postObservation;
     this.PreObservation  = preObservation;
 }
示例#8
0
        public FileableTest()
            : base(LogicOf <IStringable> .New((x) =>
        {
            //get the string value
            var val = x.GetValue();

            //back to a file
            var fileable = x.Fileable().Filing("test.test");
            fileable.Write();
            var readVal = fileable.GetValue();
            Condition.Requires(readVal).IsEqualTo(val);

            fileable.Parse("a");
            fileable.Write();
            readVal = fileable.GetValue();
            Condition.Requires(readVal).IsEqualTo("a");

            //back to a locked file
            var lockfileable = x.Fileable().LockingFiling("test.test");
            lockfileable.Read();
            readVal = lockfileable.GetValue();
            Condition.Requires(readVal).IsEqualTo("a");

            //test the locking
            fileable = x.Fileable().Filing("test.test");
            try
            {
                fileable.Read();
            }
            catch { }
        }))
        {
        }
示例#9
0
        /// <summary>
        /// builds up the arg as a ValueOf with a bunch of adjustments and observers
        /// </summary>
        private void BuildArgDecoration()
        {
            this.Logger.Do((x) => x.LogVerbose("BuildArgDecoration started", null));
            var intercepts = this.Layers;

            //decorate the argument
            IValueOf <TArg> argOf = null;

            if (this.Arg != null)
            {
                argOf = this.Arg.AsNaturalValue();

                //decorate the adjustments
                intercepts.WithEach((intercept) =>
                {
                    if (intercept.ArgDecorator != null)
                    {
                        argOf = argOf.Adjust(intercept.ArgDecorator);
                    }
                });
                //decorate the observations
                intercepts.WithEach((intercept) =>
                {
                    if (intercept.ArgValidator != null)
                    {
                        argOf = argOf.Observe(null, LogicOf <IValueOf <TArg> > .New((x) =>
                        {
                            intercept.ArgValidator.Perform(argOf);
                        }));
                    }
                });
                this.DecoratedArg = argOf;
            }
            this.Logger.Do((x) => x.LogVerbose("BuildArgDecoration completed", null));
        }
示例#10
0
        public IdentifyingTest()
            : base(LogicOf <IHasId> .New((x) =>
        {
            //try out all the decorations
            var guid    = Guid.NewGuid();
            var hasGuid = x.HasGUID(guid);
            Condition.Requires(hasGuid.GUID).IsEqualTo(guid);

            var now            = DateTime.Now;
            var hasDateCreated = hasGuid.HasDateCreated(now);
            Condition.Requires(hasDateCreated.DateCreated).IsEqualTo(now);

            var lastTouchedDate = DateTime.Now;
            var hasLastTouched  = hasDateCreated.HasDateLastTouched(lastTouchedDate);
            Condition.Requires(hasLastTouched.DateLastTouched).IsEqualTo(lastTouchedDate);

            var localMachineName = NetUtil.GetLocalMachineName();
            var hasLM            = hasLastTouched.HasLocalMachineName();
            Condition.Requires(hasLM.MachineName).IsEqualTo(localMachineName);

            var ip    = NetUtil.GetLocalIPAddresses().First();
            var hasIP = hasLM.HasIP(ip);
            Condition.Requires(hasIP.IPAddress.ToString()).IsEqualTo(ip.ToString());

            var hasRS = hasIP.HasRandomString("blah");
            Condition.Requires(hasRS.RandomString).IsEqualTo("blah");

            var hasV = hasRS.HasVersion("v");
            Condition.Requires(hasV.Version).IsEqualTo("v");
        }))
        {
        }
示例#11
0
        public HTTPHostTest()
            : base(LogicOf <Nothing> .New((x) =>
        {
            var ep   = EndPoint.NewFreeLocalEndPointSpecifyingPort(80);
            var host = HTTPHost.New(ep, (req) =>
            {
                StringBuilder sb = new StringBuilder();
                sb.AppendLine("<HTML><BODY>");
                var lines = HTTPHost.DumpHTTPRequest(req);
                foreach (var eachline in lines)
                {
                    sb.AppendLine(eachline + "<BR>");
                }
                sb.AppendLine("</BODY></HTML>");

                return(sb.ToString());
            }, "test/");
            host.Initialize();
            host.Start();

            string uri = "http://" + ep.IPAddress + ":" + ep.Port + "/test/";

            //Console.ReadLine();

            //now hit it with some requests
            using (var client = new HttpClient())
            {
                var getdat = HTTPClient.Get(client, uri);
                HTTPClient.Delete(client, uri);
                var postdat = HTTPClient.Post(client, new StringContent("yo"), uri);
                var putdat  = HTTPClient.Put(client, new StringContent("yo"), uri);
            }
        }))
        {
        }
示例#12
0
        public Test()
            : base(LogicOf <IStore> .New((x) =>
        {
            x.Clear();
            var thing = AsId <string> .New("asId1");
            var soid  = thing.GetStoredObjectId();

            var store = x.BasicAudit(NamedNaturalInMemoryStore.New("auditstore").IsOf <StoredItemAuditPoint>());

            //do some stuff..all of this should be tracked
            store.SaveItem(thing);
            var auditItems = store.AuditStore.GetAll();
            Assert.True(auditItems[0].Mode == StoredItemAccessMode.Save && auditItems[0].ObjRef.Equals(soid));

            var clone  = store.Get <AsId <string> >("asId1");
            auditItems = store.AuditStore.GetAll();
            Assert.True(auditItems[1].Mode == StoredItemAccessMode.Read && auditItems[1].ObjRef.Equals(soid));

            var list   = store.SearchOf <AsId <string> >(LogicOfTo <AsId <string>, bool> .New((o) => { return(o.Id.Equals("asId1")); }));
            auditItems = store.AuditStore.GetAll();
            Assert.True(auditItems[2].Mode == StoredItemAccessMode.Read && auditItems[2].ObjRef.Equals(soid));

            var list2  = store.GetAll();
            auditItems = store.AuditStore.GetAll();
            Assert.True(auditItems[3].Mode == StoredItemAccessMode.Read && auditItems[3].ObjRef.Equals(soid));

            store.DeleteItem(soid);

            auditItems = store.AuditStore.GetAll();
            Assert.True(auditItems[4].Mode == StoredItemAccessMode.Delete && auditItems[4].ObjRef.Equals(soid));

            store.Dispose();
        }))
        {
        }
示例#13
0
        public StoreOfTest()
            : base(LogicOf <IStore> .New((x) =>
        {
            x.Clear();
            var store = x.IsOf <BaseThing>();

            BaseThing thing1 = new BaseThing()
            {
                Data = "data", Id = "thing1"
            };
            DerivedThing thing2 = new DerivedThing()
            {
                Data = "data", Data1 = "data1", Id = "thing2"
            };
            DerivedDerivedThing thing3 = new DerivedDerivedThing()
            {
                Data = "data", Data1 = "data1", Data2 = "data2", Id = "thing3"
            };
            var thing4 = AsId <string> .New("asId1");

            store.SaveItem(thing1);
            store.SaveItem(thing2);
            store.SaveItem(thing3);

            Assert.Throws <InvalidOperationException>(() =>
            {
                store.SaveItem(thing4);
            });

            store.DeleteItems(thing1.GetStoredObjectId(), thing2.GetStoredObjectId(), thing3.GetStoredObjectId());
        }))
        {
        }
示例#14
0
 public LogicTest()
     : base(LogicOf <ILogic> .New((x) =>
 {
     //TESTS HERE
 }))
 {
 }
示例#15
0
        public Test()
            : base(LogicOf <IStore> .New((x) =>
        {
            x.Clear();
            var store = x.HasFactory(LogicOfTo <IStoredObjectId, IHasId> .New((soId) =>
            {
                //the factory produces AsId<string> only
                if (soId.ObjectType.Equals(typeof(AsId <string>)))
                {
                    return(AsId <string> .New(soId.ObjectId.ToString()));
                }

                return(null);
            }));


            //pull from the store, which is empty.  it should factory the item up
            var item = store.Get <AsId <string> >("asId1");
            Assert.True(item != null);

            //delete it
            store.DeleteItem(item.GetStoredObjectId());

            item = store.Get <AsId <string> >("asId1");
            Assert.True(item != null);

            //cleanup
            store.Dispose();
        }))
        {
        }
 public ObservingLogicDecoration(ILogic decorated, LogicOf<ILogic> preObservation,
     LogicOf<ILogic> postObservation)
     : base(decorated)
 {
     this.PostObservation = postObservation;
     this.PreObservation = preObservation;
 }
示例#17
0
 public InterceptLayer <TArg, TResult> SetResultValidation(Action <TResult> strategy)
 {
     if (strategy != null)
     {
         this.ResultValidator = strategy.MakeLogicOf();
     }
     return(this);
 }
示例#18
0
 public LogicTest()
     : base(LogicOf <ILogic> .New((x) =>
 {
     var pf        = x.Polyfacing <ILogic>();
     var face      = pf.As <ILogic>();
     var decorated = face.GetDecorated();
     Condition.Requires(object.ReferenceEquals(decorated, x)).IsTrue();
 }))
 {
 }
示例#19
0
 public WaiterTest()
     : base(LogicOf <Nothing> .New((x) =>
 {
     var flagDate       = DateTime.Now.AddSeconds(5);
     ICondition cond    = StrategizedCondition.New(() => { return(DateTime.Now < flagDate); });
     ICondition expCond = StrategizedCondition.New(() => { return(DateTime.Now > flagDate.AddSeconds(1)); });
     var waiter         = ConditionalWaiter.New(cond, expCond);
     waiter.WaitAround();
 }))
 {
 }
示例#20
0
        public static ILogger GetFileLogger(string path)
        {
            var logger = StoreLogger.New(NaturalInMemoryStore.New().Polls());

            logger.Store.GetPoll().SetBackgroundAction(LogicOf <IStore> .New((store) =>
            {
                var dat = StoreSerializer.SerializeStore(store, ValueManagerChainOfResponsibility.NewDefault());
                Debug.WriteLine(dat);
                dat.MakeStringable().Fileable().Filing(path).Write();
            }), 100);
            return(logger);
        }
示例#21
0
        public LogicTest()
            : base(LogicOf <ILogic> .New((x) =>
        {
            var flagDate       = DateTime.Now.AddSeconds(5);
            ICondition cond    = StrategizedCondition.New(() => { return(DateTime.Now < flagDate); });
            ICondition expCond = StrategizedCondition.New(() => { return(DateTime.Now > flagDate.AddSeconds(1)); });

            var newX = x.WaitUntil(cond, expCond);
            newX.Perform();
        }))
        {
        }
示例#22
0
        public HTTPSHostTest()
            : base(LogicOf <Nothing> .New((x) =>
        {
            var ep = EndPoint.NewFreeLocalEndPointSpecifyingPort(80);

            var host = HTTPSHost.New(ep,
                                     (req) =>
            {
                StringBuilder sb = new StringBuilder();
                sb.AppendLine("<HTML><BODY>");
                var lines = HTTPSHost.DumpHTTPRequest(req);
                foreach (var eachline in lines)
                {
                    sb.AppendLine(eachline + "<BR>");
                }
                sb.AppendLine("</BODY></HTML>");

                return(sb.ToString());
            }, "test/");

            using (host)
            {
                host.Initialize();
                host.Start();

                string uri = "https://" + ep.IPAddress + ":" + ep.Port;

                //Console.ReadLine();

                ServicePointManager.ServerCertificateValidationCallback += ValidateRemoteCertificate;
                ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;

                //using (WebClient webClient = new WebClient())
                //{
                //    var stream = webClient.OpenRead(uri);
                //    using (StreamReader sr = new StreamReader(stream))
                //    {
                //        var page = sr.ReadToEnd();
                //    }
                //}

                //now hit it with some requests
                using (var client = new HttpClient())
                {
                    var getdat = HTTPClient.Get(client, uri);
                    HTTPClient.Delete(client, uri);
                    var postdat = HTTPClient.Post(client, new StringContent("yo"), uri);
                    var putdat  = HTTPClient.Put(client, new StringContent("yo"), uri);
                }
            }
        }))
        {
        }
示例#23
0
        public OperationProtocolHostDecoration(IEndPointHost decorated, ValueManagerChainOfResponsibility valueManager = null)
            : base(decorated.StoreProtocoling(null, valueManager))
        {
            this.OperationManager = OperationManager.New();

            //replace the store protocol logic
            this.As <StoreProtocolHostDecoration>(true).HasStoreProtocolLogic(
                LogicOf <Tuple <IStore, IStore> > .New((uow) =>
            {
                this.OperationManager.HandleOperations(uow.Item1, uow.Item2);
            }));
        }
示例#24
0
        /// <summary>
        /// invokes the arg decorations, then the logic decorations, then invokes the logic
        /// </summary>
        private TResult InvokeDecoratedArgAndLogic()
        {
            this.Logger.Do((x) => x.LogVerbose("InvokeDecoratedArgAndLogic started", null));

            this.Logger.Do((x) => x.LogVerbose("Arg", this.Arg));
            this.ProcessedArg = this.DecoratedArg.GetValue(); //invoke arg decoration chain (adjusters and observers)
            this.Logger.Do((x) => x.LogVerbose("ProcessedArg", this.ProcessedArg));

            ILogicOf <TArg> logicOf      = (ILogicOf <TArg>) this.DecoratedLogic;
            var             logicResults = logicOf.Perform(this.ProcessedArg) as LogicOfTo <TArg, TResult>;

            this.Logger.Do((x) => x.LogVerbose("Logic performed", null));
            this.Result = logicResults.Result;
            this.Logger.Do((x) => x.LogVerbose("Result", this.Result));

            //decorate the result
            this.Logger.Do((x) => x.LogVerbose("Decorate result started", null));
            var intercepts = this.Layers;

            if (this.Result != null)
            {
                IValueOf <TResult> resultOf = this.Result.AsNaturalValue();

                //decorate the adjustments
                intercepts.WithEach((intercept) =>
                {
                    if (intercept.ResultDecorator != null)
                    {
                        resultOf = resultOf.Adjust(intercept.ResultDecorator);
                    }
                });
                //decorate the observations
                intercepts.WithEach((intercept) =>
                {
                    if (intercept.ResultValidator != null)
                    {
                        resultOf = resultOf.Observe(null, LogicOf <IValueOf <TResult> > .New((x) =>
                        {
                            intercept.ResultValidator.Perform(resultOf);
                        }));
                    }
                });
                this.Logger.Do((x) => x.LogVerbose("Decorate result completed", null));

                this.DecoratedResult = resultOf;
                this.ProcessedResult = resultOf.GetValue(); //invoke the decorations

                this.Logger.Do((x) => x.LogVerbose("ProcessedResult", this.ProcessedResult));
            }

            return(this.ProcessedResult);
        }
示例#25
0
        public static IExpirable BuildTouchLimitExpirable(int limit)
        {
            //fluently build something that Counts, and has a condition on that count, and is touchable
            var pf = Polyface.New();

            pf.IsCounter();
            pf.IsConditionalExpirable(StrategizedConditionOf <Polyface> .New((pf1) => { return(pf1.AsCounter().Current > limit); }));
            pf.IsStrategizedTouchable(LogicOf <Polyface> .New((pf1) => { pf1.AsCounter().Increment(); }));

            //var expire = NaturalFalseExpirable.New().ExpiresWhen( .InWindow(startDate, endDate);
            // return expire;
            return(pf.AsConditionalExpirable());
        }
示例#26
0
        public DPCParseTest()
            : base(LogicOf <Nothing> .New((x) =>
        {
            string commandtoparse = ".dosomething(11.0,15,asdkljlkjmjh,).dosomethingelse(aaadsfasdf)";

            var cmds = commandtoparse.TokenizeToDPCOperations();
            Condition.Requires(cmds).HasLength(2);
            Condition.Requires(cmds[1].OperationToken.TokenString).IsEqualTo("dosomethingelse");
            Condition.Requires(cmds[0].ArgTokens[3].TokenString).IsEqualTo("");
            Debug.WriteLine("");
        }))
        {
        }
示例#27
0
        public StringableListTest()
            : base(LogicOf <IStringableList> .New((x) =>
        {
            var oldVal           = x.GetValue();
            var lengthstringable = x.DecorateListWithLength();
            var newVal           = lengthstringable.GetValue();
            lengthstringable.Parse(newVal);

            Condition.Requires(oldVal).IsNotEqualTo(newVal);
            var decVal = lengthstringable.Decorated.GetValue();
            Condition.Requires(decVal).IsEqualTo(oldVal);
        }))
        {
        }
示例#28
0
        public LogicTest()
            : base(LogicOf <ILogic> .New((x) =>
        {
            var expiry = DateTime.Now.AddSeconds(5);
            var newX   = x.HasExpirable();
            newX.ExpiresWhen(StrategizedCondition.New(() => { return(DateTime.Now > expiry); }));
            newX.Perform();
            Thread.Sleep(6000);

            var trapX = newX.Traps();
            trapX.Perform();
        }))
        {
        }
示例#29
0
        public Test()
            : base(LogicOf <IStore> .New((x) =>
        {
            x.Clear();
            var store = x.Intercepting(FileLoggerUtil.GetFileLogger("storeinttest.txt"));

            //build a commit interception that:
            //decorates the arg by appending the character A to the id
            //validates the arg by checking for the A
            store.CommitOperationIntercept.AddNextIntercept("intercept1",
                                                            (o) =>
            {
                CommitBag newBag = new CommitBag();
                var oldBag       = o;

                oldBag.ItemsToSave.WithEach(saveItem =>
                {
                    if (saveItem is AsId <string> )
                    {
                        var newItem = AsId <string> .New(saveItem.Id.ToString() + "A");
                        newBag.MarkItemSaved(newItem);
                    }
                });
                return(newBag);
            }, (o) =>
            {
                var oldBag = o;
                oldBag.ItemsToSave.WithEach(saveItem =>
                {
                    if (saveItem is AsId <string> )
                    {
                        var id = saveItem.Id.ToString();
                        Assert.True(id.EndsWith("A"));
                    }
                });
            }, null, null, null);

            var thing = AsId <string> .New("asId1");
            store.SaveItem(thing);

            //pull from the store, which is empty.  it should factory the item up
            var clone = store.Get <AsId <string> >("asId1A");
            Assert.True(clone != null);

            //TODO: test all intercepts, not just Commit

            store.Dispose();
        }))
        {
        }
示例#30
0
        public ValueOfTest()
            : base(LogicOf <IValueOf <string> > .New((x) =>
        {
            var flagDate       = DateTime.Now.AddSeconds(5);
            ICondition cond    = StrategizedCondition.New(() => { return(DateTime.Now < flagDate); });
            ICondition expCond = StrategizedCondition.New(() => { return(DateTime.Now > flagDate.AddSeconds(1)); });

            var newX   = x.WaitUntil(cond, expCond);
            var oldVal = x.GetValue().GraphSerializeWithDefaults();
            var newVal = newX.GetValue().GraphSerializeWithDefaults();
            Condition.Requires(oldVal).IsEqualTo(newVal);
        }))
        {
        }
示例#31
0
        public ConditionTest()
            : base(LogicOf <ICondition> .New((x) =>
        {
            var flagDate       = DateTime.Now.AddSeconds(5);
            ICondition cond    = StrategizedCondition.New(() => { return(DateTime.Now < flagDate); });
            ICondition expCond = StrategizedCondition.New(() => { return(DateTime.Now > flagDate.AddSeconds(1)); });

            var newX   = x.WaitUntil(cond, expCond);
            var oldVal = x.Evaluate();
            var newVal = newX.Evaluate();
            Condition.Requires(oldVal).IsEqualTo(newVal);
        }))
        {
        }
示例#32
0
 public LogicTest()
     : base(LogicOf <ILogic> .New((x) =>
 {
     bool checkVal   = false;
     var newX        = x.Eventing();
     newX.Performed += delegate(object sender, EventArgOf <ILogic> e)
     {
         checkVal = true;
     };
     newX.Perform();
     Thread.Sleep(50);
     Condition.Requires(checkVal).IsTrue();
 }))
 {
 }
        public StoreProtocolHostDecoration(IEndPointHost decorated, LogicOf<Tuple<IStore, IStore>> storeProtocolLogic, ValueManagerChainOfResponsibility valueManager = null)
            : base(decorated)
        {
            Condition.Requires(storeProtocolLogic).IsNotNull();
            this.StoreProtocolLogic = storeProtocolLogic;
            if (valueManager == null)
            {
                this.ValueManager = ValueManagerChainOfResponsibility.NewDefault();
            }
            else
            {
                this.ValueManager = valueManager;
            }

            //replace the logic
            this.Logic = LogicOfTo<string, string>.New((request) =>
            {
                return this.HandleStoreProtocolRequest(request);
            });
        }
        /// <summary>
        /// set background action 
        /// </summary>
        public void SetBackgroundAction(LogicOf<ICondition> backgroundAction,
            double backgroundIntervalMSecs = 30000)
        {
            this.BackgroundStrategy = backgroundAction;

            lock (this._stateLock)
            {
                //clear the old task
                if (this.BackgroundHost != null)
                {
                    this.BackgroundHost.Dispose();
                    this.BackgroundHost = null;
                }

                backgroundAction.Context = this as ICondition;

                this.BackgroundHost = new BackgroundHost(true, backgroundIntervalMSecs,
                    backgroundAction);
            }
        }
 /// <summary>
 /// adds observing logic
 /// </summary>
 /// <param name="decorated"></param>
 /// <param name="preObservation"></param>
 /// <param name="postObservation"></param>
 /// <returns></returns>
 public static ObservingConditionDecoration Observe(this ICondition decorated, LogicOf<ICondition> preObservation,
     LogicOf<ICondition> postObservation)
 {
     return new ObservingConditionDecoration(decorated, preObservation, postObservation);
 }
 public void HasStoreProtocolLogic(LogicOf<Tuple<IStore, IStore>> logic)
 {
     Condition.Requires(logic).IsNotNull();
     this.StoreProtocolLogic = logic;
 }
 public static StoreProtocolHostDecoration New(IEndPointHost decorated, LogicOf<Tuple<IStore, IStore>> storeProtocolLogic, ValueManagerChainOfResponsibility valueManager = null)
 {
     return new StoreProtocolHostDecoration(decorated, storeProtocolLogic, valueManager);
 }
 public static StoreProtocolHostDecoration StoreProtocoling(this IEndPointHost decorated, LogicOf<Tuple<IStore, IStore>> storeProtocolLogic, ValueManagerChainOfResponsibility valueManager = null)
 {
     var rv = new StoreProtocolHostDecoration(decorated, storeProtocolLogic, valueManager);
     return rv;
 }
 /// <summary>
 /// adds observing logic
 /// </summary>
 public static ObservingLogicDecoration Observe(this ILogic decorated, LogicOf<ILogic> preObservation,
     LogicOf<ILogic> postObservation)
 {
     return new ObservingLogicDecoration(decorated, preObservation, postObservation);
 }