I only mean to say that typically people meet potential mates/partners in school and at work. Now, taking a text based conversation to that level is definitely wrong. But I would propose that actually testing for interest in the workplace isn't inherently wrong, only in so much that it's a matter of intent, extent and explicitness that isn't always easy to judge.
Personally, I'm of the mind that a soft ask about dinner/drinks/coffee sometime, and if a decline, then one more ask a few weeks later is probably okay, as long as it ends on a second ask. The reason I say this is only because sometimes a person doesn't feel comfortable if they don't know the person well enough yet, so best not to close the door right away.
On the flip side, this was very explicit without any of the contextual cues you get in person, especially with a soft rejection, is definitely over the top. Never be overtly sexual or dominating over someone in the workplace.