< Summary

Class:Azure.Search.Documents.Indexes.Models.FreshnessScoringParameters
Assembly:Azure.Search.Documents
File(s):C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\FreshnessScoringParameters.cs
C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\FreshnessScoringParameters.Serialization.cs
Covered lines:0
Uncovered lines:14
Coverable lines:14
Total lines:63
Line coverage:0% (0 of 14)
Covered branches:0
Total branches:4
Branch coverage:0% (0 of 4)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%100%
get_BoostingDuration()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%100%
DeserializeFreshnessScoringParameters(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\FreshnessScoringParameters.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.Search.Documents.Indexes.Models
 11{
 12    /// <summary> Provides parameter values to a freshness scoring function. </summary>
 13    public partial class FreshnessScoringParameters
 14    {
 15        /// <summary> Initializes a new instance of FreshnessScoringParameters. </summary>
 16        /// <param name="boostingDuration"> The expiration period after which boosting will stop for a particular docume
 017        public FreshnessScoringParameters(TimeSpan boostingDuration)
 18        {
 019            BoostingDuration = boostingDuration;
 020        }
 21
 22        /// <summary> The expiration period after which boosting will stop for a particular document. </summary>
 023        public TimeSpan BoostingDuration { get; set; }
 24    }
 25}

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\FreshnessScoringParameters.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;
 9using System.Text.Json;
 10using Azure.Core;
 11
 12namespace Azure.Search.Documents.Indexes.Models
 13{
 14    public partial class FreshnessScoringParameters : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            writer.WritePropertyName("boostingDuration");
 020            writer.WriteStringValue(BoostingDuration, "P");
 021            writer.WriteEndObject();
 022        }
 23
 24        internal static FreshnessScoringParameters DeserializeFreshnessScoringParameters(JsonElement element)
 25        {
 026            TimeSpan boostingDuration = default;
 027            foreach (var property in element.EnumerateObject())
 28            {
 029                if (property.NameEquals("boostingDuration"))
 30                {
 031                    boostingDuration = property.Value.GetTimeSpan("P");
 32                    continue;
 33                }
 34            }
 035            return new FreshnessScoringParameters(boostingDuration);
 36        }
 37    }
 38}