Example #1
0
        public void Verify_AreEqual_WithDifferentObjects_ReturnsFalse()
        {
            // Arrange
            var mapper = new LocationStoryArcMapper();
            var model  = LocationStoryArcsMockingSetup.DoMockingSetupForLocationStoryArcModel(1);
            var entity = LocationStoryArcsMockingSetup.DoMockingSetupForLocationStoryArc(2);
            // Act
            var result = mapper.AreEqual(model.Object, entity.Object);

            // Assert
            Assert.False(result);
        }
Example #2
0
        public void Verify_MapToEntityExtension_CallsMapToEntity()
        {
            // Arrange
            var mockMapper = new Mock <LocationStoryArcMapper>();

            mockMapper.Setup(x => x.MapToEntity(It.IsAny <ILocationStoryArcModel>(), It.IsAny <int>()));
            var mockModel = LocationStoryArcsMockingSetup.DoMockingSetupForLocationStoryArcModel(1);

            LocationStoryArcMapperExtensions.OverrideMapper(mockMapper.Object);
            // Act
            mockModel.Object.MapToEntity();
            // Assert
            mockMapper.Verify(x => x.MapToEntity(It.IsAny <ILocationStoryArcModel>(), It.IsAny <int>()), Times.Once);
        }
Example #3
0
        public void Verify_MapToModelLite_AssignsLiteOnlyLocationStoryArcProperties()
        {
            // Arrange
            var mapper = new LocationStoryArcMapper();
            var entity = LocationStoryArcsMockingSetup.DoMockingSetupForLocationStoryArc();
            // Act
            var model = mapper.MapToModelLite(entity.Object);

            // Assert
            // <None>
            // Related Objects
            Assert.Equal(entity.Object.LocationId, model.LocationId);
            Assert.Equal(entity.Object.StoryArcId, model.StoryArcId);
        }
Example #4
0
        public void Verify_MapToEntity_AssignsLocationStoryArcProperties()
        {
            // Arrange
            var mapper = new LocationStoryArcMapper();
            var model  = LocationStoryArcsMockingSetup.DoMockingSetupForLocationStoryArcModel();
            // Act
            var entity = mapper.MapToEntity(model.Object);

            // Assert
            // <None>
            // Related Objects
            Assert.Equal(model.Object.LocationId, entity.LocationId);
            Assert.Equal(model.Object.StoryArcId, entity.StoryArcId);
            // Associated Objects
            // <None>
        }
Example #5
0
        public void Verify_MapToSearchModel_AssignsLocationStoryArcSearchProperties()
        {
            // Arrange
            var mapper = new LocationStoryArcMapper();
            var model  = LocationStoryArcsMockingSetup.DoMockingSetupForLocationStoryArcModel();
            // Act
            var searchModel = mapper.MapToSearchModel(model.Object);

            // Assert
            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);
            Assert.Equal(model.Object.StoryArcId, searchModel.StoryArcId);
            Assert.Equal(model.Object.StoryArc?.CustomKey, searchModel.StoryArcCustomKey);
            Assert.Equal(model.Object.StoryArc?.ApiDetailUrl, searchModel.StoryArcApiDetailUrl);
            Assert.Equal(model.Object.StoryArc?.SiteDetailUrl, searchModel.StoryArcSiteDetailUrl);
            Assert.Equal(model.Object.StoryArc?.Name, searchModel.StoryArcName);
            Assert.Equal(model.Object.StoryArc?.ShortDescription, searchModel.StoryArcShortDescription);
            Assert.Equal(model.Object.StoryArc?.Description, searchModel.StoryArcDescription);
        }