public async void GenerateProducerData_WithMemberUpload_ReturnsProducerWithMatchingMemberUpload()
        {
            var builder = new GenerateProducerDataTestsBuilder();

            var data = "Test data";
            var fileName = "Test filename";
            var memberUpload = new MemberUpload(Guid.NewGuid(), data, A.Dummy<List<MemberUploadError>>(), 0, 2015, A.Dummy<Scheme>(), fileName);

            builder.MemberUpload = memberUpload;

            var result = await builder.InvokeGenerateProducerDataWithSingleResult();

            Assert.Equal(data, result.MemberUpload.RawData.Data);
            Assert.Equal(fileName, result.MemberUpload.FileName);
            Assert.Same(memberUpload, result.MemberUpload);
        }
            private ProducerSubmission Build()
            {
                Scheme scheme = new Scheme(
                    A.Dummy<Guid>());

                var memberUpload = new MemberUpload(
                    A.Dummy<Guid>(),
                    A.Dummy<string>(),
                    A.Dummy<List<MemberUploadError>>(),
                    A.Dummy<decimal>(),
                    2017,
                    scheme,
                    A.Dummy<string>(),
                    A.Dummy<string>());

                var updatedDate = A.Dummy<DateTime>();

                RegisteredProducer registeredProducer = new RegisteredProducer(
                    registrationNumber,
                    2017,
                    scheme);

                ProducerSubmission producerSubmission = new ProducerSubmission(
                    registeredProducer,
                    memberUpload,
                    producerBusiness,
                    authorisedRepresentative,
                    updatedDate,
                    annualTurnover,
                    vatRegistered,
                    ceaseToExist,
                    tradingName,
                    eeePlacedOnMarketBandType,
                    sellingTechniqueType,
                    obligationType,
                    annualTurnOverBandType,
                    brandNames,
                    sicCodes,
                    chargeBandAmount,
                    (decimal)5.0);

                registeredProducer.SetCurrentSubmission(producerSubmission);

                return producerSubmission;
            }
            private void InstantiateProducerParameters()
            {
                TradingName = "Test trading name";

                scheme = A.Fake<Scheme>();

                MemberUpload = new MemberUpload(
                    A.Dummy<Guid>(),
                    A.Dummy<string>(),
                    A.Dummy<List<MemberUploadError>>(),
                    A.Dummy<decimal>(),
                    A.Dummy<int>(),
                    scheme,
                    A.Dummy<string>(),
                    A.Dummy<string>());

                ProducerCharges = new Dictionary<string, ProducerCharge>();
                ProducerCharges.Add(TradingName, new ProducerCharge() { ChargeBandAmount = new ChargeBandAmount() });

                GeneratedPrns = new Queue<string>();
                A.CallTo(() => DataAccess.ComputePrns(A<int>._)).Returns(GeneratedPrns);

                BrandNames = Enumerable.Empty<string>().ToArray();
                SicCodes = Enumerable.Empty<string>().ToArray();

                ProducerBusiness = new producerBusinessType()
                {
                    correspondentForNotices = new optionalContactDetailsContainerType() { },
                    Item = new companyType()
                    {
                        registeredOffice = new contactDetailsContainerType()
                        {
                            contactDetails = new contactDetailsType()
                            {
                                address = new addressType()
                                {
                                    country = countryType.UKENGLAND
                                }
                            }
                        }
                    }
                };

                AuthorisedRepresentative = null;

                EEEPlacedOnMarketBandType = eeePlacedOnMarketBandType.Lessthan5TEEEplacedonmarket;
                SellingTechnique = sellingTechniqueType.Both;
                ObligationType = obligationTypeType.Both;
                AnnualTurnoverBandType = annualTurnoverBandType.Greaterthanonemillionpounds;
                CeaseDate = null;
                RegistrationNumber = "TestRegistrationNumber";
                AnnualTurnover = 10;
                VatRegistered = false;
                Status = statusType.I;
            }