< Summary

Class:Azure.Storage.Blobs.ChangeFeed.BlobChangeFeedEvent
Assembly:Azure.Storage.Blobs.ChangeFeed
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.Storage.Blobs.ChangeFeed\src\Models\BlobChangeFeedEvent.cs
Covered lines:22
Uncovered lines:0
Coverable lines:22
Total lines:78
Line coverage:100% (22 of 22)
Covered branches:2
Total branches:4
Branch coverage:50% (2 of 4)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-100%100%
.ctor()-100%100%
get_Topic()-100%100%
get_Subject()-100%100%
get_EventType()-100%100%
get_EventTime()-100%100%
get_Id()-100%100%
get_EventData()-100%100%
get_SchemaVersion()-100%100%
get_MetadataVersion()-100%100%
ToString()-100%50%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.Storage.Blobs.ChangeFeed\src\Models\BlobChangeFeedEvent.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System;
 5using System.Collections.Generic;
 6using System.Globalization;
 7
 8namespace Azure.Storage.Blobs.ChangeFeed
 9{
 10    /// <summary>
 11    /// BlobChangeFeedEvent.
 12    /// </summary>
 13    public class BlobChangeFeedEvent
 14    {
 15        /// <summary>
 16        /// Internal constructor.
 17        /// </summary>
 2958418        internal BlobChangeFeedEvent(Dictionary<string, object> record)
 19        {
 2958420            Topic = (string)record[Constants.ChangeFeed.Event.Topic];
 2958421            Subject = (string)record[Constants.ChangeFeed.Event.Subject];
 2958422            EventType = new BlobChangeFeedEventType((string)record[Constants.ChangeFeed.Event.EventType]);
 2958423            EventTime = DateTimeOffset.Parse((string)record[Constants.ChangeFeed.Event.EventTime], CultureInfo.Invariant
 2958424            Id = Guid.Parse((string)record[Constants.ChangeFeed.Event.EventId]);
 2958425            EventData = new BlobChangeFeedEventData((Dictionary<string, object>)record[Constants.ChangeFeed.Event.Data])
 2958426            record.TryGetValue(Constants.ChangeFeed.Event.SchemaVersion, out object schemaVersion);
 2958427            SchemaVersion = (long)schemaVersion;
 2958428            record.TryGetValue(Constants.ChangeFeed.Event.MetadataVersion, out object metadataVersion);
 2958429            MetadataVersion = (string)metadataVersion;
 2958430        }
 31
 18432        internal BlobChangeFeedEvent() { }
 33
 34        /// <summary>
 35        /// Full resource path to the event source. This field is not writeable. Event Grid provides this value.
 36        /// </summary>
 2958837        public string Topic { get; internal set; }
 38
 39        /// <summary>
 40        /// Publisher-defined path to the event subject.
 41        /// </summary>
 3018842        public string Subject { get; internal set; }
 43
 44        /// <summary>
 45        /// One of the registered event types for this event source.
 46        /// </summary>
 3018847        public BlobChangeFeedEventType EventType { get; internal set; }
 48
 49        /// <summary>
 50        /// The time the event is generated based on the provider's UTC time.
 51        /// </summary>
 6500452        public DateTimeOffset EventTime { get; internal set; }
 53
 54        /// <summary>
 55        /// Unique identifier for the event.
 56        /// </summary>
 4654457        public Guid Id { get; internal set; }
 58
 59        /// <summary>
 60        /// Blob storage event data.
 61        /// </summary>
 3023662        public BlobChangeFeedEventData EventData { get; internal set; }
 63
 64        /// <summary>
 65        /// The schema version of the data object. The publisher defines the schema version.
 66        /// </summary>
 2958867        public long SchemaVersion { get; internal set; }
 68
 69        /// <summary>
 70        /// The schema version of the event metadata. Event Grid defines the schema of the top-level properties.
 71        /// Event Grid provides this value.
 72        /// </summary>
 2958873        public string MetadataVersion { get; internal set; }
 74
 75        /// <inheritdoc/>
 60076        public override string ToString() => $"{EventTime}: {EventType} {Subject} ({EventData?.ToString() ?? "Unknown Ev
 77    }
 78}