< Summary

Information
Class: FixedMathSharp.Assertions.Fixed3x3Assertions
Assembly: FixedMathSharp.FluentAssertions
File(s): /home/runner/work/FixedMathSharp/FixedMathSharp/src/FixedMathSharp.FluentAssertions/Fixed3x3Assertions.cs
Line coverage
100%
Covered lines: 28
Uncovered lines: 0
Coverable lines: 28
Total lines: 90
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

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
get_Identifier()100%11100%
BeApproximately(...)100%11100%
NotBeApproximately(...)100%11100%
BeIdentity(...)100%11100%
HaveScaleApproximately(...)100%11100%
HaveNormalizedAxes(...)100%11100%

File(s)

/home/runner/work/FixedMathSharp/FixedMathSharp/src/FixedMathSharp.FluentAssertions/Fixed3x3Assertions.cs

#LineLine coverage
 1//=======================================================================
 2// Fixed3x3Assertions.cs
 3//=======================================================================
 4// MIT License, Copyright (c) 2024-present David Oravsky (mrdav30)
 5// See LICENSE file in the project root for full license information.
 6//=======================================================================
 7
 8using FluentAssertions;
 9using FluentAssertions.Execution;
 10using FluentAssertions.Numeric;
 11
 12namespace FixedMathSharp.Assertions;
 13
 14public sealed class Fixed3x3Assertions : FixedStructAssertions<Fixed3x3, Fixed3x3Assertions>
 15{
 4616    public Fixed3x3Assertions(Fixed3x3 value) : base(value) { }
 17
 418    protected override string Identifier => "fixed3x3 matrix";
 19
 20    public AndConstraint<Fixed3x3Assertions> BeApproximately(
 21        Fixed3x3 expected,
 22        Fixed64? tolerance = null,
 23        string because = "",
 24        params object[] becauseArgs)
 25    {
 1126        Fixed64 limit = FixedAssertionHelpers.ResolveTolerance(tolerance);
 27
 1128        CurrentAssertionChain
 1129            .ForCondition(FixedAssertionHelpers.AreComponentApproximatelyEqual(Subject, expected, limit))
 1130            .BecauseOf(because, becauseArgs)
 1131            .FailWith("Expected fixed3x3 matrix to be approximately {0} +/- {1}{reason}, but found {2}.", expected, limi
 32
 133        return new AndConstraint<Fixed3x3Assertions>(this);
 34    }
 35
 36    public AndConstraint<Fixed3x3Assertions> NotBeApproximately(
 37        Fixed3x3 expected,
 38        Fixed64? tolerance = null,
 39        string because = "",
 40        params object[] becauseArgs)
 41    {
 142        Fixed64 limit = FixedAssertionHelpers.ResolveTolerance(tolerance);
 43
 144        CurrentAssertionChain
 145            .ForCondition(!FixedAssertionHelpers.AreComponentApproximatelyEqual(Subject, expected, limit))
 146            .BecauseOf(because, becauseArgs)
 147            .FailWith("Expected fixed3x3 matrix not to be approximately {0} +/- {1}{reason}, but found {2}.", expected, 
 48
 149        return new AndConstraint<Fixed3x3Assertions>(this);
 50    }
 51
 52    public AndConstraint<Fixed3x3Assertions> BeIdentity(
 53        string because = "",
 54        params object[] becauseArgs)
 55    {
 256        return Be(Fixed3x3.Identity, because, becauseArgs);
 57    }
 58
 59    public AndConstraint<Fixed3x3Assertions> HaveScaleApproximately(
 60        Vector3d expected,
 61        Fixed64? tolerance = null,
 62        string because = "",
 63        params object[] becauseArgs)
 64    {
 365        Fixed64 limit = FixedAssertionHelpers.ResolveTolerance(tolerance);
 366        Vector3d scale = Fixed3x3.ExtractScaleMagnitudes(Subject);
 67
 368        CurrentAssertionChain
 369            .ForCondition(FixedAssertionHelpers.AreComponentApproximatelyEqual(scale, expected, limit))
 370            .BecauseOf(because, becauseArgs)
 371            .FailWith("Expected fixed3x3 matrix scale magnitudes to be approximately {0} +/- {1}{reason}, but found {2}.
 72
 273        return new AndConstraint<Fixed3x3Assertions>(this);
 74    }
 75
 76    public AndConstraint<Fixed3x3Assertions> HaveNormalizedAxes(
 77        Fixed64? tolerance = null,
 78        string because = "",
 79        params object[] becauseArgs)
 80    {
 481        Fixed64 limit = FixedAssertionHelpers.ResolveTolerance(tolerance);
 82
 483        CurrentAssertionChain
 484            .ForCondition(FixedAssertionHelpers.HasUnitAxes(Subject, limit))
 485            .BecauseOf(because, becauseArgs)
 486            .FailWith("Expected fixed3x3 matrix axes to be normalized within +/- {0}{reason}, but found {1}.", limit, Su
 87
 188        return new AndConstraint<Fixed3x3Assertions>(this);
 89    }
 90}