Comparison between a boson-expansion method and the exact solution in a two-level model