public string health { get; set; }
public string wealth { get; set; }
public string happiness { get; set; }
public void generateHealth();
public void generateWealth();
public void generateHappiness();
public IWish wisher { get; set; }
class BirthdayWish : IWish {
public string health { get; set; }
public string wealth { get; set; }
public string happiness { get; set; }
public void generateHappiness() {
this.happiness = "Щастя";
public void generateHealth() {
this.health = "Здоровья";
public void generateWealth() {
this.wealth = "Багато грошей";
class BirthdayWishPrinter : IWishPrinter {
public IWish wisher { get; set; }
public BirthdayWishPrinter(IWish wisher) {
public void printWish() {
this.wisher.generateHappiness();
this.wisher.generateHealth();
this.wisher.generateWealth();
string[] wishes = { this.wisher.happiness, this.wisher.health, this.wisher.wealth };
string fullWish = string.Join(", ", wishes);
System.Console.WriteLine(fullWish);
public class BirthdaySOLID
public static void Main(string[] args) {
IWishPrinter wishPrinter = new BirthdayWishPrinter(new BirthdayWish());