< Summary - Jellyfin

Information
Class: Jellyfin.Server.Implementations.ValueConverters.DateTimeKindValueConverter
Assembly: Jellyfin.Server.Implementations
File(s): /srv/git/jellyfin/Jellyfin.Server.Implementations/ValueConverters/DateTimeKindValueConverter.cs
Line coverage
100%
Covered lines: 2
Uncovered lines: 0
Coverable lines: 2
Total lines: 21
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%

File(s)

/srv/git/jellyfin/Jellyfin.Server.Implementations/ValueConverters/DateTimeKindValueConverter.cs

#LineLine coverage
 1using System;
 2using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
 3
 4namespace Jellyfin.Server.Implementations.ValueConverters
 5{
 6    /// <summary>
 7    /// ValueConverter to specify kind.
 8    /// </summary>
 9    public class DateTimeKindValueConverter : ValueConverter<DateTime, DateTime>
 10    {
 11        /// <summary>
 12        /// Initializes a new instance of the <see cref="DateTimeKindValueConverter"/> class.
 13        /// </summary>
 14        /// <param name="kind">The kind to specify.</param>
 15        /// <param name="mappingHints">The mapping hints.</param>
 16        public DateTimeKindValueConverter(DateTimeKind kind, ConverterMappingHints? mappingHints = null)
 217            : base(v => v.ToUniversalTime(), v => DateTime.SpecifyKind(v, kind), mappingHints)
 18        {
 219        }
 20    }
 21}