public async Task HandleAsync_GivenGetAatfRequestWithSpecifiedFacilityType_CorrectFacilityReturned(FacilityType facilityType) { var aatfs = CreateAatfAeList(); A.CallTo(() => dataAccess.GetLatestAatfs()).Returns(aatfs); var request = new GetAatfs(facilityType); var returnDataList = new AatfDataList(A.Dummy <Guid>(), A.Dummy <string>(), A.Dummy <UKCompetentAuthorityData>(), A.Dummy <string>(), A.Dummy <Core.AatfReturn.AatfStatus>(), A.Dummy <OrganisationData>(), facilityType, (Int16)2019, Guid.NewGuid(), null); A.CallTo(() => fakeMapper.Map(A <Aatf> ._)).Returns(returnDataList); var result = await handler.HandleAsync(request); result.Count.Should().Be(1); result[0].FacilityType.Should().Be(facilityType); }
public void NameWithComplianceYear_GivenNameAndComplianceYear_PropertyShouldBeCorrect() { var complianceYear = fixture.Create <short>(); var name = fixture.Create <string>(); var model = new AatfDataList(fixture.Create <Guid>(), name, fixture.Create <UKCompetentAuthorityData>(), fixture.Create <string>(), fixture.Create <AatfStatus>(), fixture.Create <OrganisationData>(), fixture.Create <FacilityType>(), complianceYear, fixture.Create <Guid>(), fixture.Create <DateTime>()); model.NameWithComplianceYear.Should().Be($"{name} ({complianceYear})"); }