public async void FetchRegisteredProducerOrDefault_ReturnsProducerForSpecifiedSchemeOnly()
        {
            using (var database = new DatabaseWrapper())
            {
                var helper = new ModelHelper(database.Model);

                var scheme = helper.CreateScheme();

                var memberUpload1 = helper.CreateMemberUpload(scheme);
                memberUpload1.IsSubmitted    = true;
                memberUpload1.ComplianceYear = 2015;

                var producerSubmission1 = helper.CreateProducerAsCompany(memberUpload1, "1234");

                var scheme2 = helper.CreateScheme();

                var memberUpload2 = helper.CreateMemberUpload(scheme2);
                memberUpload2.IsSubmitted    = true;
                memberUpload2.ComplianceYear = 2015;

                var producerSubmission2 = helper.CreateProducerAsCompany(memberUpload2, "1234");

                database.Model.SaveChanges();

                var dataAccess = new GenerateFromXmlDataAccess(database.WeeeContext);
                var result     = await dataAccess.FetchRegisteredProducerOrDefault("1234", 2015, scheme2.Id);

                Assert.NotEqual(producerSubmission1.Id, result.CurrentSubmission.Id);
                Assert.Equal(producerSubmission2.Id, result.CurrentSubmission.Id);
            }
        }
        public async void FetchRegisteredProducerOrDefault_WithNoCurrentSubmissionForProducer_ReturnsRegisteredProducerRecord()
        {
            using (var database = new DatabaseWrapper())
            {
                var helper = new ModelHelper(database.Model);

                var scheme = helper.CreateScheme();

                helper.GetOrCreateRegisteredProducer(scheme, 2015, "1234");

                database.Model.SaveChanges();

                var dataAccess = new GenerateFromXmlDataAccess(database.WeeeContext);
                var result     = await dataAccess.FetchRegisteredProducerOrDefault("1234", 2015, scheme.Id);

                Assert.Equal("1234", result.ProducerRegistrationNumber);
                Assert.Equal(2015, result.ComplianceYear);
                Assert.Equal(scheme.Id, result.Scheme.Id);
            }
        }