< Summary

Class:Azure.ResourceManager.Compute.Models.RunCommandInput
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\RunCommandInput.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\RunCommandInput.Serialization.cs
Covered lines:12
Uncovered lines:18
Coverable lines:30
Total lines:89
Line coverage:40% (12 of 30)
Covered branches:3
Total branches:10
Branch coverage:30% (3 of 10)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-80%50%
.ctor(...)-0%100%
get_CommandId()-100%100%
get_Script()-0%100%
get_Parameters()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-41.18%25%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\RunCommandInput.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System;
 9using System.Collections.Generic;
 10
 11namespace Azure.ResourceManager.Compute.Models
 12{
 13    /// <summary> Capture Virtual Machine parameters. </summary>
 14    public partial class RunCommandInput
 15    {
 16        /// <summary> Initializes a new instance of RunCommandInput. </summary>
 17        /// <param name="commandId"> The run command id. </param>
 418        public RunCommandInput(string commandId)
 19        {
 420            if (commandId == null)
 21            {
 022                throw new ArgumentNullException(nameof(commandId));
 23            }
 24
 425            CommandId = commandId;
 426        }
 27
 28        /// <summary> Initializes a new instance of RunCommandInput. </summary>
 29        /// <param name="commandId"> The run command id. </param>
 30        /// <param name="script"> Optional. The script to be executed.  When this value is given, the given script will 
 31        /// <param name="parameters"> The run command parameters. </param>
 032        internal RunCommandInput(string commandId, IList<string> script, IList<RunCommandInputParameter> parameters)
 33        {
 034            CommandId = commandId;
 035            Script = script;
 036            Parameters = parameters;
 037        }
 38
 39        /// <summary> The run command id. </summary>
 840        public string CommandId { get; }
 41        /// <summary> Optional. The script to be executed.  When this value is given, the given script will override the
 042        public IList<string> Script { get; set; }
 43        /// <summary> The run command parameters. </summary>
 044        public IList<RunCommandInputParameter> Parameters { get; set; }
 45    }
 46}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\RunCommandInput.Serialization.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System.Text.Json;
 9using Azure.Core;
 10
 11namespace Azure.ResourceManager.Compute.Models
 12{
 13    public partial class RunCommandInput : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 817            writer.WriteStartObject();
 818            writer.WritePropertyName("commandId");
 819            writer.WriteStringValue(CommandId);
 820            if (Script != null)
 21            {
 022                writer.WritePropertyName("script");
 023                writer.WriteStartArray();
 024                foreach (var item in Script)
 25                {
 026                    writer.WriteStringValue(item);
 27                }
 028                writer.WriteEndArray();
 29            }
 830            if (Parameters != null)
 31            {
 032                writer.WritePropertyName("parameters");
 033                writer.WriteStartArray();
 034                foreach (var item in Parameters)
 35                {
 036                    writer.WriteObjectValue(item);
 37                }
 038                writer.WriteEndArray();
 39            }
 840            writer.WriteEndObject();
 841        }
 42    }
 43}