public void GetFromNullDictionaryShouldThrow() { var activity = new GetFromDictionary<string, string>(); var host = new WorkflowInvokerTest(activity); dynamic input = new WorkflowArguments(); input.Dictionary = null; input.Key = "key"; try { AssertHelper.Throws<InvalidOperationException>(() => host.TestActivity(input)); } finally { host.Tracking.Trace(); } }
public void GetFromDictionaryReturnTrueWhenGetWithGoodKey() { const string ExpectedKey = "key"; const string ExpectedValue = "value"; var dictionary = new Dictionary<string, string> { { ExpectedKey, ExpectedValue } }; var activity = new GetFromDictionary<string, string>(); var host = new WorkflowInvokerTest(activity); dynamic input = new WorkflowArguments(); input.Dictionary = dictionary; input.Key = ExpectedKey; try { host.TestActivity(input); host.AssertOutArgument.IsTrue("Result"); host.AssertOutArgument.AreEqual("Value", ExpectedValue); } finally { host.Tracking.Trace(); } }