Skip to content

Commit

Permalink
test : Add Test Code
Browse files Browse the repository at this point in the history
  • Loading branch information
mookseong committed Feb 18, 2023
1 parent 98bb635 commit ff7d973
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 114 deletions.
37 changes: 37 additions & 0 deletions src/test/java/org/spoon/SpoonInformationTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package org.spoon;

import org.junit.jupiter.api.Test;
import org.spoon.lib.information.ParserBookKbuDetail;
import org.spoon.lib.information.ParserBookNaverDetail;
import org.spoon.lib.model.BookInfo;

public class SpoonInformationTest {
@Test
void getInformationByParser() {
Spoon spoon = new Spoon();
BookInfo bookInfo = spoon.getInformation(new ParserBookKbuDetail(),"https://lib.bible.ac.kr/Search/Detail/165517");
inputBookInfo(bookInfo);
}

@Test
void getInformationByNaver() {
Spoon spoon = new Spoon();
BookInfo bookInfo = spoon.getInformation(new ParserBookNaverDetail("", ""), "https://lib.bible.ac.kr/Search/Detail/166123");
inputBookInfo(bookInfo);
}

private void inputBookInfo(BookInfo bookInfo) {
System.out.println(" ");
System.out.println("title : " + bookInfo.getTitle());
System.out.println("image : " + bookInfo.getImage());
System.out.println("isbn : " + bookInfo.getIsbn());
System.out.println("ddc : " + bookInfo.getDdc());
System.out.println("저자 : " + bookInfo.getAuthor());
System.out.println("책가격 : " + bookInfo.getDiscount().trim());
System.out.println("청구기호 : " + bookInfo.getNumber());
System.out.println("출판사 : " + bookInfo.getPublisher());
System.out.println("출판날자 : " + bookInfo.getPubdate());
System.out.println("설명 : " + bookInfo.getDescription());
System.out.println("-----------------------------------");
}
}
31 changes: 31 additions & 0 deletions src/test/java/org/spoon/SpoonNoticeTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package org.spoon;

import org.junit.jupiter.api.Test;
import org.spoon.notice.list.*;
import org.spoon.notice.model.PostNoticeList;

import java.util.List;

class SpoonNoticeTest {

@Test
void getKbuNoticeList(){
Spoon spoon = new Spoon();
List<PostNoticeList> postNoticeLists =spoon.getKbuNoticeList(new ParserNoticeAiNaviList(1));
System.out.println(" ");
System.out.println("bookRentBook");
for (PostNoticeList noticeList : postNoticeLists) {
inputNoticeList(noticeList);
}
}

private void inputNoticeList(PostNoticeList noticeList){
System.out.println("글 번호 : " + noticeList.getPageNum());
System.out.println("글 제목 : " + noticeList.getTitle());
System.out.println("글 작성자 : " + noticeList.getAuthor());
System.out.println("글 작성일 : " + noticeList.getDate());
System.out.println("글 url : " + noticeList.getUrl());
System.out.println("-----------------------------------");
}

}
24 changes: 24 additions & 0 deletions src/test/java/org/spoon/SpoonSearchTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package org.spoon;

import org.junit.jupiter.api.Test;
import org.spoon.lib.model.BookSearchList;
import org.spoon.lib.search.ParserBookSearchModel;

import java.util.List;

public class SpoonSearchTest {
@Test
void getBookSearchListBySearch() {
Spoon spoon = new Spoon();
List<BookSearchList> bookSearchLists = spoon.getBookSearchList(new ParserBookSearchModel(), "언어", 1);
for (BookSearchList bookList : bookSearchLists) {
System.out.println("책 제목 : " + bookList.getTitle());
System.out.println("책 사진 : " + bookList.getImage());
System.out.println("책 etc : " + bookList.getEtc());
System.out.println("책 info : " + bookList.getInfo());
System.out.println("책 isbn : " + bookList.getIsbn());
System.out.println("-----------------------------------");
}
}

}
114 changes: 0 additions & 114 deletions src/test/java/org/spoon/SpoonTest.java

This file was deleted.

0 comments on commit ff7d973

Please sign in to comment.