public void Collect_contacts() { //моделируем ситуацию если не задана группа рассылки а есть только публичные контакты var report = new GeneralReport { PublicSubscriptions = new ContactGroup { Contacts = { new Contact(ContactType.Email, "*****@*****.**") } } }; report.CollectContacts(); Assert.AreEqual(report.Contacts[0], "*****@*****.**"); Assert.AreEqual(1, report.Contacts.Length); }
public void Collect_contacts_from_groups() { var report = new GeneralReport { ContactGroup = new ContactGroup { Contacts = { new Contact(ContactType.Email, "*****@*****.**") } }, PublicSubscriptions = new ContactGroup { Contacts = { new Contact(ContactType.Email, "*****@*****.**") } } }; report.CollectContacts(); var contacts = report.Contacts.Implode(); Assert.AreEqual(contacts, "[email protected], [email protected]"); }