public override void Setup() { ApiClientResponse = new TlevelPathwayDetails { PathwayId = 1, PathwayName = PathwayName, RouteName = RouteName, PathwayStatusId = 2, Specialisms = Specialisms }; ExpectedResult = new TLevelDetailsViewModel { PathwayId = 1, PathwayName = PathwayName, RouteName = RouteName, ShowSomethingIsNotRight = ShowSomethingIsNotRight, ShowQueriedInfo = ShowQueriedInfo, Specialisms = Specialisms }; Mapper = Substitute.For <IMapper>(); Mapper.Map <TLevelDetailsViewModel>(ApiClientResponse).Returns(ExpectedResult); InternalApiClient = Substitute.For <IResultsAndCertificationInternalApiClient>(); InternalApiClient.GetTlevelDetailsByPathwayIdAsync(Ukprn, Id) .Returns(ApiClientResponse); }
public override void Setup() { _tokenServiceClient = Substitute.For <ITokenServiceClient>(); _configuration = new ResultsAndCertificationConfiguration { ResultsAndCertificationInternalApiSettings = new ResultsAndCertificationInternalApiSettings { Uri = "http://xtz.com" } }; _mockHttpResult = new TlevelPathwayDetails { PathwayName = PathwayName, RouteName = RouteName, Specialisms = Specialisms, PathwayStatusId = Status }; HttpClient = new HttpClient(new MockHttpMessageHandler <TlevelPathwayDetails>(_mockHttpResult, string.Format(ApiConstants.TlevelDetailsUri, ukprn, tlevelId), HttpStatusCode.OK)); }
public override void Setup() { ApiClientResponse = new TlevelPathwayDetails { TqAwardingOrganisationId = 1, RouteId = 2, PathwayId = 3, RouteName = "Test Route", PathwayName = "Test Pathway", PathwayStatusId = 1, Specialisms = new List <string> { "Spl1", "Spl2" } }; InternalApiClient = Substitute.For <IResultsAndCertificationInternalApiClient>(); InternalApiClient.GetTlevelDetailsByPathwayIdAsync(Ukprn, PathwayId) .Returns(ApiClientResponse); var mapperConfig = new MapperConfiguration(c => c.AddMaps(typeof(TlevelMapper).Assembly)); Mapper = new AutoMapper.Mapper(mapperConfig); }
public async override Task When() { _result = await _apiClient.GetTlevelDetailsByPathwayIdAsync(ukprn, tlevelId); }