Skip to content

Latest commit

 

History

History
85 lines (59 loc) · 3.34 KB

README.md

File metadata and controls

85 lines (59 loc) · 3.34 KB

CSE 308 Software Engineering

  • Offline 1

    Java Refresher and OOP Design Principle

  • Offline 2

    Creational Design Pattern

  • Offline 3

    Structural Design Pattern

  • Offline 4

    Behavioral Design Pattern

  • Offline 5

    Unit Testing

    • Problem Statement
    • Solution
      • Parameterized Unit Testing

          @Parameterized.Parameters
          public static Collection input(){
              return Arrays.asList(new Object[][] {
                      {"Sort Blank List",SortingClassTestGenerator.getBlankList()},
                      {"Sort One Number",SortingClassTestGenerator.getOneNumber()},
                      {"Sort Two Number",SortingClassTestGenerator.getTwoNumber()},
                      {"Sort Random Sized List",SortingClassTestGenerator.getRandomSizeList()},
                      {"Sort Random List",SortingClassTestGenerator.getRandomList()},
                      {"Sort Ascending List",SortingClassTestGenerator.getSortedAscending()},
                      {"Sort Descending List",SortingClassTestGenerator.getSortedDescending()},
                      {"Sort Equal Element List",SortingClassTestGenerator.getEqualElemenetList()},
                      {"Sort Negative Element List",SortingClassTestGenerator.getNegativeElementList()},
                      {"Sort Null List",SortingClassTestGenerator.getNull()},
              });
          }
          @org.junit.Test
          public void sort() {
        
              List<Integer>listIn = null;
        
              if(inputList != null) listIn = new ArrayList<Integer>(inputList);
              List<Integer>listOut = sortingClass.sort(inputList);
        
              assertTrue(message +": List altered",checkNotAltered(listIn,listOut));
              assertTrue(message +": List not sorted\nOutput = "+listOut,checkSortedAscending(listOut));
          }