Beispiel #1
0
        private string GetSystemCharacteristicsInXML(string xml)
        {
            IEnumerable <string> errors;
            var sampleDoc = GetType().Assembly.GetManifestResourceStream(
                GetType().Assembly.GetName().Name + xml);
            oval_system_characteristics systemCharacteristics = oval_system_characteristics.GetOvalSystemCharacteristicsFromStream(sampleDoc, out errors);

            return(systemCharacteristics.GetSystemCharacteristicsXML());
        }
Beispiel #2
0
        public void Should_be_possible_to_build_a_system_characteristics_in_steps_and_generate_a_xml_from_this()
        {
            SystemCharacteristicsBuilder builder = new SystemCharacteristicsBuilder();

            oval_system_characteristics sc = this.GetSystemCharacteristics("oval.org.mitre.oval.sc.5368.xml");

            oval_system_characteristics systemCharacteristics = builder.WithGenerator(sc.generator)
                                                                .WithSystemInfo(sc.system_info)
                                                                .AddCollectedObjectsWithSystemData(sc.collected_objects, sc.system_data)
                                                                .Build();

            Assert.IsNotNull(systemCharacteristics);

            string systemCharacteristicsInXml = systemCharacteristics.GetSystemCharacteristicsXML();

            Assert.IsNotNull(systemCharacteristicsInXml);
        }
Beispiel #3
0
        /// <summary>
        /// Creates the system characteristics in XML format.
        /// </summary>
        /// <param name="probeResult">result of the probe execution.</param>
        /// <returns></returns>
        public string CreateSystemCharacteristicsInXMLFormat(ProbeResult probeResult)
        {
            oval_system_characteristics systemCharacteristics = this.CreateSystemCharacteristics(probeResult);

            return(systemCharacteristics.GetSystemCharacteristicsXML());
        }