Exemplo n.º 1
0
        public void Verify_AreEqual_WithEqualObjects_ReturnsTrue()
        {
            // Arrange
            var mapper = new TeamMemberMapper();
            var model  = TeamMembersMockingSetup.DoMockingSetupForTeamMemberModel(1);
            var entity = TeamMembersMockingSetup.DoMockingSetupForTeamMember(1);
            // Act
            var result = mapper.AreEqual(model.Object, entity.Object);

            // Assert
            Assert.True(result);
        }
Exemplo n.º 2
0
        public void Verify_MapToModelLite_AssignsLiteOnlyTeamMemberProperties()
        {
            // Arrange
            var mapper = new TeamMemberMapper();
            var entity = TeamMembersMockingSetup.DoMockingSetupForTeamMember();
            // Act
            var model = mapper.MapToModelLite(entity.Object);

            // Assert
            // <None>
            // Related Objects
            Assert.Equal(entity.Object.TeamId, model.TeamId);
            Assert.Equal(entity.Object.CharacterId, model.CharacterId);
        }
Exemplo n.º 3
0
        public void Verify_MapToModelListingExtension_CallsMapToModel()
        {
            // Arrange
            var mockMapper = new Mock <TeamMemberMapper>();

            mockMapper.Setup(x => x.MapToModelListing(It.IsAny <ITeamMember>(), It.IsAny <int>()));
            var mockEntity = TeamMembersMockingSetup.DoMockingSetupForTeamMember(1);

            TeamMemberMapperExtensions.OverrideMapper(mockMapper.Object);
            // Act
            mockEntity.Object.MapToModelListing();
            // Assert
            mockMapper.Verify(x => x.MapToModelListing(It.IsAny <ITeamMember>(), It.IsAny <int>()), Times.Once);
        }
Exemplo n.º 4
0
        public void Verify_AreEqualExtension_CallsAreEqual()
        {
            // Arrange
            var mockMapper = new Mock <TeamMemberMapper>();

            mockMapper.Setup(x => x.AreEqual(It.IsAny <ITeamMemberModel>(), It.IsAny <ITeamMember>()));
            TeamMemberMapperExtensions.OverrideMapper(mockMapper.Object);
            var mockModel  = TeamMembersMockingSetup.DoMockingSetupForTeamMemberModel(1);
            var mockEntity = TeamMembersMockingSetup.DoMockingSetupForTeamMember(1);

            // Act
            mockModel.Object.AreEqual(mockEntity.Object);
            // Assert
            mockMapper.Verify(x => x.AreEqual(It.IsAny <ITeamMemberModel>(), It.IsAny <ITeamMember>()), Times.Once);
        }