public async Task ValidateAatfApprovalDate_GivenApprovalDateIsAfterDate_ResultShouldBeFalse() { using (var database = new DatabaseWrapper()) { var helper = new ModelHelper(database.Model); var domainHelper = new DomainHelper(database.WeeeContext); var organisation = Organisation.CreatePartnership("Dummy"); await CreateAatf(database, organisation, new DateTime(2019).AddDays(1)); var dataAccess = new ReturnFactoryDataAccess(database.WeeeContext); var result = await dataAccess.ValidateAatfApprovalDate(organisation.Id, new DateTime(2019), 2019, EA.Weee.Core.AatfReturn.FacilityType.Aatf); result.Should().BeFalse(); } }
private async Task <List <Aatf> > CreateMultipleAatf(DatabaseWrapper database, FacilityType facilityType, DateTime date, short year) { var country = database.WeeeContext.Countries.First(); var competentAuthorityDataAccess = new CommonDataAccess(database.WeeeContext); var competentAuthority = await competentAuthorityDataAccess.FetchCompetentAuthority(CompetentAuthority.England); var organisation = Organisation.CreatePartnership("Dummy"); var contact = new AatfContact("First Name", "Last Name", "Manager", "1 Address Lane", "Address Ward", "Town", "County", "Postcode", country, "01234 567890", "*****@*****.**"); var aatfList = new List <Aatf>(); aatfList.Add(new Aatf("B", competentAuthority, "12345678", AatfStatus.Approved, organisation, AddressHelper.GetAatfAddress(database), A.Fake <AatfSize>(), date, contact, facilityType, year, database.WeeeContext.LocalAreas.First(), database.WeeeContext.PanAreas.First())); aatfList.Add(new Aatf("A", competentAuthority, "12345679", AatfStatus.Approved, organisation, AddressHelper.GetAatfAddress(database), A.Fake <AatfSize>(), date, contact, facilityType, year, database.WeeeContext.LocalAreas.First(), database.WeeeContext.PanAreas.First())); return(aatfList); }