Esempio n. 1
0
        public void MapFromCollection_Should_ReturnCorrectNumberOfTheatres()
        {
            //Arrange
            var sut = new SearchTheatreViewModelMapper();

            var theatres = new List <SearchTheatre>()
            {
                new SearchTheatre
                {
                    Id       = Guid.NewGuid(),
                    Name     = "testName",
                    Location = "testLocation",
                    Phone    = "testPhone",
                },
                new SearchTheatre
                {
                    Id       = Guid.NewGuid(),
                    Name     = "testName2",
                    Location = "testLocation",
                    Phone    = "testPhone"
                }
            };

            //Act
            var result = sut.MapFrom(theatres);

            //Assert
            Assert.AreEqual(2, result.Count());
        }
Esempio n. 2
0
        public void MapFrom_Should_ReturnCorrectInstanceOfCollectionOfTheatreViewModel()
        {
            //Arrange
            var sut = new SearchTheatreViewModelMapper();

            var theatres = new List <SearchTheatre>()
            {
                new SearchTheatre
                {
                    Id       = Guid.NewGuid(),
                    Name     = "testName",
                    Location = "testLocation",
                    Phone    = "testPhone"
                },
                new SearchTheatre
                {
                    Id       = Guid.NewGuid(),
                    Name     = "testName2",
                    Location = "testLocation",
                    Phone    = "testPhone"
                }
            };

            //Act
            var result = sut.MapFrom(theatres);

            //Assert
            Assert.IsInstanceOfType(result, typeof(List <TheatreViewModel>));
        }
Esempio n. 3
0
        public void MapFrom_Should_ReturnCorrectInstanceOf_TheatreViewModel()
        {
            //Arrange
            var sut = new SearchTheatreViewModelMapper();

            var theatre = new SearchTheatre
            {
                Id            = Guid.NewGuid(),
                Name          = "testName",
                Location      = "testLocation",
                AverageRating = 5,
            };

            //Act
            var result = sut.MapFrom(theatre);

            //Assert
            Assert.IsInstanceOfType(result, typeof(TheatreViewModel));
        }
Esempio n. 4
0
        public void MapFrom_Should_Return_CorrectInstanceOf_TheatreViewModel()
        {
            //Arrange
            var sut = new SearchTheatreViewModelMapper();

            var theatre = new SearchTheatre
            {
                Id            = Guid.NewGuid(),
                Name          = "testName",
                Location      = "testLocation",
                AverageRating = 5,
            };

            //Act
            var result = sut.MapFrom(theatre);

            //Assert
            Assert.AreEqual(result.Id, theatre.Id);
            Assert.AreEqual(result.Name, theatre.Name);
            Assert.AreEqual(result.Location, theatre.Location);
            Assert.AreEqual(result.AverageRating, theatre.AverageRating);
        }