/* * // Copyright (c) 2024 ShanMukha Innovations Pvt. Ltd. All rights reserved. * // Notice: All information contained herein is, and remains * // the property of ShanMukha Innovations Pvt. Ltd. and its suppliers, * // if any. The intellectual and technical concepts contained * // herein are proprietary to ShanMukha Innovations Pvt. Ltd. * // and its suppliers and may be covered by Indian and Foreign Patents, * // patents in process, and are protected by trade secret or copyright law. * // Dissemination of this information or reproduction of this material * // is strictly forbidden unless prior written permission is obtained * // from ShanMukha Innovations Pvt. Ltd. */ package com.example.hpostesting class TestRightViewModelTest { // private val viewModel = TestRightViewModel() // private val data = InputData() // // @Test // fun test_mapDeviceConstants() { // viewModel.mapDeviceConstants(data.inputRead) // assertEquals("0", DataHolder.deviceConstant!!.a) // assertEquals("1.69989422e-06", DataHolder.deviceConstant!!.b) // assertEquals("1.60642711e-01", DataHolder.deviceConstant!!.c) // assertEquals("3.85754470e+02", DataHolder.deviceConstant!!.d) // } // // @Test // fun test_mapPixelNumberToWavelength() { // viewModel.mapDeviceConstants(data.inputRead) // viewModel.mapPixelNumberToWavelength() // // val outputList = TestDataGenerator().getOutputMapPixelNumberToWavelength() // // assertEquals(Constants.TEST_RIGHT_TOTAL_PIXEL, DataHolder.wavelengthToPixelArray.size) // assertEquals(Constants.TEST_RIGHT_TOTAL_PIXEL, outputList.size) // // val df = DecimalFormat("#.###") // df.roundingMode = RoundingMode.FLOOR // // for (i in 0 until Constants.TEST_RIGHT_TOTAL_PIXEL){ // assertEquals(df.format(outputList[i]), df.format(DataHolder.wavelengthToPixelArray[i])) // } // // } // //// @Test //// fun test_mapIntensityValues() { //// val inputReference = TestDataGenerator().getInputReferenceMapIntensityValues() //// val inputSample = TestDataGenerator().getInputSampleMapIntensityValues() //// //// viewModel.mapIntensityValues(inputReference, true) //// viewModel.mapIntensityValues(inputSample, false) //// //// val outputReference = TestDataGenerator().getOutputReferenceMapIntensityValues() //// val outputSample = TestDataGenerator().getOutputSampleMapIntensityValues() //// //// assertEquals(outputReference, DataHolder.intensityReferenceArray) //// assertEquals(outputSample, viewModel.intensitySampleArray) //// } // // @Test // fun test_mapWavelengthToAbsorbance() { // // viewModel.mapDeviceConstants(data.inputRead) // viewModel.mapPixelNumberToWavelength() // viewModel.mapIntensityValues(TestDataGenerator().getInputReferenceMapIntensityValues(), true) // viewModel.mapIntensityValues(TestDataGenerator().getInputSampleMapIntensityValues(), false) // viewModel.patientDetails = PatientData("Surya", 2, "Male", TestRightResultType.UNDEFINED) // viewModel.mapWavelengthToAbsorbance() // // val wavelengthList = TestDataGenerator().getOutputMapPixelNumberToWavelength() // val absorbanceList = TestDataGenerator().getOutputMapWavelengthToAbsorbance() // // val df = DecimalFormat("#.###") // df.roundingMode = RoundingMode.FLOOR // // assertEquals(Constants.TEST_RIGHT_TOTAL_PIXEL, viewModel.wavelengthToAbsorbance.size) // for (i in 0 until Constants.TEST_RIGHT_TOTAL_PIXEL){ // assertEquals(df.format(wavelengthList[i]), df.format(viewModel.wavelengthToAbsorbance[i][0])) // assertEquals(df.format(absorbanceList[i]), df.format(viewModel.wavelengthToAbsorbance[i][1])) // } // } // // // @Test // fun testRightViewModel_calculateDataForCSV() { // // viewModel.mapDeviceConstants(data.inputRead) // viewModel.mapPixelNumberToWavelength() // viewModel.mapIntensityValues(data.printForReference, true) // viewModel.mapIntensityValues(data.printForSample, false) //// viewModel.patientDetails = PatientData("Surya", 2, "Male", null) //// viewModel.calculateResults() // viewModel.mapWavelengthToAbsorbance() // // for (each in viewModel.wavelengthToAbsorbance){ // println(each[0].toString() + " -> " + each[1]) // } // } }