Answers

If God is all-knowing, why did God ask Adam where he was and whether he had eaten fruit in Genesis? (If the answer to this question is so God could test Adam’s integrity, why would God not have already known this since he is all-knowing and knows the hearts of man?

 

It’s like a parent might ask a kid who did something wrong and hiding, where are you, even though they know the kid is hiding in the closet. It’s possible it was a rhetorical question as well. Adam never hid from God before. When God aksed where are you Adam, it was an expression of God’s discontent and sadness with what happened to Adam.