Esempio n. 1
0
        public void ShoudWorkForOfficeFurnitureCreation()
        {
            IFurnitureFactory officeFurnitureFactory = new OfficeFurnitureFactory();
            IChair            chair = officeFurnitureFactory.CreateChair();
            ITable            table = officeFurnitureFactory.CreateTable();

            chair.GetType().Name.Should().Be("ComputerChair");
            table.GetType().Name.Should().Be("ComputerTable");
        }
Esempio n. 2
0
        public void ShoudWorkForHomeFurnitureCreation()
        {
            IFurnitureFactory officeFurnitureFactory = new HomeFurnitureFactory();
            IChair            chair = officeFurnitureFactory.CreateChair();
            ITable            table = officeFurnitureFactory.CreateTable();

            chair.GetType().Name.Should().Be("SofaChair");
            table.GetType().Name.Should().Be("DyningTable");
        }
Esempio n. 3
0
 private void ShowChairInfo(IChair chair)
 {
     Console.WriteLine($"{chair.GetType().Name} has legs: {chair.HasLegs()}");
     chair.SitOn();
 }
Esempio n. 4
0
 public void Fit(IChair chair)
 {
     Console.WriteLine($"{chair.GetType().Name} perfectly fits to the {GetType().Name}");
 }