public async void GetComplianceYearsWithSubmittedMemberUploads_SchemeWithTwoSubmittedMemberUploadsInSameYear_ReturnsYearOnce()
        {
            const int complianceYear = 1956;

            using (var databaseWrapper = new DatabaseWrapper())
            {
                // Arrange
                var modelHelper = new ModelHelper(databaseWrapper.Model);

                var scheme = modelHelper.CreateScheme();

                var firstMemberUpload = modelHelper.CreateMemberUpload(scheme);
                firstMemberUpload.IsSubmitted    = true;
                firstMemberUpload.ComplianceYear = complianceYear;

                var secondMemberUpload = modelHelper.CreateMemberUpload(scheme);
                secondMemberUpload.IsSubmitted    = true;
                secondMemberUpload.ComplianceYear = complianceYear;

                await databaseWrapper.Model.SaveChangesAsync();

                // Act
                var dataAccess = new SchemeDataAccess(databaseWrapper.WeeeContext);

                var result = await dataAccess.GetComplianceYearsWithSubmittedMemberUploads(scheme.Id);

                // Assert
                Assert.Single(result);
                Assert.Equal(complianceYear, result.Single());
            }
        }
        public async void GetComplianceYearsWithSubmittedMemberUploads_SchemeWithTwoSubmittedMemberUploadsInDifferentYears_ReturnsBothYears()
        {
            const int firstComplianceYear  = 1921;
            const int secondComplianceYear = 1922;

            using (var databaseWrapper = new DatabaseWrapper())
            {
                // Arrange
                var modelHelper = new ModelHelper(databaseWrapper.Model);

                var scheme = modelHelper.CreateScheme();

                var firstMemberUpload = modelHelper.CreateMemberUpload(scheme);
                firstMemberUpload.IsSubmitted    = true;
                firstMemberUpload.ComplianceYear = firstComplianceYear;

                var secondMemberUpload = modelHelper.CreateMemberUpload(scheme);
                secondMemberUpload.IsSubmitted    = true;
                secondMemberUpload.ComplianceYear = secondComplianceYear;

                await databaseWrapper.Model.SaveChangesAsync();

                // Act
                var dataAccess = new SchemeDataAccess(databaseWrapper.WeeeContext);

                var result = await dataAccess.GetComplianceYearsWithSubmittedMemberUploads(scheme.Id);

                // Assert
                Assert.Equal(2, result.Count);
                Assert.Contains(firstComplianceYear, result);
                Assert.Contains(secondComplianceYear, result);
            }
        }
        public async void GetComplianceYearsWithSubmittedMemberUploads_SchemeHasSubmittedMemberUpload_ReturnsCorrespondingComplianceYear()
        {
            const int complianceYear = 1923;

            using (var databaseWrapper = new DatabaseWrapper())
            {
                // Arrange
                var modelHelper = new ModelHelper(databaseWrapper.Model);

                var scheme = modelHelper.CreateScheme();
                var memberUpload = modelHelper.CreateMemberUpload(scheme);

                memberUpload.IsSubmitted = true;
                memberUpload.ComplianceYear = complianceYear;

                await databaseWrapper.Model.SaveChangesAsync();

                // Act
                var dataAccess = new SchemeDataAccess(databaseWrapper.WeeeContext);

                var result = await dataAccess.GetComplianceYearsWithSubmittedMemberUploads(scheme.Id);

                // Assert
                Assert.Single(result);
                Assert.Equal(complianceYear, result.Single());
            }
        }
        public async void GetComplianceYearsWithSubmittedMemberUploads_SchemeHasNoMemberUploads_ReturnsNoYears()
        {
            using (var databaseWrapper = new DatabaseWrapper())
            {
                // Arrange
                var modelHelper = new ModelHelper(databaseWrapper.Model);

                var scheme = modelHelper.CreateScheme();

                await databaseWrapper.Model.SaveChangesAsync();

                // Act
                var dataAccess = new SchemeDataAccess(databaseWrapper.WeeeContext);

                var result = await dataAccess.GetComplianceYearsWithSubmittedMemberUploads(scheme.Id);

                // Assert
                Assert.Empty(result);
            }
        }
        public async void GetComplianceYearsWithSubmittedMemberUploads_SchemeHasNoMemberUploads_ReturnsNoYears()
        {
            using (var databaseWrapper = new DatabaseWrapper())
            {
                // Arrange
                var modelHelper = new ModelHelper(databaseWrapper.Model);

                var scheme = modelHelper.CreateScheme();

                await databaseWrapper.Model.SaveChangesAsync();

                // Act
                var dataAccess = new SchemeDataAccess(databaseWrapper.WeeeContext);

                var result = await dataAccess.GetComplianceYearsWithSubmittedMemberUploads(scheme.Id);

                // Assert
                Assert.Empty(result);
            }
        }
        public async void GetComplianceYearsWithSubmittedMemberUploads_SchemeWithTwoSubmittedMemberUploadsInDifferentYears_ReturnsBothYears()
        {
            const int firstComplianceYear = 1921;
            const int secondComplianceYear = 1922;

            using (var databaseWrapper = new DatabaseWrapper())
            {
                // Arrange
                var modelHelper = new ModelHelper(databaseWrapper.Model);

                var scheme = modelHelper.CreateScheme();

                var firstMemberUpload = modelHelper.CreateMemberUpload(scheme);
                firstMemberUpload.IsSubmitted = true;
                firstMemberUpload.ComplianceYear = firstComplianceYear;

                var secondMemberUpload = modelHelper.CreateMemberUpload(scheme);
                secondMemberUpload.IsSubmitted = true;
                secondMemberUpload.ComplianceYear = secondComplianceYear;

                await databaseWrapper.Model.SaveChangesAsync();

                // Act
                var dataAccess = new SchemeDataAccess(databaseWrapper.WeeeContext);

                var result = await dataAccess.GetComplianceYearsWithSubmittedMemberUploads(scheme.Id);

                // Assert
                Assert.Equal(2, result.Count);
                Assert.Contains(firstComplianceYear, result);
                Assert.Contains(secondComplianceYear, result);
            }
        }