Пример #1
0
        public ActionResult ViewPolicies(int CategoryId)
        {
            PolicyListVM vm = new PolicyListVM();

            vm.Categories = _manager.GetAllCategories().ToList();
            vm.Policies   = _manager.GetAllPolicies().Where(p => p.PolicyCategory == CategoryId).ToList();
            return(View(vm));
        }
Пример #2
0
            public void PCManagerLoadsPolicies()
            {
                PCManager manager = PCMFactory.Create();

                List <Policy> policies = manager.GetAllPolicies().ToList();

                Assert.AreEqual(4, policies.Count);
            }
Пример #3
0
            public void PCManagerCanDeletePolicy(int policyNumber)
            {
                PCManager manager = PCMFactory.Create();

                manager.DeletePolicy(policyNumber);
                List <Policy> policies = manager.GetAllPolicies().ToList();

                Assert.AreEqual(3, policies.Count);
            }
Пример #4
0
            public void PCManagerCanAddPolicy(string policyName, int categoryNum, string policyContent)
            {
                PCManager manager = PCMFactory.Create();

                Policy newPolicy = new Policy();

                newPolicy.PolicyName     = policyName;
                newPolicy.PolicyCategory = categoryNum;
                newPolicy.Content        = policyContent;

                manager.AddPolicy(newPolicy);

                List <Policy> policies = manager.GetAllPolicies().ToList();

                Assert.AreEqual(5, policies.Count);
            }