Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            try
            {
                var manager         = new SalaryManager(new SalaryInternationalTeam());
                var creatorStrategy = new CreatorStrategy();

                Console.WriteLine(Environment.NewLine + "First scenario : Team works in Denmark" + Environment.NewLine);
                manager.Strategy = creatorStrategy.GetStrategy(Helper.Country.Denmark);
                Helper.ShowMessageAboutSalaries(manager.RecalculationSalary());


                Console.WriteLine(Environment.NewLine + "Second scenario: move team to Poland" + Environment.NewLine);
                manager.Strategy = creatorStrategy.GetStrategy(Helper.Country.Poland);
                Helper.ShowMessageAboutSalaries(manager.RecalculationSalary());

                Console.WriteLine(Environment.NewLine + "Third scenario: Back to Denmark" + Environment.NewLine);
                manager.Strategy = creatorStrategy.GetStrategy(Helper.Country.Denmark);
                Helper.ShowMessageAboutSalaries(manager.RecalculationSalary());

                Console.Read();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message + ex.InnerException);
            }
        }
Ejemplo n.º 2
0
      public void GetStrategy_InsertStrategyName_ReturnDefineStrategyClass(Helper.Country insert, string output)
      {
          var creator = new CreatorStrategy();
          var result  = creator.GetStrategy(insert);

          Assert.That(result.Country, Is.EqualTo(output));
      }
Ejemplo n.º 3
0
 public UIItemObjectPool(int count) : base(count)
 {
     _creatorStrategy = new UIItemDataBasedCreatorStrategy();
 }
Ejemplo n.º 4
0
 public GameObjectPool(GameObject prefab, int count) : base(count)
 {
     _creatorStrategy = new PrefabBasedCreatorStrategy(prefab);
 }