When you do an extract method or an extract class, you have a choice. You can just do the refactoring, leaving the new thing out by itself with no unit tests, you can supply the tests. How do you write the unit tests?
You could always write tests after you've extracted, but do you have to? Don't you know the name of the method or the class when you extract it? So, if you are going to extract a method, think of a name for the method, think of a context which could use the method and capture it in a test. When you do the extraction, the test will pass. For classes, make a test case class that just constructs the object. Write tests for each method prior to the move.