public void Verify_Add_Should_AddTheEntityToTheContext()
 {
     // Arrange
     Mock<IDbSet<TeamCharacterEnemy>> mockSetTeamCharacterEnemies;
     var mockContext = TeamCharacterEnemiesMockingSetup.DoMockingSetupForContext(false, out mockSetTeamCharacterEnemies);
     var repository = new TeamCharacterEnemiesRepository(mockContext.Object);
     var teamCharacterEnemies = new TeamCharacterEnemy { Active = true, CustomKey = "SALVATORE-RAA", };
     // Act
     repository.Add(teamCharacterEnemies);
     // Assert
     mockSetTeamCharacterEnemies.Verify(x => x.Add(teamCharacterEnemies), Times.Once);
 }
        public void Verify_Add_Should_AddTheEntityToTheContext()
        {
            // Arrange
            Mock <IDbSet <TeamCharacterEnemy> > mockSetTeamCharacterEnemies;
            var mockContext          = TeamCharacterEnemiesMockingSetup.DoMockingSetupForContext(false, out mockSetTeamCharacterEnemies);
            var repository           = new TeamCharacterEnemiesRepository(mockContext.Object);
            var teamCharacterEnemies = new TeamCharacterEnemy {
                Active = true, CustomKey = "SALVATORE-RAA",
            };

            // Act
            repository.Add(teamCharacterEnemies);
            // Assert
            mockSetTeamCharacterEnemies.Verify(x => x.Add(teamCharacterEnemies), Times.Once);
        }
        public void Verify_MapToEntity_WithExistingEntity_AssignsTeamCharacterEnemyProperties()
        {
            // Arrange
            var mapper = new TeamCharacterEnemyMapper();
            var model  = TeamCharacterEnemiesMockingSetup.DoMockingSetupForTeamCharacterEnemyModel();
            // Act
            ITeamCharacterEnemy existingEntity = new TeamCharacterEnemy {
                Id = 1
            };

            mapper.MapToEntity(model.Object, ref existingEntity);
            // Assert
            // <None>
            // Related Objects
            Assert.Equal(model.Object.TeamId, existingEntity.TeamId);
            Assert.Equal(model.Object.EnemyId, existingEntity.EnemyId);
            // Associated Objects
            // <None>
        }