It sounds like you're really asking about how to measure in a given Pauli basis. (I'm assuming for simplicity that you are working with only a single qubit, but the below is generalizable to multiple qubits as well.)
Q# has a Measure operation which performs a measurement in a given Pauli basis. For example, if you have a Qubit object q in some state $|\psi\rangle$ and you want to measure it in the $X$ basis, you can write:
let result = Measure([PauliX], [q]);
Here result will be either Zero or One. If you want to then estimate the expectation value of the measurement, you would need to repeat your full operation (including whatever you did to prepare your qubit in the state $|\psi\rangle$) many times and take an average of the measurement results.
Zeroresult corresponds to |+⟩ and aOneresult corresponds to |-⟩. So it's correct that measuring the state |0⟩ in the Pauli-X basis will give equal probabilities ofZeroandOne. On the other hand, if you measure |0⟩ in the Pauli-Z basis, you should getZerowith 100% probability. – Ryan Shaffer May 16 '20 at 13:51