Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Thanks.! :)
refresh your browser: I just edited the tests so that the calls and the assertions are now concomitant. That should be good. Improved a bit the error messages too.
This is the Output Log
Entered the Constructor
Error - Null
msg - null
----------
Entered the Constructor
size => rows = 2 cols = 2
1.0 2.0
Error - Null
msg - null
----------
Entered the Constructor
size => rows = 2 cols = 3
1.0 2.0 3.0
1.0 2.0
Passed Printing
Error - Index
msg - Index 2 out of bounds for length 2
----------
Reached Exit
The Error Message :-
should throw IllegalArgumentException if array is null: expected null, but was:Matrix@769e7ee8
Its always the same data. And the message is the above one or Test Failed. I tried different Exceptions but none worked. Also No Exception still doesn't works.
Cannot use other than runtime Exceptions because the methods in the class creates the Matrix object by this constructor and then returns them. Like -> return new Matrix(someData);
IndexOutOfBoundsException occurs due to the short length (2 rather than 3 as row 1) of 2nd row
What to do.?
warning, the tests are "rather shity", about that part: there are actually several tests, some with the exact same assertion message but testing different things. I'll bet you're not failing the same every time, depending on your changes. Try to carefully print all the data you have to track doown the thing. If not enough, I can past the inputs of the tests.
note: your class is called on 4 different inputs, and only then the 4 related assertions are made, so be very careful with what's happening...
yup throwing the exception but it still wont work.
clone(element) a function to copy all the elements to new array and return.
-> ?
(forget about the actual/expected part, it's not relevant, for those tests)
I pass all the tests except one test1Init.
It says:
test1Init
should throw IllegalArgumentException if array is null: expected null, but was:Matrix@14d3bc22
can someone help.?
Thanks! It worked!