Exemple #1
0
        public void CanClearPolicy()
        {
            PolicyList list   = new PolicyList();
            FakePolicy policy = new FakePolicy();

            list.Set <IBuilderPolicy>(policy, typeof(string));
            list.Clear <IBuilderPolicy>(typeof(string));

            Assert.IsNull(list.Get <IBuilderPolicy>(typeof(string)));
        }
Exemple #2
0
        public void CanClearPolicy()
        {
            PolicyList list   = new PolicyList();
            FakePolicy policy = new FakePolicy();

            list.Set(typeof(string), string.Empty, typeof(IBuilderPolicy), policy);
            list.Clear(typeof(string), string.Empty, typeof(IBuilderPolicy));

            Assert.IsNull(list.GetOrDefault(typeof(IBuilderPolicy), typeof(string), out _));
        }
		public void CanClearPolicy()
		{
			PolicyList list = new PolicyList();
			MockPolicy policy = new MockPolicy();

			list.Set<IBuilderPolicy>(policy, typeof(string), "1");
			list.Clear<IBuilderPolicy>(typeof(string), "1");

			Assert.IsNull(list.Get<IBuilderPolicy>(typeof(string), "1"));
		}
Exemple #4
0
        public void CanClearDefaultPolicy()
        {
            PolicyList list          = new PolicyList();
            FakePolicy defaultPolicy = new FakePolicy();

            list.Set(null, null, typeof(IBuilderPolicy), defaultPolicy);

            list.Clear(null, null, typeof(IBuilderPolicy));

            IBuilderPolicy result = list.GetOrDefault(typeof(IBuilderPolicy), typeof(object), out _);

            Assert.IsNull(result);
        }