в Pairs тесте вылетает ошибка хз почему#3
в Pairs тесте вылетает ошибка хз почему#3VynnykVV wants to merge 1 commit intoChangeRequest:masterfrom
Conversation
xSAVIKx
left a comment
There was a problem hiding this comment.
Please, review comments below and fix all problems, I'm sure, that your problem with test will be fixed, if you'll implement everything as it should be.
| * Created by User on 02.01.2017. | ||
| */ | ||
| public class Container <T> { | ||
| ArrayList<T> container= new ArrayList<T>(); |
There was a problem hiding this comment.
Use: List<T> container = new ArrayList<T>(); - in this way you'll use more generic type - List and if you'll need to change implementation to any other type, that implements List interface - it'll be easy for you. (It's common practice to use the most generic type you could.
| */ | ||
| public class Container <T> { | ||
| ArrayList<T> container= new ArrayList<T>(); | ||
| public Container (){ |
There was a problem hiding this comment.
If you don't make any initialization in default constructor - remove it from code - it'll be generated automatically.
| ArrayList<T> container= new ArrayList<T>(); | ||
| public Container (){ | ||
| } | ||
| public int size(Container e){ |
There was a problem hiding this comment.
Method size should return size of your underlying implementation (in your case size of variable container, but not some container that you receive).
| if(e==null)throw new NullPointerException(); | ||
| return container.size(); | ||
| } | ||
| public void clear(Container e){ |
| /** | ||
| * Created by User on 02.01.2017. | ||
| */ | ||
| public class Container <T> { |
There was a problem hiding this comment.
You must not use Collections API in your Container implementation. Reuse your implementation from OOP homework:
Create class container the same as for https://github.com/ChangeRequest/oop.hw1 but instead of Integer it should work with elements of any type.
| /** | ||
| * Created by User on 03.01.2017. | ||
| */ | ||
| public class DoubleGeneratorTestUnit { |
There was a problem hiding this comment.
There is no need to point that it's Unit test in class name, it should be just: DoubleGeneratorTest
| /** | ||
| * Created by User on 03.01.2017. | ||
| */ | ||
| public class IntegerGeneratorTestUnit { |
| Assert.assertEquals(expected,result); | ||
| } | ||
| @org.junit.Test | ||
| public void testWhatTypeOfNumberGeneratesShouldBeInteger(){ |
There was a problem hiding this comment.
the better method name will be: shouldGenerateNumberOfIntegerType
| /** | ||
| * Created by User on 03.01.2017. | ||
| */ | ||
| public class TestTest { |
| /** | ||
| * Created by User on 03.01.2017. | ||
| */ | ||
| public class pairUtils { |
There was a problem hiding this comment.
Class names should start from Uppercase letter.
Also, all tests should end with Test suffix
java.lang.NoClassDefFoundError: