public void Repository_Insert_Get_All_Delete_PerformanceParameter_Test()
        {
            try
            {
                // Arrange
                PerformanceParameterRepository performanceParameterRepository = new PerformanceParameterRepository();
                PerformanceParameter           performanceParameterToSave     = new PerformanceParameter();
                performanceParameterToSave.sportId              = 1;
                performanceParameterToSave.perfParaName         = new PerformanceParameterName();
                performanceParameterToSave.perfParaName.id      = 1;
                performanceParameterToSave.customName           = "custom";
                performanceParameterToSave.perfParaTypeGroup    = new PerformanceParameterTypeGroup();
                performanceParameterToSave.perfParaTypeGroup.id = 1;

                // Act
                long      performanceParameterId      = performanceParameterRepository.InsertPerformanceParameter(performanceParameterToSave);
                ArrayList performanceParametersFromDb = performanceParameterRepository.GetPerformanceParameters(performanceParameterToSave.sportId);

                // Assert
                Assert.IsTrue(performanceParametersFromDb.Count > 0);
                Assert.AreEqual(((PerformanceParameter)performanceParametersFromDb[1]).sportId, performanceParameterToSave.sportId);
                Assert.AreEqual(((PerformanceParameter)performanceParametersFromDb[1]).perfParaName.id, performanceParameterToSave.perfParaName.id);
                Assert.AreEqual(((PerformanceParameter)performanceParametersFromDb[1]).customName, performanceParameterToSave.customName);
                Assert.AreEqual(((PerformanceParameter)performanceParametersFromDb[1]).perfParaTypeGroup.id, performanceParameterToSave.perfParaTypeGroup.id);

                // Cleanup
                bool isDeleted = performanceParameterRepository.DeletePerformanceParameter(performanceParameterId);
                Assert.IsTrue(isDeleted);
            }
            catch (Exception ex)
            {
                throw new AssertFailedException("Unable to add new performance parameter.");
            }
        }
        public void Repository_Insert_Update_Delete_PerformanceParameter_Test()
        {
            try
            {
                // Arrange
                PerformanceParameterRepository performanceParameterRepository = new PerformanceParameterRepository();
                PerformanceParameter           performanceParameterToSave     = new PerformanceParameter();
                performanceParameterToSave.sportId              = 1;
                performanceParameterToSave.perfParaName         = new PerformanceParameterName();
                performanceParameterToSave.perfParaName.id      = 1;
                performanceParameterToSave.customName           = "custom";
                performanceParameterToSave.perfParaTypeGroup    = new PerformanceParameterTypeGroup();
                performanceParameterToSave.perfParaTypeGroup.id = 1;

                PerformanceParameter performanceParameterToUpdate = new PerformanceParameter();
                performanceParameterToUpdate.sportId              = 1;
                performanceParameterToUpdate.perfParaName         = new PerformanceParameterName();
                performanceParameterToUpdate.perfParaName.id      = 2;
                performanceParameterToUpdate.customName           = "custom 2";
                performanceParameterToUpdate.perfParaTypeGroup    = new PerformanceParameterTypeGroup();
                performanceParameterToUpdate.perfParaTypeGroup.id = 5;

                // Act
                long performanceParameterId = performanceParameterRepository.InsertPerformanceParameter(performanceParameterToSave);
                performanceParameterToUpdate.id = performanceParameterId;
                bool isUpdated = performanceParameterRepository.UpdatePerformanceParameter(performanceParameterToUpdate);
                PerformanceParameter performanceParameterFromDb = performanceParameterRepository.GetPerformanceParameter(performanceParameterId);

                // Assert
                Assert.IsTrue(isUpdated);
                Assert.AreEqual(performanceParameterFromDb.sportId, performanceParameterToUpdate.sportId);
                Assert.AreEqual(performanceParameterFromDb.perfParaName.id, performanceParameterToUpdate.perfParaName.id);
                Assert.AreEqual(performanceParameterFromDb.customName, performanceParameterToUpdate.customName);
                Assert.AreEqual(performanceParameterFromDb.perfParaTypeGroup.id, performanceParameterToUpdate.perfParaTypeGroup.id);

                // Cleanup
                bool isDeleted = performanceParameterRepository.DeletePerformanceParameter(performanceParameterId);
                Assert.IsTrue(isDeleted);
            }
            catch (Exception)
            {
                throw new AssertFailedException("Unable to add new performance parameter.");
            }
        }