public void Verify_AreEqual_WithDifferentObjects_ReturnsFalse()
        {
            // Arrange
            var mapper = new SeriesLocationMapper();
            var model  = SeriesLocationsMockingSetup.DoMockingSetupForSeriesLocationModel(1);
            var entity = SeriesLocationsMockingSetup.DoMockingSetupForSeriesLocation(2);
            // Act
            var result = mapper.AreEqual(model.Object, entity.Object);

            // Assert
            Assert.False(result);
        }
        public void Verify_MapToEntityExtension_CallsMapToEntity()
        {
            // Arrange
            var mockMapper = new Mock <SeriesLocationMapper>();

            mockMapper.Setup(x => x.MapToEntity(It.IsAny <ISeriesLocationModel>(), It.IsAny <int>()));
            var mockModel = SeriesLocationsMockingSetup.DoMockingSetupForSeriesLocationModel(1);

            SeriesLocationMapperExtensions.OverrideMapper(mockMapper.Object);
            // Act
            mockModel.Object.MapToEntity();
            // Assert
            mockMapper.Verify(x => x.MapToEntity(It.IsAny <ISeriesLocationModel>(), It.IsAny <int>()), Times.Once);
        }
        public void Verify_MapToModelLite_AssignsLiteOnlySeriesLocationProperties()
        {
            // Arrange
            var mapper = new SeriesLocationMapper();
            var entity = SeriesLocationsMockingSetup.DoMockingSetupForSeriesLocation();
            // Act
            var model = mapper.MapToModelLite(entity.Object);

            // Assert
            // <None>
            // Related Objects
            Assert.Equal(entity.Object.SeriesId, model.SeriesId);
            Assert.Equal(entity.Object.LocationId, model.LocationId);
        }
        public void Verify_MapToEntity_AssignsSeriesLocationProperties()
        {
            // Arrange
            var mapper = new SeriesLocationMapper();
            var model  = SeriesLocationsMockingSetup.DoMockingSetupForSeriesLocationModel();
            // Act
            var entity = mapper.MapToEntity(model.Object);

            // Assert
            // <None>
            // Related Objects
            Assert.Equal(model.Object.SeriesId, entity.SeriesId);
            Assert.Equal(model.Object.LocationId, entity.LocationId);
            // Associated Objects
            // <None>
        }
        public void Verify_MapToSearchModel_AssignsSeriesLocationSearchProperties()
        {
            // Arrange
            var mapper = new SeriesLocationMapper();
            var model  = SeriesLocationsMockingSetup.DoMockingSetupForSeriesLocationModel();
            // Act
            var searchModel = mapper.MapToSearchModel(model.Object);

            // Assert
            Assert.Equal(model.Object.SeriesId, searchModel.SeriesId);
            Assert.Equal(model.Object.Series?.CustomKey, searchModel.SeriesCustomKey);
            Assert.Equal(model.Object.Series?.ApiDetailUrl, searchModel.SeriesApiDetailUrl);
            Assert.Equal(model.Object.Series?.SiteDetailUrl, searchModel.SeriesSiteDetailUrl);
            Assert.Equal(model.Object.Series?.Name, searchModel.SeriesName);
            Assert.Equal(model.Object.Series?.ShortDescription, searchModel.SeriesShortDescription);
            Assert.Equal(model.Object.Series?.Description, searchModel.SeriesDescription);
            Assert.Equal(model.Object.LocationId, searchModel.LocationId);
            Assert.Equal(model.Object.Location?.CustomKey, searchModel.LocationCustomKey);
            Assert.Equal(model.Object.Location?.ApiDetailUrl, searchModel.LocationApiDetailUrl);
            Assert.Equal(model.Object.Location?.SiteDetailUrl, searchModel.LocationSiteDetailUrl);
            Assert.Equal(model.Object.Location?.Name, searchModel.LocationName);
            Assert.Equal(model.Object.Location?.ShortDescription, searchModel.LocationShortDescription);
            Assert.Equal(model.Object.Location?.Description, searchModel.LocationDescription);
        }