jeudi 30 juillet 2015

Mocking a method for unit testing

I want to mock the below method which takes parameters in order to do unit testing using fakes and shims. I am not having any idea it new for me. Any ideas would be helpful.

public string Renotify(int[] userIds)
{
     var notify = new NotificationPublisher();
     var message = "A request has been awaiting for your approval. Please check the application for details to approve the request ";
     var subject = "Logos Approval Notification";

     if (userIds.Length < 1)
         return "Please select users to notify";

     List<NotificationUser> userList = userIds.Select(t => new NotificationUser { userId = t }).ToList();
     notify.SendNotification(userList, message, subject);
     return "Success - Approvers Renotified";

}

Aucun commentaire:

Enregistrer un commentaire