-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding tests for DeploymentCompleteSpec
- Loading branch information
1 parent
90ad35c
commit e2d4059
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
...om/mjrichardson/teamCity/buildTriggers/DeploymentComplete/DeploymentCompleteSpecTest.java
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,26 @@ | ||
package com.mjrichardson.teamCity.buildTriggers.DeploymentComplete; | ||
|
||
import org.testng.Assert; | ||
import org.testng.annotations.Test; | ||
|
||
@Test | ||
public class DeploymentCompleteSpecTest { | ||
|
||
@Test | ||
public void two_param_ctor_returns_error_message() throws Exception { | ||
DeploymentCompleteSpec sut = new DeploymentCompleteSpec("theurl", "theproject"); | ||
Assert.assertEquals(sut.getRequestorString(), "Unsuccessful attempt to get deployments for theproject on theurl"); | ||
} | ||
|
||
@Test | ||
public void when_successful_returns_success_message() throws Exception { | ||
DeploymentCompleteSpec sut = new DeploymentCompleteSpec("theurl", "theproject", "theenv", true); | ||
Assert.assertEquals(sut.getRequestorString(), "Successful deployment of theproject to theenv on theurl"); | ||
} | ||
|
||
@Test | ||
public void when_unsuccessful_returns_success_message() throws Exception { | ||
DeploymentCompleteSpec sut = new DeploymentCompleteSpec("theurl", "theproject", "theenv", false); | ||
Assert.assertEquals(sut.getRequestorString(), "Deployment of theproject on theurl"); | ||
} | ||
} |