Ejemplo n.º 1
0
 public void CPUQuery_WithNoErrorCallback_Throws()
 {
     CPUQueryCustomAction.CPUQuery("OutputProp=MMX_SUPPORTED_PROP;IsProcessorFeaturePresent=InstructionsMMXAvailable",
                                   (property, value) => { },
                                   (value) => { },
                                   null);
 }
Ejemplo n.º 2
0
        public void CPUQuery_IsProcessorFeaturePresentQueryWithInvalidFeatureType_FlagsAnError()
        {
            var errorOccurred = false;

            CPUQueryCustomAction.CPUQuery("IsProcessorFeaturePresent=UNKNOWN_FEATURE_TYPE;OutputProp=MMX_SUPPORTED_PROP",
                                          (property, value) => { },
                                          (value) => { },
                                          (value) =>
            {
                errorOccurred = true;
            });

            Assert.IsTrue(errorOccurred, "Failed to flag an error when an invalid feature type is defined");
        }
Ejemplo n.º 3
0
        public void CPUQuery_WithEmptyOutputPropertyValue_FlagsAnError()
        {
            var errorOccurred = false;

            CPUQueryCustomAction.CPUQuery("IsProcessorFeaturePresent=InstructionsMMXAvailable;OutputProp=",
                                          (property, value) => { },
                                          (value) => { },
                                          (value) =>
            {
                errorOccurred = true;
            });

            Assert.IsTrue(errorOccurred, "Failed to flag an error when no output property value is provided");
        }
Ejemplo n.º 4
0
        public void CPUQuery_WithNoQueryType_FlagsAnError()
        {
            var errorOccurred = false;

            CPUQueryCustomAction.CPUQuery("OutputProp=MMX_SUPPORTED_PROP",
                                          (property, value) => { },
                                          (value) => { },
                                          (value) =>
            {
                errorOccurred = true;
            });

            Assert.IsTrue(errorOccurred, "Failed to flag an error when no query type is provided");
        }
Ejemplo n.º 5
0
        public void CPUQuery_WithANullString_FlagsAnError()
        {
            var errorOccurred = false;

            CPUQueryCustomAction.CPUQuery(null,
                                          (property, value) => { },
                                          (value) => { },
                                          (value) =>
            {
                errorOccurred = true;
            });

            Assert.IsTrue(errorOccurred, "Failed to flag an error a null data string is provided");
        }
Ejemplo n.º 6
0
        public void CPUQuery_WithAValidQueryAndOutputPropDefinedFirst_SetsTheSpecifiedProperty()
        {
            var propertySet   = false;
            var errorOccurred = false;

            CPUQueryCustomAction.CPUQuery("OutputProp=MMX_SUPPORTED_PROP;IsProcessorFeaturePresent=InstructionsMMXAvailable",
                                          (property, value) =>
            {
                propertySet = property == "MMX_SUPPORTED_PROP";
            },
                                          (value) => { },
                                          (value) =>
            {
                errorOccurred = true;
            });

            Assert.IsTrue(propertySet && !errorOccurred, "Failed to execute a CPUQuery with a valid input string");
        }