< Summary

Line coverage
59%
Covered lines: 16
Uncovered lines: 11
Coverable lines: 27
Total lines: 88
Line coverage: 59.2%
Branch coverage
0%
Covered branches: 0
Total branches: 6
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
get_Start()100%11100%
set_Start(...)100%11100%
get_End()100%11100%
set_End(...)100%11100%
get_Curve2D()100%11100%
set_Curve2D(...)100%11100%
Equals(...)0%620%
Equals(...)0%2040%
GetHashCode()100%210%
ToString()100%11100%
op_Equality(...)100%210%
op_Inequality(...)100%210%

File(s)

https://raw.githubusercontent.com/JeremyAnsel/JeremyAnsel.Media.WavefrontObj/dbbfcd213b7c54f49194f82fcd56e790cca193c3/JeremyAnsel.Media.WavefrontObj/JeremyAnsel.Media.WavefrontObj/ObjCurveIndex.cs

#LineLine coverage
 1// <copyright file="ObjCurveIndex.cs" company="Jérémy Ansel">
 2// Copyright (c) 2017, 2019 Jérémy Ansel
 3// </copyright>
 4// <license>
 5// Licensed under the MIT license. See LICENSE.txt
 6// </license>
 7
 8using System.Globalization;
 9
 10namespace JeremyAnsel.Media.WavefrontObj
 11{
 12    [System.Diagnostics.DebuggerDisplay("Curve Index:{Curve2D} Start:{Start} End:{End}")]
 13    public struct ObjCurveIndex : IEquatable<ObjCurveIndex>
 14    {
 15        private float start;
 16
 17        private float end;
 18
 19        private int curve2D;
 20
 21        public ObjCurveIndex(float startParameter, float endParameter, int curve2DIndex)
 22        {
 7223            this.start = startParameter;
 7224            this.end = endParameter;
 7225            this.curve2D = curve2DIndex;
 7226        }
 27
 28        public float Start
 29        {
 5730            get { return this.start; }
 631            set { this.start = value; }
 32        }
 33
 34        public float End
 35        {
 5736            get { return this.end; }
 637            set { this.end = value; }
 38        }
 39
 40        public int Curve2D
 41        {
 5742            get { return this.curve2D; }
 643            set { this.curve2D = value; }
 44        }
 45
 46        public override bool Equals(object? obj)
 47        {
 048            return obj is ObjCurveIndex index && Equals(index);
 49        }
 50
 51        public bool Equals(ObjCurveIndex other)
 52        {
 053            return start == other.start &&
 054                   end == other.end &&
 055                   curve2D == other.curve2D;
 56        }
 57
 58        public override int GetHashCode()
 59        {
 060            var hashCode = -540012629;
 061            hashCode = hashCode * -1521134295 + start.GetHashCode();
 062            hashCode = hashCode * -1521134295 + end.GetHashCode();
 063            hashCode = hashCode * -1521134295 + curve2D.GetHashCode();
 064            return hashCode;
 65        }
 66
 67        public override string ToString()
 68        {
 2769            return string.Concat(
 2770                this.Start.ToString("F6", CultureInfo.InvariantCulture),
 2771                " ",
 2772                this.End.ToString("F6", CultureInfo.InvariantCulture),
 2773                " ",
 2774                this.Curve2D.ToString(CultureInfo.InvariantCulture));
 75        }
 76
 77        public static bool operator ==(ObjCurveIndex left, ObjCurveIndex right)
 78        {
 079            return left.Equals(right);
 80        }
 81
 82        public static bool operator !=(ObjCurveIndex left, ObjCurveIndex right)
 83        {
 084            return !(left == right);
 85        }
 86    }
 87}
 88