public void Verify_AreEqual_WithDifferentObjects_ReturnsFalse()
        {
            // Arrange
            var mapper = new PublisherAliasMapper();
            var model  = PublisherAliasesMockingSetup.DoMockingSetupForPublisherAliasModel(1);
            var entity = PublisherAliasesMockingSetup.DoMockingSetupForPublisherAlias(2);
            // Act
            var result = mapper.AreEqual(model.Object, entity.Object);

            // Assert
            Assert.False(result);
        }
        public void Verify_MapToModelLite_AssignsLiteOnlyPublisherAliasProperties()
        {
            // Arrange
            var mapper = new PublisherAliasMapper();
            var entity = PublisherAliasesMockingSetup.DoMockingSetupForPublisherAlias();
            // Act
            var model = mapper.MapToModelLite(entity.Object);

            // Assert
            // <None>
            // Related Objects
            Assert.Equal(entity.Object.PublisherId, model.PublisherId);
        }
        public void Verify_MapToEntityExtension_CallsMapToEntity()
        {
            // Arrange
            var mockMapper = new Mock <PublisherAliasMapper>();

            mockMapper.Setup(x => x.MapToEntity(It.IsAny <IPublisherAliasModel>(), It.IsAny <int>()));
            var mockModel = PublisherAliasesMockingSetup.DoMockingSetupForPublisherAliasModel(1);

            PublisherAliasMapperExtensions.OverrideMapper(mockMapper.Object);
            // Act
            mockModel.Object.MapToEntity();
            // Assert
            mockMapper.Verify(x => x.MapToEntity(It.IsAny <IPublisherAliasModel>(), It.IsAny <int>()), Times.Once);
        }
        public void Verify_MapToEntity_AssignsPublisherAliasProperties()
        {
            // Arrange
            var mapper = new PublisherAliasMapper();
            var model  = PublisherAliasesMockingSetup.DoMockingSetupForPublisherAliasModel();
            // Act
            var entity = mapper.MapToEntity(model.Object);

            // Assert
            // <None>
            // Related Objects
            Assert.Equal(model.Object.PublisherId, entity.PublisherId);
            // Associated Objects
            // <None>
        }
        public void Verify_MapToSearchModel_AssignsPublisherAliasSearchProperties()
        {
            // Arrange
            var mapper = new PublisherAliasMapper();
            var model  = PublisherAliasesMockingSetup.DoMockingSetupForPublisherAliasModel();
            // Act
            var searchModel = mapper.MapToSearchModel(model.Object);

            // Assert
            Assert.Equal(model.Object.PublisherId, searchModel.PublisherId);
            Assert.Equal(model.Object.Publisher?.CustomKey, searchModel.PublisherCustomKey);
            Assert.Equal(model.Object.Publisher?.ApiDetailUrl, searchModel.PublisherApiDetailUrl);
            Assert.Equal(model.Object.Publisher?.SiteDetailUrl, searchModel.PublisherSiteDetailUrl);
            Assert.Equal(model.Object.Publisher?.Name, searchModel.PublisherName);
            Assert.Equal(model.Object.Publisher?.ShortDescription, searchModel.PublisherShortDescription);
            Assert.Equal(model.Object.Publisher?.Description, searchModel.PublisherDescription);
        }