If statements not checked in UnityTests

Hello! I’m currently running several UnityTests for an assignment but I am struggling with putting in an if statement in the test - they seem to not be checked at all. If I put a Debug.Log(); message in the statement, it is never printed either.

If anyone could help me out explaining the issue, I’d appreciate it!
An example of what I’m trying to test:

    public IEnumerator DoesPlayerLoseLife()
        var storeLives = player.GetComponent<PlayerLives>().lives;
        if (player.GetComponent<PlayerController>().hit)
            Assert.Less(storeLives, player.GetComponent<PlayerLives>().lives);
        yield return new WaitForEndOfFrame();