You have the correct method but the equation is supposed to be a summation, meaning in an ideal situation you should have many tries with varying numbers of throws, each with different observed and expected values.
I claim that I am a very good dart's player, and that I can hit the bulls-eye of a dart board with probability 0.785 each time I throw a dart. You decide to check my claim in an experiment. In 60 throws of a dart I hit the bulls-eye 48 times. What would be the goodness-of-fit test statistic of the null hypothesis that I am telling the truth?
Bulls eye 47.1
bully eye 0.017197
Is this right, cos I think that my method may be wrong?
Now the question is is 48 hits from 60 throws improbably far from the expected number of ~=47.1. Well as the SD of the number of hits is ~=3.1 for this binomial distribution, so without doing any test we know that 48 is not significantly different from 47.1