Skip to content

Commit

Permalink
Created UnitSpec for all unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
VassilisSoum committed Feb 17, 2021
1 parent 29db994 commit cfffe59
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 19 deletions.
6 changes: 6 additions & 0 deletions src/test/scala/com/bookworm/application/UnitSpec.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.bookworm.application

import org.scalamock.scalatest.MockFactory
import org.scalatest.{Matchers, WordSpec}

abstract class UnitSpec extends WordSpec with Matchers with MockFactory {}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.bookworm.application.books.domain.model

import org.scalatest.{Matchers, WordSpec}
import com.bookworm.application.UnitSpec

class AuthorFirstNameTest extends WordSpec with Matchers {
class AuthorFirstNameTest extends UnitSpec{

"AuthorFirstName" should {
"create a new instance given valid data" in {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.bookworm.application.books.domain.model

import org.scalatest.{Matchers, WordSpec}
import com.bookworm.application.UnitSpec

class AuthorLastNameTest extends WordSpec with Matchers {
class AuthorLastNameTest extends UnitSpec {

"AuthorLastName" should {
"create a new instance given valid data" in {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.bookworm.application.books.domain.model

import org.scalatest.{Matchers, WordSpec}
import com.bookworm.application.UnitSpec

class BookIsbnTest extends WordSpec with Matchers {
class BookIsbnTest extends UnitSpec {

"BookIsbn" should {
"create a new instance given valid data" in {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.bookworm.application.books.domain.model

import org.scalatest.{Matchers, WordSpec}
import com.bookworm.application.UnitSpec

class BookSummaryTest extends WordSpec with Matchers {
class BookSummaryTest extends UnitSpec {

"BookSummary" should {
"create a new instance given valid data" in {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.bookworm.application.books.domain.model

import org.scalatest.{Matchers, WordSpec}
import com.bookworm.application.UnitSpec

class BookTitleTest extends WordSpec with Matchers {
class BookTitleTest extends UnitSpec {

"BookTitle" should {
"create a new instance given valid data" in {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.bookworm.application.books.domain.model

import org.scalatest.{Matchers, WordSpec}
import com.bookworm.application.UnitSpec

class ContinuationTokenTest extends WordSpec with Matchers {
class ContinuationTokenTest extends UnitSpec {

"ContinuationToken" should {
"create a new instance given valid data" in {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.bookworm.application.books.domain.model

import org.scalatest.{Matchers, WordSpec}
import com.bookworm.application.UnitSpec

class GenreNameTest extends WordSpec with Matchers {
class GenreNameTest extends UnitSpec {

"GenreName" should {
"create a new instance given valid data" in {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.bookworm.application.books.domain.model

import org.scalatest.{Matchers, WordSpec}
import com.bookworm.application.UnitSpec

class PaginationLimitTest extends WordSpec with Matchers {
class PaginationLimitTest extends UnitSpec {

"PaginationLimit" should {
"create a new instance given valid data" in {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
package com.bookworm.application.books.domain.port.inbound

import cats.effect.IO
import com.bookworm.application.UnitSpec
import com.bookworm.application.books.domain.model._
import com.bookworm.application.books.domain.port.inbound.query.{BookQueryModel, BooksByGenreQuery}
import com.bookworm.application.books.domain.port.outbound.BookRepository
import org.scalamock.scalatest.MockFactory
import org.scalatest.{Matchers, WordSpec}

import java.time.LocalDateTime
import java.util.UUID

class BookServiceTest extends WordSpec with Matchers with MockFactory {
class BookServiceTest extends UnitSpec {

val bookRepository: BookRepository[IO] = mock[BookRepository[IO]]
val bookService: BookService = new BookService(bookRepository)
Expand Down

0 comments on commit cfffe59

Please sign in to comment.