Ejemplo n.º 1
0
        public void TestGetUnhandledThreats()
        {
            var riskTypeCreated = _companyService.CreateRiskType(new RiskType()
            {
                Name = "TestRiskType"
            });
            var asset  = CreateAsset();
            var threat = CreateThreat();

            threat.Risks.Add(new Risk(5, 5, 5, 5, 5, 5, 5, 25, 125, riskTypeCreated.RiskTypeId, riskTypeCreated.Name, 0));
            asset.Threats.Add(threat);
            var createdAsset = _assetService.Create(asset);
            var problems     = _assetService.GetUnhandledThreats(5, 5, 1);

            Assert.AreEqual(1, problems.Count());
            Assert.AreEqual(createdAsset.AssetId, problems.First().AssetId);
        }
Ejemplo n.º 2
0
 public IHttpActionResult CreateRiskType(Contracts.Risk.RiskType riskType)
 {
     return(Ok(CompanyService.CreateRiskType(riskType)));
 }