def METHOD_NAME(show_plots, useNoiseStd, useBias, useMinOut, useMaxOut, useScaleFactor, errTol):
    testFailCount = 0                       # zero unit test result counter
    testMessages = []                       # create empty array to store test log messages
    unitTaskName = "unitTask"               # arbitrary name (don't change)
    unitProcessName = "TestProcess"         # arbitrary name (don't change)
    # Create a sim module as an empty container
    unitTestSim = SimulationBaseClass.SimBaseClass()
    # Create test thread
    testProcessRate_s = 0.01
    testProcessRate = macros.sec2nano(testProcessRate_s)     # update process rate update time
    testProc = unitTestSim.CreateNewProcess(unitProcessName)
    testProc.addTask(unitTestSim.CreateNewTask(unitTaskName, testProcessRate))
    # Construct algorithm and associated C++ container
    testModule = magnetometer.Magnetometer()
    testModule.ModelTag = "TAM_sensor"
    NoiseStd = [3e-9, 3e-9, 3e-9]  # Tesla
    bias = [1e-6, 1e-6, 1e-5]  # Tesla
    minOut = -1e-4  # Tesla
    maxOut = 1e-4  # Tesla
    if useNoiseStd:
        testModule.senNoiseStd = NoiseStd
    if useBias:
        testModule.senBias = bias
    if useScaleFactor:
        testModule.scaleFactor = 2
    if useMinOut & useMaxOut:
        testModule.minOutput = minOut
        testModule.maxOutput = maxOut
    # Add module to the task
    unitTestSim.AddModelToTask(unitTaskName, testModule)
    # Set-up fake magnetic field
    magFieldMsg = messaging.MagneticFieldMsgPayload()
    trueMagField = [1e-5, 2e-5, 1.5e-5]  # [T] true magnetic field outputs in inertial frame
    magFieldMsg.magField_N = trueMagField
    magMsg = messaging.MagneticFieldMsg().write(magFieldMsg)
    testModule.magInMsg.subscribeTo(magMsg)
    # Set-up fake attitude
    satelliteStateMsg = messaging.SCStatesMsgPayload()
    angles = np.linspace(0., 2 * np.pi, 59000)
    sigmas = np.zeros(len(angles))
    for i in range(len(sigmas)):  # convert rotation angle about 3rd axis to MRP
        sigmas[i] = np.tan(angles[i] / 4.)  # This is iterated through in the execution for loop
        satelliteStateMsg.sigma_BN = [0.3, 0.2, sigmas[i]]
    scMsg = messaging.SCStatesMsg().write(satelliteStateMsg)
    testModule.stateInMsg.subscribeTo(scMsg)
    dcm_BN = rbk.MRP2C(satelliteStateMsg.sigma_BN)
    # Sensor set-up
    yaw = 0.7854  # [rad]
    pitch = 1.0  # [rad]
    roll = 0.1  # [rad]
    dcm_SB_py = rbk.euler3212C([yaw, pitch, roll])  # for checking the dcm_SB
    dcm_SB = testModule.setBodyToSensorDCM(yaw, pitch, roll)
    dcm_SN = np.dot(dcm_SB, dcm_BN)
    trueTam_S =  np.dot(dcm_SN, trueMagField)
    if useBias:
        trueTam_S += bias  # Tesla
    if useScaleFactor:
        trueTam_S *= 2
    for i in range(len(trueTam_S)):
        if useMinOut & useMaxOut:
            if trueTam_S[i] < minOut:
                trueTam_S[i] = minOut
            if trueTam_S[i] > maxOut:
                trueTam_S[i] = maxOut
    # Setup logging on the test module output message so that we get all the writes to it
    dataLog = testModule.tamDataOutMsg.recorder()
    unitTestSim.AddModelToTask(unitTaskName, dataLog)
    # Need to call the self-init and cross-init methods
    unitTestSim.InitializeSimulation()
    unitTestSim.TotalSim.SingleStepProcesses()
    # This pulls the actual data log from the simulation run.
    tamData = dataLog.tam_S
    print(tamData)
    print(trueTam_S)
    if not unitTestSupport.isArrayEqualRelative(tamData[0], trueTam_S, 3, errTol):
        testFailCount += 1
    #   print out success or failure message
    if testFailCount == 0:
        print("PASSED: " + testModule.ModelTag)
    else:
        print("Failed: " + testModule.ModelTag)
    print("This test uses a relative accuracy value of " + str(errTol*100) + " percent")
    return [testFailCount, ''.join(testMessages)]