| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | using System; |
| | 5 | | using Azure.Storage.Blobs.Models; |
| | 6 | |
|
| | 7 | | namespace Azure.Storage.Blobs.ChangeFeed |
| | 8 | | { |
| | 9 | | /// <summary> |
| | 10 | | /// BlobChangeFeedModelFactory for building mock objects. |
| | 11 | | /// </summary> |
| | 12 | | public static class BlobChangeFeedModelFactory |
| | 13 | | { |
| | 14 | | /// <summary> |
| | 15 | | /// Creates a new BlobChangeFeedEvent instance for mocking. |
| | 16 | | /// </summary> |
| | 17 | | public static BlobChangeFeedEvent BlobChangeFeedEvent( |
| | 18 | | string topic, |
| | 19 | | string subject, |
| | 20 | | BlobChangeFeedEventType eventType, |
| | 21 | | DateTimeOffset eventTime, |
| | 22 | | Guid id, |
| | 23 | | BlobChangeFeedEventData eventData, |
| | 24 | | long dataVersion, |
| | 25 | | string metadataVersion) |
| 0 | 26 | | => new BlobChangeFeedEvent |
| 0 | 27 | | { |
| 0 | 28 | | Topic = topic, |
| 0 | 29 | | Subject = subject, |
| 0 | 30 | | EventType = eventType, |
| 0 | 31 | | EventTime = eventTime, |
| 0 | 32 | | Id = id, |
| 0 | 33 | | EventData = eventData, |
| 0 | 34 | | SchemaVersion = dataVersion, |
| 0 | 35 | | MetadataVersion = metadataVersion |
| 0 | 36 | | }; |
| | 37 | |
|
| | 38 | | /// <summary> |
| | 39 | | /// Creates a new BlobChangeFeedEventData instance for mocking. |
| | 40 | | /// </summary> |
| | 41 | | public static BlobChangeFeedEventData BlobChangeFeedEventData( |
| | 42 | | string api, |
| | 43 | | Guid clientRequestId, |
| | 44 | | Guid requestId, |
| | 45 | | ETag eTag, |
| | 46 | | string contentType, |
| | 47 | | long contentLength, |
| | 48 | | BlobType blobType, |
| | 49 | | long contentOffset, |
| | 50 | | Uri destinationUri, |
| | 51 | | Uri sourceUri, |
| | 52 | | Uri uri, |
| | 53 | | bool recursive, |
| | 54 | | string sequencer) |
| 0 | 55 | | => new BlobChangeFeedEventData |
| 0 | 56 | | { |
| 0 | 57 | | BlobOperationName = api, |
| 0 | 58 | | ClientRequestId = clientRequestId, |
| 0 | 59 | | RequestId = requestId, |
| 0 | 60 | | ETag = eTag, |
| 0 | 61 | | ContentType = contentType, |
| 0 | 62 | | ContentLength = contentLength, |
| 0 | 63 | | BlobType = blobType, |
| 0 | 64 | | ContentOffset = contentOffset, |
| 0 | 65 | | DestinationUri = destinationUri, |
| 0 | 66 | | SourceUri = sourceUri, |
| 0 | 67 | | Uri = uri, |
| 0 | 68 | | Recursive = recursive, |
| 0 | 69 | | Sequencer = sequencer |
| 0 | 70 | | }; |
| | 71 | | } |
| | 72 | | } |