While God is omniscient, we are not. The testings that God either sends or allows are not because God doesn't have a clue about the outcome but rather to increase our faith (our confident trust, if you will) in Him.
In the case of Abraham and Isaac, Hebrews 11:17-18 indicates that even if Isaac were actually killed, Abraham had that confident trust in the LORD that He would raise Isaac from the dead in order to keep His promise to Abraham of a seed.
I especially like the way the KJV words Gen. 22:8a "God will provide HIMSELF a lamb...." You see, He did provide Himself in the person of Jesus Christ, the Lamb of God.
While I have no way to prove it, I just kind of believe that when Abraham was on top of Mt. Moriah (the future site of the temple of Jerusalem) he might have been looking in the direction of Mt. Calvary.
Perhaps this is at least some of what Jesus meant when He said that "Your father Abraham rejoiced to see my day: and he saw it, and was glad." (John 8:56)