コード例 #1
0
        public void Verify_AreEqual_WithDifferentObjects_ReturnsFalse()
        {
            // Arrange
            var mapper = new TeamAliasMapper();
            var model  = TeamAliasesMockingSetup.DoMockingSetupForTeamAliasModel(1);
            var entity = TeamAliasesMockingSetup.DoMockingSetupForTeamAlias(2);
            // Act
            var result = mapper.AreEqual(model.Object, entity.Object);

            // Assert
            Assert.False(result);
        }
コード例 #2
0
        public void Verify_MapToModelLite_AssignsLiteOnlyTeamAliasProperties()
        {
            // Arrange
            var mapper = new TeamAliasMapper();
            var entity = TeamAliasesMockingSetup.DoMockingSetupForTeamAlias();
            // Act
            var model = mapper.MapToModelLite(entity.Object);

            // Assert
            // <None>
            // Related Objects
            Assert.Equal(entity.Object.TeamId, model.TeamId);
        }
コード例 #3
0
        public void Verify_MapToModelListingExtension_CallsMapToModel()
        {
            // Arrange
            var mockMapper = new Mock <TeamAliasMapper>();

            mockMapper.Setup(x => x.MapToModelListing(It.IsAny <ITeamAlias>(), It.IsAny <int>()));
            var mockEntity = TeamAliasesMockingSetup.DoMockingSetupForTeamAlias(1);

            TeamAliasMapperExtensions.OverrideMapper(mockMapper.Object);
            // Act
            mockEntity.Object.MapToModelListing();
            // Assert
            mockMapper.Verify(x => x.MapToModelListing(It.IsAny <ITeamAlias>(), It.IsAny <int>()), Times.Once);
        }