I want to test a function in a class but it relies on the object which isn't called
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
So I have a class which calls another class then the method in the lower class. I have now moved onto unit testing this functions. In the lower class the method has a series of if statements which depends on the object. However the object isn't used when calling the function.
It would be very complicated to instantiate the upper class prior to instantiating the lower class then calling the method. So that the object is in use. Can I just call the method using the object as an input?
3 comentarios
Steven Lord
el 1 de Feb. de 2024
I think you should probably show a small concrete example of what you're describing. I'm not certain I understand what your implementation is doing from this prose description. In this case, a small chunk of code may be worth at least a few hundred words.
Respuestas (0)
Ver también
Categorías
Más información sobre Testing Frameworks en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!