| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. See License.txt in the project root for license information. |
| | 3 | |
|
| | 4 | | namespace BatchTestCommon |
| | 5 | | { |
| | 6 | | using System.Collections.Generic; |
| | 7 | | using Microsoft.Rest.Azure; |
| | 8 | |
|
| | 9 | | public class FakePage<T> : IPage<T> |
| | 10 | | { |
| 24 | 11 | | public FakePage(IList<T> collection, string nextPageLink = null) |
| | 12 | | { |
| 24 | 13 | | this.NextPageLink = nextPageLink; |
| 24 | 14 | | this.Collection = collection; |
| 24 | 15 | | } |
| | 16 | |
|
| 48 | 17 | | public string NextPageLink { get; private set; } |
| | 18 | |
|
| 70 | 19 | | private IList<T> Collection { get; set; } |
| | 20 | |
|
| | 21 | | public IEnumerator<T> GetEnumerator() |
| | 22 | | { |
| 46 | 23 | | return this.Collection.GetEnumerator(); |
| | 24 | | } |
| | 25 | |
|
| | 26 | | System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() |
| | 27 | | { |
| 0 | 28 | | return GetEnumerator(); |
| | 29 | | } |
| | 30 | |
|
| | 31 | | } |
| | 32 | | } |