< Summary

Class:Microsoft.Azure.Search.Models.IndexBatch`1
Assembly:Microsoft.Azure.Search.Data
File(s):C:\Git\azure-sdk-for-net\sdk\search\Microsoft.Azure.Search.Data\src\Generated\Models\IndexBatch.cs
Covered lines:6
Uncovered lines:3
Coverable lines:9
Total lines:67
Line coverage:66.6% (6 of 9)
Covered branches:1
Total branches:2
Branch coverage:50% (1 of 2)

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Microsoft.Azure.Search.Data\src\Generated\Models\IndexBatch.cs

#LineLine coverage
 1// <auto-generated>
 2// Copyright (c) Microsoft Corporation. All rights reserved.
 3// Licensed under the MIT License. See License.txt in the project root for
 4// license information.
 5//
 6// Code generated by Microsoft (R) AutoRest Code Generator.
 7// Changes may cause incorrect behavior and will be lost if the code is
 8// regenerated.
 9// </auto-generated>
 10
 11namespace Microsoft.Azure.Search.Models
 12{
 13    using Microsoft.Rest;
 14    using Newtonsoft.Json;
 15    using System.Collections;
 16    using System.Collections.Generic;
 17    using System.Linq;
 18
 19    /// <summary>
 20    /// Contains a batch of document write actions to send to the index.
 21    /// </summary>
 22    public partial class IndexBatch<T>
 23    {
 24        /// <summary>
 25        /// Initializes a new instance of the IndexBatch class.
 26        /// </summary>
 027        public IndexBatch()
 28        {
 29            CustomInit();
 030        }
 31
 32        /// <summary>
 33        /// Initializes a new instance of the IndexBatch class.
 34        /// </summary>
 35        /// <param name="actions">The actions in the batch.</param>
 49436        public IndexBatch(IEnumerable<IndexAction<T>> actions)
 37        {
 49438            Actions = actions;
 39            CustomInit();
 49440        }
 41
 42        /// <summary>
 43        /// An initialization method that performs custom operations like setting defaults
 44        /// </summary>
 45        partial void CustomInit();
 46
 47        /// <summary>
 48        /// Gets or sets the actions in the batch.
 49        /// </summary>
 50        [JsonProperty(PropertyName = "value")]
 143451        public IEnumerable<IndexAction<T>> Actions { get; set; }
 52
 53        /// <summary>
 54        /// Validate the object.
 55        /// </summary>
 56        /// <exception cref="ValidationException">
 57        /// Thrown if validation fails
 58        /// </exception>
 59        public virtual void Validate()
 60        {
 44661            if (Actions == null)
 62            {
 063                throw new ValidationException(ValidationRules.CannotBeNull, "Actions");
 64            }
 44665        }
 66    }
 67}