public void WfClientNextStepToXElementTest() { WfClientNextStepCollection expected = PrepareNextSteps(); XElement root = new XElement("NextSteps"); expected.ToXElement(root); Console.WriteLine(root.ToString()); WfClientNextStepCollection actual = new WfClientNextStepCollection(root); AreSame(expected, actual); Assert.AreEqual(expected.SelectedKey, actual.GetSelectedStep().TransitionKey); }
public void ClientOpinionExtraDataTest() { WfClientOpinion client = PrepareClientOpinion(); WfClientNextStepCollection nextSteps = WfClientNextStepTest.PrepareNextSteps(); WfClientNextStep expectedNextStep = nextSteps.GetSelectedStep(); Dictionary <string, object> extraData = new Dictionary <string, object>(); XElement root = new XElement("NextSteps"); nextSteps.ToXElement(root); extraData["NextSteps"] = root.ToString(); client.FillExtraDataFromDictionary(extraData); Console.WriteLine("意见结果:{0}", client.GetNextSteps().GetSelectedStep().GetDescription()); WfClientNextStepTest.AreSame(expectedNextStep, client.GetNextSteps().GetSelectedStep()); }