Ejemplo n.º 1
0
        public void Verify_AreEqual_WithDifferentObjects_ReturnsFalse()
        {
            // Arrange
            var mapper = new TeamStoryArcMapper();
            var model  = TeamStoryArcsMockingSetup.DoMockingSetupForTeamStoryArcModel(1);
            var entity = TeamStoryArcsMockingSetup.DoMockingSetupForTeamStoryArc(2);
            // Act
            var result = mapper.AreEqual(model.Object, entity.Object);

            // Assert
            Assert.False(result);
        }
Ejemplo n.º 2
0
        public void Verify_MapToEntityExtension_CallsMapToEntity()
        {
            // Arrange
            var mockMapper = new Mock <TeamStoryArcMapper>();

            mockMapper.Setup(x => x.MapToEntity(It.IsAny <ITeamStoryArcModel>(), It.IsAny <int>()));
            var mockModel = TeamStoryArcsMockingSetup.DoMockingSetupForTeamStoryArcModel(1);

            TeamStoryArcMapperExtensions.OverrideMapper(mockMapper.Object);
            // Act
            mockModel.Object.MapToEntity();
            // Assert
            mockMapper.Verify(x => x.MapToEntity(It.IsAny <ITeamStoryArcModel>(), It.IsAny <int>()), Times.Once);
        }
Ejemplo n.º 3
0
        public void Verify_MapToEntity_AssignsTeamStoryArcProperties()
        {
            // Arrange
            var mapper = new TeamStoryArcMapper();
            var model  = TeamStoryArcsMockingSetup.DoMockingSetupForTeamStoryArcModel();
            // Act
            var entity = mapper.MapToEntity(model.Object);

            // Assert
            // <None>
            // Related Objects
            Assert.Equal(model.Object.TeamId, entity.TeamId);
            Assert.Equal(model.Object.StoryArcId, entity.StoryArcId);
            // Associated Objects
            // <None>
        }
Ejemplo n.º 4
0
        public void Verify_MapToSearchModel_AssignsTeamStoryArcSearchProperties()
        {
            // Arrange
            var mapper = new TeamStoryArcMapper();
            var model  = TeamStoryArcsMockingSetup.DoMockingSetupForTeamStoryArcModel();
            // Act
            var searchModel = mapper.MapToSearchModel(model.Object);

            // Assert
            Assert.Equal(model.Object.TeamId, searchModel.TeamId);
            Assert.Equal(model.Object.Team?.CustomKey, searchModel.TeamCustomKey);
            Assert.Equal(model.Object.Team?.ApiDetailUrl, searchModel.TeamApiDetailUrl);
            Assert.Equal(model.Object.Team?.SiteDetailUrl, searchModel.TeamSiteDetailUrl);
            Assert.Equal(model.Object.Team?.Name, searchModel.TeamName);
            Assert.Equal(model.Object.Team?.ShortDescription, searchModel.TeamShortDescription);
            Assert.Equal(model.Object.Team?.Description, searchModel.TeamDescription);
            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);
        }