public void Sends_verification_email() { var mockVerify = new Mock <IEmailVerificationService>(); MedicalRecordService medicalRecordService = new MedicalRecordService(CreateStubRepository(), mockVerify.Object); MedicalRecord medicalRecord = medicalRecordService.CreatePatientMedicalRecord(new MailAddress("*****@*****.**"), new MedicalRecord(5, new Patient(5, "misa", "123", "Misa", "Misic", "123123123123", new DateTime(), "066123123", "*****@*****.**", new City("Novi Sad", "Mise Dim", new Country("Srbija")), false), new Anamnesis(), new List <Allergies>(), new List <Medicament>())); mockVerify.Verify(v => v.SendVerificationEmailLink(new MailAddress(medicalRecord.Patient.EMail), medicalRecord.Patient.Username), Times.Once); }