As @JSdJ indicated in their comment, one approach is to perform the assertion in the -basis instead of the -basis:

```
open Microsoft.Quantum.Diagnostics;
@Test("QuantumSimulator")
operation CheckThatHPreparesPlus() : Unit {
using (q = Qubit()) {
within { H(q); }
apply {
AssertMeasurement([PauliZ], [q], Zero, "H operation did not prepare |+⟩, given input in |0⟩.");
}
}
}
```

Another approach would be to use the `AssertMeasurementProbability`

operation, which asserts that the probability of a given hypothetical measurement is equal to an expected probability:

```
open Microsoft.Quantum.Diagnostics;
@Test("QuantumSimulator")
operation CheckThatHPreparesPlus() : Unit {
using (q = Qubit()) {
within { H(q); }
apply {
AssertMeasurementProbability(
[PauliZ], [q], Zero, 0.5,
"State prepared by H operation does not admit 50/50 measurement in basis.", 1e-8
);
}
}
}
```

This second approach checks a weaker condition than the asserting in the -basis, since measuring a qubit in either the |+⟩ or |−⟩ state will result in 50/50 probabilities when measured in the -basis, but only the |+⟩ has a 100% probability of returning a `Zero`

when measured in the -basis.

Either way, though, one thing to keep in mind is that these assertions use that they're run on a simulator to do their job. By design, these assertions can be safely stripped when run on hardware, such that the no-cloning theorem applies. As Chris Kang notes in his answer, to test that hardware does what you expect can be involve some fairly different techniques compared to using a simulator to check that your program does what you expect. There's a lot of neat research out there (that's my main area of research, for example) on how to do that — you might find quantum tomography to be an interesting place to start!

3I'm not familiar with Q#, but from the looks of it you could change the 'PauliZ' to 'PauliX' to check if the state is an eigenstate of the X operator - that's because the Hadamard transforms the eigenstates of the Pauli Z to the Pauli X operator (and vice-versa, btw) – JSdJ – 2020-08-07T14:57:44.847