Ejemplo n.º 1
0
        public void CheckIfMuseumTwoIsCreatedWithRightNumberOfRooms()
        {
            //Arrange

            //Build the test museum
            ZornMuseet builder    = new ZornMuseet();
            Museum     testMuseum = builder.BuildZornMuseet();
            //Get the list of rooms in the museum
            List <Room> listOfRooms = testMuseum.GetListOfRooms();

            //Act
            int numberOfRooms      = listOfRooms.Count;
            int rightNumberOfRooms = 4;

            //Assert
            Assert.Equal(rightNumberOfRooms, numberOfRooms);
        }
        public void CheckIfEachRoomHaveOneAdjoiningRoom()
        {
            //Arrange

            //Build the test museum
            ZornMuseet builder    = new ZornMuseet();
            Museum     testMuseum = builder.BuildZornMuseet();
            //Get the list of rooms in the museum
            List <Room> listOfRooms = testMuseum.GetListOfRooms();

            //Act
            foreach (var room in listOfRooms)
            {
                //Get the list of adjoining rooms
                List <Room> adjoiningRooms         = room.GetAdjoiningRooms();
                int         numberOfAdjoiningRooms = adjoiningRooms.Count;

                //Assert
                //Check that adjoining rooms is greater than zero in each room
                Assert.True(numberOfAdjoiningRooms > 0);
            }
        }
        public void CheckIfEachMuseumHaveExpextedAmountOfArtworks()
        {
            //Arrange

            //Build the test museum
            ZornMuseet builder    = new ZornMuseet();
            Museum     testMuseum = builder.BuildZornMuseet();
            //Get the list of rooms in the museum
            List <Room> listOfRooms = testMuseum.GetListOfRooms();

            //Act
            int numberOfArtworks = 0;

            foreach (var room in listOfRooms)
            {
                //Get the list of artworks for each room
                List <Artwork> artworks = room.GetArtworks();
                numberOfArtworks = numberOfArtworks + artworks.Count;
            }

            //Assert
            //Check that the total amount of artworks in the museum is 6
            Assert.Equal(6, numberOfArtworks);
        }