2010-10-14 8 views

risposta

45
mock.Setup(m => m.CreatePersonName(It.IsAny<PersonName>())) 
      .Returns((PersonName p) => p); 

Sulla base:

// access invocation arguments when returning a value 
mock.Setup(x => x.DoSomething(It.IsAny<string>())) 
       .Returns((string s) => s.ToLower()); 

da http://code.google.com/p/moq/wiki/QuickStart

+0

ringrazio molto –

+0

Codice ora migrato a GitHub: https : //github.com/Moq/moq4/wiki/Quickstart – miltonb

Problemi correlati