Ye are of God, little children, and have overcome them: because greater is he that is in you, than he that is in the world. They are of the world: therefore speak they of the world, and the world heareth them. We are of God: he that knoweth God heareth us; he that is not of God heareth not us. Hereby know we the spirit of truth, and the spirit of error. (1 John 4:4-6 KJV)
When John says, "he that knoweth God heareth us; he that is not of God heareth not us", the "us" refers to the apostles and those who believe God's Word and live it. If you give the gospel to someone and they will not listen and accept it, then you know that they do not know God.
It's that simple. When someone claims to be a Christian, ask them who Jesus was and what they think about Him. That will tell you whether or not they know God or are a Christian in name only or if they are a real Christian. If someone counters what the Bible teaches about Jesus Christ or adds their own doctrine to what the Bible says about Him, you can be sure they do not really know God.
Remember, that greater is he that is in you than he that is in the world!