Exemplo 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");
        }
Exemplo 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");
        }
Exemplo n.º 3
0
 private void ShowChairInfo(IChair chair)
 {
     Console.WriteLine($"{chair.GetType().Name} has legs: {chair.HasLegs()}");
     chair.SitOn();
 }
Exemplo n.º 4
0
 public void Fit(IChair chair)
 {
     Console.WriteLine($"{chair.GetType().Name} perfectly fits to the {GetType().Name}");
 }