コード例 #1
0
        public void MaidVisitsResidence()
        {
            // Arrange
            IResidenceVisitor maid       = new Maid();
            IRoom             bathroom   = new Bathroom();
            IRoom             bedroom    = new Bedroom();
            IRoom             kitchen    = new Kitchen();
            IRoom             livingRoom = new LivingRoom();

            // Act
            bathroom.Accept(maid);
            bedroom.Accept(maid);
            kitchen.Accept(maid);
            livingRoom.Accept(maid);
        }
コード例 #2
0
        public void PlumberVisitsResidence()
        {
            // Arrange
            IResidenceVisitor plumber    = new Plumber();
            IRoom             bathroom   = new Bathroom();
            IRoom             bedroom    = new Bedroom();
            IRoom             kitchen    = new Kitchen();
            IRoom             livingRoom = new LivingRoom();

            // Act
            bathroom.Accept(plumber);
            bedroom.Accept(plumber);
            kitchen.Accept(plumber);
            livingRoom.Accept(plumber);
        }