Yorkies are good dogs, BUT VERY difficult to house break. Esp the males. We have an neutered 8 y.o. Shitzu-Yorkie mix, and he still pisses in the house on occasion. Sometimes it seems as if it is out of spite when my wife leaves the house. If I had to do it all over again, I would not get a Yorkie because of that. Fortunately we already had plans to replace all the carpet in our house with wood, just haven't got to the upstairs yet and that's where he sneaks off to go now if left alone, or if we forget to put the kiddie gate up on the landing.
It's pure spite. They're temperamental little shits! My wife's yorkie took a dump right on her pillow one time because she left her at home. (I'm talking about my wife's pillow, (where she laid her head to sleep!) not the dog pillow.) That was before we met, though, because if it had been w/ me, I would've slung her little ass into a wall. And if you yell at them or upset them in any way, they're guaranteed to sneak off somewhere and piss all over your carpet. Ours will do fine until you upset her in some way. Then we have to watch her little ass like a hawk until she gets over it! It got so annoying that we got one of those Invisible Fence indoor pucks to keep her out of the great room.
Ours is 12 years old. Don't ever call her a "teacup" yorkie, either. My wife will slice you up real good! LOL