Example #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());
        }
Example #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>));
        }
Example #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));
        }
Example #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);
        }