< Summary

Class:Azure.ResourceManager.DigitalTwins.Models.CheckNameRequest
Assembly:Azure.ResourceManager.DigitalTwins
File(s):C:\Git\azure-sdk-for-net\sdk\digitaltwins\Azure.ResourceManager.DigitalTwins\src\Generated\Models\CheckNameRequest.cs
C:\Git\azure-sdk-for-net\sdk\digitaltwins\Azure.ResourceManager.DigitalTwins\src\Generated\Models\CheckNameRequest.Serialization.cs
Covered lines:14
Uncovered lines:1
Coverable lines:15
Total lines:59
Line coverage:93.3% (14 of 15)
Covered branches:1
Total branches:2
Branch coverage:50% (1 of 2)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-83.33%50%
get_Name()-100%100%
get_Type()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\digitaltwins\Azure.ResourceManager.DigitalTwins\src\Generated\Models\CheckNameRequest.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;
 9
 10namespace Azure.ResourceManager.DigitalTwins.Models
 11{
 12    /// <summary> The result returned from a database check name availability request. </summary>
 13    internal partial class CheckNameRequest
 14    {
 15        /// <summary> Initializes a new instance of CheckNameRequest. </summary>
 16        /// <param name="name"> Resource name. </param>
 17        /// <exception cref="ArgumentNullException"> <paramref name="name"/> is null. </exception>
 418        public CheckNameRequest(string name)
 19        {
 420            if (name == null)
 21            {
 022                throw new ArgumentNullException(nameof(name));
 23            }
 24
 425            Name = name;
 426            Type = "Microsoft.DigitalTwins/digitalTwinsInstances";
 427        }
 28
 29        /// <summary> Resource name. </summary>
 430        public string Name { get; }
 31        /// <summary> The type of resource, for instance Microsoft.DigitalTwins/digitalTwinsInstances. </summary>
 432        public string Type { get; }
 33    }
 34}

C:\Git\azure-sdk-for-net\sdk\digitaltwins\Azure.ResourceManager.DigitalTwins\src\Generated\Models\CheckNameRequest.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.DigitalTwins.Models
 12{
 13    internal partial class CheckNameRequest : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 417            writer.WriteStartObject();
 418            writer.WritePropertyName("name");
 419            writer.WriteStringValue(Name);
 420            writer.WritePropertyName("type");
 421            writer.WriteStringValue(Type);
 422            writer.WriteEndObject();
 423        }
 24    }
 25}