< Summary

Information
Class: MorphoGeometry.Extension
Assembly: MorphoGeometry
File(s): D:\a\Morpho\Morpho\project\Morpho\MorphoGeometry\Extension.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 12
Coverable lines: 12
Total lines: 55
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 12
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
Deconstruct(...)0%20%
Deconstruct(...)0%40%
Deconstruct(...)0%60%

File(s)

D:\a\Morpho\Morpho\project\Morpho\MorphoGeometry\Extension.cs

#LineLine coverage
 1using System;
 2using System.Collections.Generic;
 3using System.Linq;
 4using System.Text;
 5using System.Threading.Tasks;
 6
 7namespace MorphoGeometry
 8{
 9    /// <summary>
 10    /// Extension class.
 11    /// </summary>
 12    internal static class Extension
 13    {
 14        /// <summary>
 15        /// Deconstruct an array with 1 item.
 16        /// </summary>
 17        /// <typeparam name="T">Type.</typeparam>
 18        /// <param name="items">Array to deconstruct.</param>
 19        /// <param name="t0">Item.</param>
 20        public static void Deconstruct<T>(this T[] items, out T t0)
 021        {
 022            t0 = items.Length > 0 ? items[0] : default(T);
 023        }
 24
 25        /// <summary>
 26        /// Deconstruct an array with 2 item.
 27        /// </summary>
 28        /// <typeparam name="T">Type.</typeparam>
 29        /// <param name="items">Array to deconstruct.</param>
 30        /// <param name="t0">First item.</param>
 31        /// <param name="t1">Second item.</param>
 32        public static void Deconstruct<T>(this T[] items, out T t0,
 33            out T t1)
 034        {
 035            t0 = items.Length > 0 ? items[0] : default(T);
 036            t1 = items.Length > 1 ? items[1] : default(T);
 037        }
 38
 39        /// <summary>
 40        /// Deconstruct an array with 3 item.
 41        /// </summary>
 42        /// <typeparam name="T">Type.</typeparam>
 43        /// <param name="items">Array to deconstruct.</param>
 44        /// <param name="t0">First item.</param>
 45        /// <param name="t1">Second item.</param>
 46        /// <param name="t2">Third item.</param>
 47        public static void Deconstruct<T>(this T[] items, out T t0,
 48            out T t1, out T t2)
 049        {
 050            t0 = items.Length > 0 ? items[0] : default(T);
 051            t1 = items.Length > 1 ? items[1] : default(T);
 052            t2 = items.Length > 2 ? items[2] : default(T);
 053        }
 54    }
 55}