public void ensure_file_is_valid()
        {
            GivenAValidStreetSpecification();
            GivenATownPlanner();

            _townPlanner.IsValid().ShouldBeTrue();
        }
        public void ensure_house_count_is_zero_when_street_specification_not_loaded()
        {
            _townPlanner = TownPlanner.Create(_streetSpecificationReader);

            _townPlanner.NorthSideHouses().Count().ShouldBe(0);
            _townPlanner.IsValid().ShouldBeFalse();
            _townPlanner.GetHousesWestToEast().Count.ShouldBe(0);
            _townPlanner.SouthSideHouses().Count().ShouldBe(0);
            _townPlanner.NumberOfHousesInStreet().ShouldBe(0);
            _townPlanner.NumberOfHousesOnNorthSide().ShouldBe(0);
            _townPlanner.NumberOfHousesOnSouthSide().ShouldBe(0);
        }
Ejemplo n.º 3
0
        private static void DisplayTownPlanningReport(ITownPlanner townplanner)
        {
            System.Console.WriteLine("Town Planning report (Story 1)");
            System.Console.WriteLine("-------------------------------");
            if (townplanner.IsValid())
            {
                System.Console.WriteLine("Report is valid");
            }
            else
            {
                System.Console.WriteLine("The report is invalid");
            }

            System.Console.WriteLine("Number of houses in street: {0}", townplanner.NumberOfHousesInStreet());

            System.Console.WriteLine("Number of houses on North side: {0}", townplanner.NumberOfHousesOnNorthSide());
            System.Console.WriteLine("Number of houses on South side: {0}", townplanner.NumberOfHousesOnSouthSide());
        }
Ejemplo n.º 4
0
        public void Given_a_valid_file_when_checking_file_then_it_should_be_valid()
        {
            GivenADefaultTownPlanner();

            _townplanner.IsValid().ShouldBeTrue();
        }