Der Restaurantkritiker hat meinen Kuchen
The Food critic tasted my cake.
Can I use probieren or testen in this context? What is the difference between testen, probieren and schmecken?
The verb you want for "test," in the context of food, is "probieren."
Actually, you probably should use "probieren". The sentence you provided is not really proper German. You probably meant:
I say "probably" just in case you meant "Dem Restaurantkritiker hat mein Kuchen geschmeckt."
In fact you could use all three verbs in this sentence, but only "probieren" gives the meaning of your English phrase.
Testen means "to test" (no surprise, since this is the origin of this word according to the Duden) or "to try out". You can apply it on things, but not on actions. In some cases it can be used as a synonym to "probieren", but in general the focus is more on evaluating / measuring / checking whether the thing meets certain quality criteria. It is related to analysis and examination, and it sounds more objective than "probieren".
would be a valid, but unusual German sentence. I think many people would wonder whether the critic took a sample of the cake and sent it to a laboratory for some chemical analysis. However, you could say
which would imply other actions beside tasting the food (e.g. judging how clean it was).
Probieren can be applied on both things and actions.
Regarding things it is probably most often used with foods (meaning "to taste" then), but it is not restricted to foods. (The Duden e.g. lists "ein Medikament probieren", and you could also say "ein neues Shampoo probieren" oder "ein anderes Werkzeug probieren" - "try to do it with another tool".)
Used on actions it means "to try (yourself) doing it", e.g. "probieren, nur noch Deutsch zu reden". It is then a synonym to "versuchen".
"Probieren" always means "to gain experience". It is more subjective than "testen", the focus is on how you like the thing or action. However, there are cases where there is little to no difference to "testen", e.g. "Ich werde mal das neue Shampoo testen." - it can be clear from the context that you are not about writing a review for a health magazine.
When it is about foods you could also use "kosten", which is quite similar, but has IMHO a slightly more optimistic sound. When you use "kosten" you expect to enjoy the food, while "probieren" is a bit more sceptic approach.
Schmecken can be used to express that something tastes good ("es schmeckt gut") and that you like it ("mir schmeckt es"), but also to describe the action of sensing the food on your tongue, whether it is sweet or salty or sour and so on. That is what
would mean: it would describe the moment where the critic had a bit of the cake in his mouth, sensing all the ingredients and finally thinking "oh, what a delicious cake" ;-)
You won't hear "schmecken" used this way very frequently. It appears in poetry, often in a metaphoric sense: "den Wind / das Meer / die Freiheit ... schmecken".
(So watch out for cases: "Dem Restaurantkritiker hat mein Kuchen geschmeckt." would be "The critic liked my cake", as it has already been pointed out in the comments.)