public void ClearDictionaryShouldClear() { var dictionary = new Dictionary<string, int> { { "Key", 1 } }; var activity = new ClearDictionary<string, int>(); var host = new WorkflowInvokerTest(activity); dynamic input = new WorkflowArguments(); input.Dictionary = dictionary; try { host.TestActivity(input); Assert.AreEqual(0, dictionary.Count); } finally { host.Tracking.Trace(); } }
public void ClearNullDictionaryShouldThrow() { var activity = new ClearDictionary<string, string>(); var host = new WorkflowInvokerTest(activity); dynamic input = new WorkflowArguments(); input.Dictionary = null; try { AssertHelper.Throws<InvalidOperationException>(() => host.TestActivity(input)); } finally { host.Tracking.Trace(); } }
public void Process(ISemanticProcessor proc, IMembrane membrane, ClearDictionary msg) { CreateOrGetContextValueDictionary(proc, msg.Context).Clear(); JsonResponse(proc, msg, new OKResponse()); }