Example #1
0
        public void PaintsWindowBordersOfALargeHouse()
        {
            Color newColor = Color.Lime;

            House house = HouseBuilderWithSyntax.Create()
                          .WithFrontDoorOfColor(Color.Gray)
                          .AddFloor()
                          .WithRoomHavingWindowsQuantityOf(2)
                          .WithRoomHavingWindowsQuantityOf(1)
                          .WithRoomHavingWindowsQuantityOf(1)
                          .AddFloor()
                          .WithRoomHavingWindowsQuantityOf(2)
                          .WithRoomHavingWindowsQuantityOf(2)
                          .WithRoomHavingWindowsQuantityOf(1)
                          .Build();

            IReadOnlyCollection <Room> allRoomsOfFirstFloor  = house.Floors.First().Rooms;
            IReadOnlyCollection <Room> allRoomsOfSecondFloor = house.Floors.Last().Rooms;

            var testee = new HousePainter(house);

            testee.ChangeBorderColorOfAllWindows(newColor);

            allRoomsOfFirstFloor.Should().Match(rooms => rooms.All(r => r.Windows.All(w => w.BorderColor == newColor)));
            allRoomsOfSecondFloor.Should().Match(rooms => rooms.All(r => r.Windows.All(w => w.BorderColor == newColor)));
        }
Example #2
0
        public void PaintsTheWindowBorders()
        {
            Color        newColor = Color.FromArgb(10, 15, 72);
            HousePainter testee   = CreateTestee();

            testee.ChangeBorderColorOfAllWindows(newColor);
            ICollection <XElement> result = testee.GetResult().WindowElements();

            result.First().ColorAttributeValue().Should().Be(newColor);
            result.Last().ColorAttributeValue().Should().Be(newColor);
        }
Example #3
0
        public void PaintsWindowBordersOfASmallHouse()
        {
            Color newColor = Color.OrangeRed;

            House house = HouseBuilderWithSyntax.Create()
                          .WithFrontDoorOfColor(Color.Gray)
                          .AddFloor()
                          .AddRoom()
                          .AddWindowWithBorderColor(Color.Gray)
                          .Build();

            Window onlyWindowInHouse = house.Floors.Single().Rooms.Single().Windows.Single();

            var testee = new HousePainter(house);

            testee.ChangeBorderColorOfAllWindows(newColor);

            onlyWindowInHouse.BorderColor.Should().Be(newColor);
        }