Hi! I'm trying to create a test that checks the de...
# box-products
j
Hi! I'm trying to create a test that checks the default value of the parameters with default deffined.
b
Hi @Jesus Merino please use threads
I don't understand wshat you are trying to do exactly.
When writing a unit test, you are generally testing for one of two things-- that a given set of input to a method • generates a specific return value • and/or generates a given set of changes in the enclosing class or mocked dependencies.
Are you trying to mock the default value during the tests for an argument? If so, I don't think CFML allows that. I'm not sure why you'd need to mock that, but you can simulate the effective behavior by simply passing an explicit value to that argument.
j
Hi! i'm trying to create a test to verify de default values of a function. This has 2 goals: + Test if that default values are changed by mistake. + Avoid having to create several test that try to verify examples of calls (only with few params) to this function (assuming the expected default values).
Fortunately, in the code I'm working on, there are not many function calls to create the default values (Ex.
function doSomeThingToADatetime( my_date=now() ){...}
)