Created
May 1, 2018 10:45
-
-
Save pandanote-info/340795c6e2761abd203a7ecd53863543 to your computer and use it in GitHub Desktop.
複素数を扱うためのScalaクラスに対するScalaTest用のテストファイルの記述例。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package info.pandanote.test | |
import org.scalatest.Assertions | |
import org.scalatest._ | |
class ComplexNumberTest extends FlatSpec with Matchers { | |
"a" should "123" in { | |
val a = "123" | |
a should be("123") | |
} | |
"a*a" should "-3+4i" in { | |
val a = ComplexNumber(1,2) | |
a*a should be(ComplexNumber(-3,4)) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment