mercredi 12 décembre 2018

Can someone explain code syntax used in Expectations [duplicate]

This question already has an answer here:

I saw syntax similar to following

new Expectations()
{
    {
        TestClass.getName();
        returns("Hello World");
    }
}

I know Expectations is abstract class, so is this the anonymous class having a instance block?

How it works? Which design pattern is used?

Thanks !!!

Aucun commentaire:

Enregistrer un commentaire