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 TestGetChannels() { PolicyTemplate template = new PolicyTemplate(); template.Load(policy_file); PolicySetItem psi = template.PolicySet; IPolicySet policyset = psi.Data; IPolicyObjectCollection<IPolicy> policies = policyset.Policies; IPolicy internalZipPolicy = policies[1]; List<IPolicyChannel> channels = template.GetChannels(internalZipPolicy); Assert.AreEqual(4, channels.Count); Assert.AreEqual("SMTP Channel", channels[0].Name.Value); Assert.AreEqual("HTTP Channel", channels[1].Name.Value); Assert.AreEqual("Active Content Channel", channels[2].Name.Value); Assert.AreEqual("Removeable Device Channel", channels[3].Name.Value); }
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); }