public async Task CheckListApplicationSummariesIsReturningAValidList() { const string applicationId = "blender.exe"; const string displayName = "blender"; IList <string> versions = new[] { "1.0", "1.5" }; BatchSharedKeyCredentials credentials = ClientUnitTestCommon.CreateDummySharedKeyCredential(); using (BatchClient client = await BatchClient.OpenAsync(credentials)) { Protocol.RequestInterceptor interceptor = new Protocol.RequestInterceptor(baseRequest => { var request = (Protocol.BatchRequest <Models.ApplicationListOptions, AzureOperationResponse <IPage <Models.ApplicationSummary>, Models.ApplicationListHeaders> >)baseRequest; request.ServiceRequestFunc = (token) => { var response = new AzureOperationResponse <IPage <Models.ApplicationSummary>, Models.ApplicationListHeaders> { Body = new FakePage <Models.ApplicationSummary>(new[] { new Models.ApplicationSummary { Id = applicationId, DisplayName = displayName, Versions = versions }, }) }; return(Task.FromResult(response)); }; }); IPagedEnumerable <Microsoft.Azure.Batch.ApplicationSummary> applicationSummaries = client.ApplicationOperations.ListApplicationSummaries(additionalBehaviors: new List <BatchClientBehavior> { interceptor }); Assert.Equal(1, applicationSummaries.Count()); var applicationSummary = applicationSummaries.First(); Assert.Equal(applicationId, applicationSummary.Id); Assert.Equal(displayName, applicationSummary.DisplayName); Assert.Equal(versions.First(), applicationSummary.Versions.First()); Assert.Equal(versions.Count, applicationSummary.Versions.ToList().Count); } }