samedi 2 juillet 2016

C# Obects & Methods

Can I create the below class structure? Is this a good design?

class Employee 
{

    public FirstName {get;set;}
    public LastName { get;set;}

    public string GetEmployeeName()
    {
        // database or service call

        return FirstName+LastName;
    }
}

If I create a class like this, how do I properly unit test? Can I implement an interface in this call? Is there any specific design pattern stating this design?

Thanks

Aucun commentaire:

Enregistrer un commentaire