Ejemplo n.º 1
0
        public void Can_Update_CreativeDomainModel_And_Domain_Creative_Values_Match_CreativeDto_Values()
        {
            Creative creative = new Creative(new PersistCreative {
                AdvertiserId = 5, CreativeName = "Existing Creative Name", CreativeId = 1, Active = true
            });

            _creativeDto.UpdateDomainModel(creative);

            Assert.AreEqual(_creativeDto.Id, creative.Id);
            Assert.AreEqual(_creativeDto.Name, creative.Name);
            Assert.AreEqual(_creativeDto.AdvertiserId, creative.AdvertiserId);
        }
Ejemplo n.º 2
0
        public void UpdateCreative(CreativeDto creativeDto)
        {
            Creative creative = _unitOfWork.Repository.SearchById(creativeDto.Id);

            creativeDto.UpdateDomainModel(creative);
            _unitOfWork.Repository.Update(creative);
            _unitOfWork.Save();
        }