public void TestGetChannelActions() { PolicyTemplate template = new PolicyTemplate(); template.Load(policy_file); PolicySetItem psi = template.PolicySet; IPolicySet policyset = psi.Data; IPolicy internalZipPolicy = policyset.Policies[1]; IPolicyChannel internalSmtpChannel = template.GetChannels(internalZipPolicy)[0]; SortedList<int, IAction> internalActions = template.GetChannelActions(internalSmtpChannel, Routing.Internal); SortedList<int, IAction> externalActions = template.GetChannelActions(internalSmtpChannel, Routing.External); Assert.AreEqual(0, externalActions.Count); Assert.AreEqual(1, internalActions.Count); }
public void TestGetAction() { PolicyTemplate template = new PolicyTemplate(); template.Load(policy_file); PolicySetItem psi = template.PolicySet; IPolicySet policyset = psi.Data; IPolicy internalZipPolicy = policyset.Policies[1]; IPolicyChannel internalSmtpChannel = template.GetChannels(internalZipPolicy)[0]; SortedList<int, IAction> internalActions = template.GetChannelActions(internalSmtpChannel, Routing.Internal); Assert.AreEqual(1, internalActions.Count); IAction internalZipAction = internalActions.Values[0]; Assert.AreEqual(14002, internalZipAction.Precedence); Assert.AreEqual("ZIP - Microsoft Office Documents", internalZipAction.Name.Value); Assert.AreEqual("Workshare.Policy.Actions.ZipUserAction", internalZipAction.Class); }