Skip to content

Commit

Permalink
test: add test for MTT sensor
Browse files Browse the repository at this point in the history
  • Loading branch information
mfacchinelli committed Feb 28, 2025
1 parent e357942 commit 6d60229
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/unit/analyze/tCalibration.m
Original file line number Diff line number Diff line change
Expand Up @@ -211,5 +211,26 @@ function calibration_solo(testCase)
testCase.verifyThat(calibratedData, matlab.unittest.constraints.IsEqualTo(expectedData, Within = matlab.unittest.constraints.AbsoluteTolerance(1e-10)), ...
"Calibrated value should match expectation.");
end

% Verify that correct calibration is selected for MTT sensor.
function calibration_mtt(testCase)

% Set up.
uncalibratedData = testCase.createTestData(Time = datetime("now"), XYZ = [1, 2, 3], Range = 0, Sequence = 1);
metadata = mag.meta.Science(Setup = mag.meta.Setup(Model = "MTT"));

expectedData = uncalibratedData;
expectedData{:, "x"} = -1;
expectedData{:, "y"} = -2;
expectedData{:, "z"} = -3;

% Exercise.
calibrationStep = mag.process.Calibration(RangeVariable = "range", Variables = ["x", "y", "z"], Temperature = "Cold");
calibratedData = calibrationStep.apply(uncalibratedData, metadata);

% Verify.
testCase.verifyThat(calibratedData, matlab.unittest.constraints.IsEqualTo(expectedData, Within = matlab.unittest.constraints.AbsoluteTolerance(1e-10)), ...
"Calibrated value should match expectation.");
end
end
end

0 comments on commit 6d60229

Please sign in to comment.