예제 #1
0
		public void TestGetChannels()
		{
			PolicyLoader policyLoader = new PolicyLoader();
			policyLoader.LoadRuntimePolicy("Pro5.test");
			foreach (IPolicy policy in policyLoader.Policies)
			{
				List<IPolicyChannel> channels = policyLoader.GetChannels(policy);
				Assert.IsTrue(channels.Count == 2);
			}
		}
예제 #2
0
		public void TestIsLDAPRouting()
		{
			PolicyLoader policyLoader = new PolicyLoader();
			policyLoader.LoadRuntimePolicy("Pro5.test");

			foreach (IPolicy policy in policyLoader.Policies)
			{
				List<IPolicyChannel> channels = policyLoader.GetChannels(policy);
				foreach (IPolicyChannel policyChannel in channels)
				{
					Assert.IsFalse(policyLoader.IsLDAPRouting(policyChannel), "There should be no LDAP routing in Pro5.test policies");
				}
			}
		}
예제 #3
0
		public void TestCountActions()
		{
			PolicyLoader policyLoader = new PolicyLoader();
			policyLoader.LoadRuntimePolicy("Pro5.test");

			int ex = 0;
			int In = 0;
			foreach (IPolicy policy in policyLoader.Policies)
			{
				List<IPolicyChannel> channels = policyLoader.GetChannels(policy);
				foreach (IPolicyChannel policyChannel in channels)
				{
					ex += policyLoader.GetCountExternalActions(policyChannel);
					In += policyLoader.GetCountInternalActions(policyChannel);
				}
			}

			Assert.AreEqual(20, ex);
			Assert.AreEqual(0, In);
		}