package com.sonymusic.delphi.etl.apps

import org.scalatest.funspec.AnyFunSpec
import org.scalatest.matchers.should.Matchers

class ModeSpec extends AnyFunSpec with Matchers {

  describe("apply") {

    it("should return Mode.Backfill when 'backfill' value provided") {
      Mode("backfill") shouldBe Mode.Backfill
    }

    it("should return Mode.Default when 'default' value provided") {
      Mode("default") shouldBe Mode.Default
    }

    it("should throw IllegalArgumentException when unexpected value provided") {
      val thrown = the[IllegalArgumentException] thrownBy Mode("random")
      thrown should have message "Unsupported mode value 'random'"
    }
  }
}
