public async Task Then_Gets_Provider_Attributes_From_The_Api(
            List <Attribute> providerAttributesResponse,
            GetAttributesQuery query,
            [Frozen] Mock <IApprenticeFeedbackApiClient <ApprenticeFeedbackApiConfiguration> > mockProviderAttributesApiClient,
            GetAttributesQueryHandler handler)
        {
            mockProviderAttributesApiClient
            .Setup(client => client.Get <List <Attribute> >(
                       It.IsAny <GetAttributesRequest>()))
            .ReturnsAsync(providerAttributesResponse);

            var actual = await handler.Handle(query, CancellationToken.None);

            actual.Attributes.Should().BeEquivalentTo(providerAttributesResponse);
        }
Example #2
0
 public IEnumerable <Attribute> Handle(GetAttributesQuery query)
 {
     return(Context.Attributes);
 }
 public override Task <IEnumerable <KeyValuePair <string, int> > > ExecuteAsync(GetAttributesQuery query, CancellationToken cancellationToken = new CancellationToken())
 {
     throw new NotImplementedException();
 }
 public override async Task <IEnumerable <KeyValuePair <string, int> > > ExecuteAsync(GetAttributesQuery query, CancellationToken cancellationToken = new CancellationToken())
 {
     return(await _apiClient.Get <IEnumerable <KeyValuePair <string, int> > >("/api/attributes"));
 }