Skip to content

Commit

Permalink
Adding tests for DeploymentCompleteSpec
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-richardson committed Feb 23, 2016
1 parent 90ad35c commit e2d4059
Showing 1 changed file with 26 additions and 0 deletions.
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");
}
}

0 comments on commit e2d4059

Please sign in to comment.