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