Surely/I was certain — used when you were convinced of something but it turned out to be false.
てっきり彼が来ると思っていたら、別の人が来た。
I was certain he would come, but someone else showed up.
てっきり宿題は明日までだと思っていたから、まだやってない。
I was sure the homework was due tomorrow, so I haven't done it yet.
彼女は留学中だとてっきり思っていたが、地元にいたらしい。
I was convinced she was studying abroad, but apparently she was back home.