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();
     }
 }
示例#3
0
 public void Process(ISemanticProcessor proc, IMembrane membrane, ClearDictionary msg)
 {
     CreateOrGetContextValueDictionary(proc, msg.Context).Clear();
     JsonResponse(proc, msg, new OKResponse());
 }