public Return(Organisation organisation, Quarter quarter, string createdBy, FacilityType facilityType) { Guard.ArgumentNotNull(() => organisation, organisation); Guard.ArgumentNotNull(() => quarter, quarter); Guard.ArgumentNotNullOrEmpty(() => createdBy, createdBy); Guard.ArgumentNotNull(() => facilityType, facilityType); Organisation = organisation; Quarter = quarter; ReturnStatus = ReturnStatus.Created; CreatedById = createdBy; CreatedDate = SystemTime.UtcNow; FacilityType = facilityType; }
public Aatf(string name, UKCompetentAuthority competentAuthority, string approvalNumber, AatfStatus aatfStatus, Organisation organisation, AatfAddress aatfSiteAddress, AatfSize aatfSize, DateTime approvalDate, AatfContact contact, FacilityType facilityType, Int16 complianceYear, LocalArea localArea, PanArea panArea, Guid?aatfId = null) { Guard.ArgumentNotNullOrEmpty(() => name, name); Guard.ArgumentNotNullOrEmpty(() => approvalNumber, approvalNumber); Guard.ArgumentNotNull(() => competentAuthority, competentAuthority); Guard.ArgumentNotNull(() => aatfStatus, aatfStatus); Guard.ArgumentNotNull(() => organisation, organisation); Guard.ArgumentNotNull(() => contact, contact); Guard.ArgumentNotNull(() => aatfSize, aatfSize); Guard.ArgumentNotNull(() => aatfSiteAddress, aatfSiteAddress); Guard.ArgumentNotNull(() => facilityType, facilityType); Name = name; CompetentAuthority = competentAuthority; ApprovalNumber = approvalNumber; AatfStatus = aatfStatus; Organisation = organisation; Size = aatfSize; SiteAddress = aatfSiteAddress; ApprovalDate = approvalDate; Contact = contact; FacilityType = facilityType; ComplianceYear = complianceYear; LocalArea = localArea; PanArea = panArea; AatfId = aatfId == null?Guid.NewGuid() : aatfId.Value; }
private Return CreateReturn(Guid id, int year, QuarterType quarter, Organisation organisation = null, DateTime?submittedDate = null, DomainFacilityType facilityType = null) { var @return = A.Fake <Return>(); A.CallTo(() => @return.Id).Returns(id); A.CallTo(() => @return.Quarter).Returns(new Quarter(year, quarter)); A.CallTo(() => @return.SubmittedDate).Returns(submittedDate ?? fixture.Create <DateTime>()); if (organisation == null) { organisation = A.Fake <Organisation>(); A.CallTo(() => organisation.Id).Returns(fixture.Create <Guid>()); } A.CallTo(() => @return.Organisation).Returns(organisation); if (facilityType == null) { facilityType = DomainFacilityType.Aatf; } A.CallTo(() => @return.FacilityType).Returns(facilityType); return(@return); }