public void CPUQuery_WithNoErrorCallback_Throws() { CPUQueryCustomAction.CPUQuery("OutputProp=MMX_SUPPORTED_PROP;IsProcessorFeaturePresent=InstructionsMMXAvailable", (property, value) => { }, (value) => { }, null); }
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"); }
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"); }
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"); }
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"); }
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"); }