loading
main.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using System;

class MainClass {
  public static void Main (string[] args) {

    IGreeting gre1 = new EnglishGreeting("Kenan Hancer");

    IGreeting gre2 = new TurkishGreeting("Kenan Hancer");

    WriteMessageToConsole(gre1);

    WriteMessageToConsole(gre2);

    WriteMessageToFile("HelloMessage.txt", gre2);
  }

  private static void WriteMessageToConsole(IGreeting greeting)
  {
    string message = greeting.sayHello();

    Console.WriteLine(message);
  }

  private static void WriteMessageToFile(string filePath, IGreeting greeting)
  {
    string message = greeting.sayHello();

    System.IO.File.WriteAllText(filePath, message);
  }
}