Skip to content

zarif98sjs/CSE-308-Software-Engineering

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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));
          }