public void AddEffect_ExpectedBehavior() { var task = new PrimitiveTask <byte>() { Name = "Test" }; var t = task.AddEffect(new ActionEffect <MyContext, byte>("TestEffect", EffectType.Permanent, (context, type) => context.Done = true)); Assert.IsTrue(t == task); Assert.IsTrue(task.Effects.Count == 1); }
public void ApplyEffects_ExpectedBehavior() { var ctx = new MyContext(); var task = new PrimitiveTask <byte>() { Name = "Test" }; var t = task.AddEffect(new ActionEffect <MyContext, byte>("TestEffect", EffectType.Permanent, (context, type) => context.Done = true)); task.ApplyEffects(ctx); Assert.AreEqual(true, ctx.Done); }
//----------------------------------------------------------------------------------------------- private static void ParseEffectForPrimitiveTask(XmlNode effectNode, PrimitiveTask task) { EffectProperty effect = ParseEffectFromNode(effectNode); task.AddEffect(effect); }