示例#1
0
        private static ApplicationWithAttributes MakeApp()
        {
            AppCall call = new AppCall(ASMRestSettingsInstance.Instance);

            call.SkipHtmlEncoding = true;
            ApplicationWithAttributes app = call.Get(79);

            return(app);
        }
示例#2
0
        public void GetIssue()
        {
            InitSettings();
            ApplicationWithAttributes app = MakeApp();
            IssueCall           call      = new IssueCall(app, ASMRestSettingsInstance.Instance);
            IssueWithAttributes issue     = call.Get(436774);

            Assert.IsNotNull(issue);

            Assert.AreEqual("Highest Threat", issue.GetAttrVal("Item Type"));
        }
示例#3
0
        public void GetIssues()
        {
            InitSettings();
            ApplicationWithAttributes app  = MakeApp();
            IssueListCall             call = new IssueListCall(app, ASMRestSettingsInstance.Instance, IssueFilterType.Type, "Cross-Site Scripting");

            Dictionary <string, string>[] issues = call.Fetch();

            Assert.IsNotNull(issues);
            Assert.IsTrue(issues.Length > 0);
        }
示例#4
0
        public void GetIssueTypes()
        {
            InitSettings();
            ApplicationWithAttributes app  = MakeApp();
            OpenIssueTypeListCall     call = new OpenIssueTypeListCall(app.name, ASMRestSettingsInstance.Instance, Severity.All, GroupType.IssueType, IssueItemType.All);

            Dictionary <string, string>[] issueTypes = call.Fetch();

            Assert.IsNotNull(issueTypes);
            Assert.IsTrue(issueTypes.Length > 0);
        }
示例#5
0
        public void GetApp()
        {
            InitSettings();

            AppCall call = new AppCall(ASMRestSettingsInstance.Instance);
            ApplicationWithAttributes app = call.Get(79);

            Assert.IsNotNull(app);

            Assert.AreEqual("Altoro Mutual", Utils.HtmlDecode(app.name));
            Assert.AreEqual("Yes", app.GetAttrVal("Web Based"));
        }
示例#6
0
        public void GetTranslatedIssues()
        {
            InitSettings();

            IssueAttributeDefinitionListCall   defsCall = new IssueAttributeDefinitionListCall(ASMRestSettingsInstance.Instance);
            IssueAttributeDefinitionCollection defs     = defsCall.Get();

            //construct the mapping table
            Dictionary <string, string> map = new Dictionary <string, string>();

            foreach (IssueAttributeDefinitionEx def in defs.attributeDefColl)
            {
                map.Add(def.id.ToString(), def.name);
            }

            ApplicationWithAttributes app = MakeApp();

            IssueListCall call = new IssueListCall(app, ASMRestSettingsInstance.Instance, IssueFilterType.Type, "Cross-Site Scripting");

            Dictionary <string, string>[] issues = call.Fetch();

            Assert.IsNotNull(issues);
            Assert.IsTrue(issues.Length > 0);
        }