-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #55 from MonsantoCo/ip-address-type
Adding IPAddress type
- Loading branch information
Showing
2 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
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
34 changes: 34 additions & 0 deletions
34
src/test/scala/com/monsanto/arch/cloudformation/model/resource/EC2_UT.scala
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.monsanto.arch.cloudformation.model.resource | ||
|
||
import org.scalatest.{Matchers, FunSpec} | ||
import spray.json._ | ||
|
||
class EC2_UT extends FunSpec with Matchers { | ||
|
||
describe("CidrBlock"){ | ||
|
||
val cidr = CidrBlock(192,168,1,2,32) | ||
|
||
it("should write valid CidrBlock"){ | ||
cidr.toJson shouldEqual JsString("192.168.1.2/32") | ||
} | ||
|
||
it("should read valid CidrBlock") { | ||
JsString("192.168.1.2/32").convertTo[CidrBlock] shouldEqual cidr | ||
} | ||
|
||
} | ||
|
||
describe("IPAddress"){ | ||
val ipAddress = IPAddress(192,168,1,2) | ||
|
||
it("should write valid IPAddress"){ | ||
ipAddress.toJson shouldEqual JsString("192.168.1.2") | ||
} | ||
|
||
it("should read valid IPAddress"){ | ||
JsString("192.168.1.2").convertTo[IPAddress] shouldEqual ipAddress | ||
} | ||
|
||
} | ||
} |