< Summary

Class:Microsoft.Azure.CognitiveServices.ContentModerator.Models.Content
Assembly:Microsoft.Azure.CognitiveServices.Vision.ContentModerator
File(s):C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Vision.ContentModerator\src\Generated\Models\Content.cs
Covered lines:5
Uncovered lines:4
Coverable lines:9
Total lines:58
Line coverage:55.5% (5 of 9)
Covered branches:1
Total branches:2
Branch coverage:50% (1 of 2)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-0%100%
get_ContentValue()-100%100%
Validate()-66.67%50%

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Vision.ContentModerator\src\Generated\Models\Content.cs

#LineLine coverage
 1// <auto-generated>
 2// Code generated by Microsoft (R) AutoRest Code Generator.
 3// Changes may cause incorrect behavior and will be lost if the code is
 4// regenerated.
 5// </auto-generated>
 6
 7namespace Microsoft.Azure.CognitiveServices.ContentModerator.Models
 8{
 9    using Microsoft.Rest;
 10    using Newtonsoft.Json;
 11    using System.Linq;
 12
 13    public partial class Content
 14    {
 15        /// <summary>
 16        /// Initializes a new instance of the Content class.
 17        /// </summary>
 518        public Content()
 19        {
 20            CustomInit();
 521        }
 22
 23        /// <summary>
 24        /// Initializes a new instance of the Content class.
 25        /// </summary>
 26        /// <param name="contentValue">Content to evaluate for a job.</param>
 027        public Content(string contentValue)
 28        {
 029            ContentValue = contentValue;
 30            CustomInit();
 031        }
 32
 33        /// <summary>
 34        /// An initialization method that performs custom operations like setting defaults
 35        /// </summary>
 36        partial void CustomInit();
 37
 38        /// <summary>
 39        /// Gets or sets content to evaluate for a job.
 40        /// </summary>
 41        [JsonProperty(PropertyName = "ContentValue")]
 742        public string ContentValue { get; set; }
 43
 44        /// <summary>
 45        /// Validate the object.
 46        /// </summary>
 47        /// <exception cref="ValidationException">
 48        /// Thrown if validation fails
 49        /// </exception>
 50        public virtual void Validate()
 51        {
 152            if (ContentValue == null)
 53            {
 054                throw new ValidationException(ValidationRules.CannotBeNull, "ContentValue");
 55            }
 156        }
 57    }
 58}