Skip to content

Commit

Permalink
Remove properties from unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Debon committed Jan 10, 2019
1 parent 28c25f6 commit 2fa7a5c
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 49 deletions.
16 changes: 0 additions & 16 deletions src/test/java/AnalogousTest.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assumptions.assumeThat;

import com.pholser.junit.quickcheck.Property;
import com.pholser.junit.quickcheck.runner.JUnitQuickcheck;
import org.junit.Before;
import org.junit.Test;
Expand All @@ -17,20 +15,6 @@ public void setUp() {
cut = new Analogous();
}

@Property
public void fizz_plus3(int anyInt) {
assumeThat(cut.fizzBuzz(anyInt)).contains("fizz");

assertThat(cut.fizzBuzz(anyInt + 3)).contains("fizz");
}

@Property
public void buzz_plus5(int anyInt) {
assumeThat(cut.fizzBuzz(anyInt)).contains("buzz");

assertThat(cut.fizzBuzz(anyInt + 5)).contains("buzz");
}

@Test
public void _1() {
assertThat(cut.fizzBuzz(1)).isEqualTo("1");
Expand Down
10 changes: 0 additions & 10 deletions src/test/java/IdempotenceTest.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import static io.vavr.API.List;
import static org.assertj.core.api.Assertions.assertThat;

import com.pholser.junit.quickcheck.Property;
import com.pholser.junit.quickcheck.runner.JUnitQuickcheck;
import io.vavr.collection.List;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
Expand All @@ -18,14 +16,6 @@ public void setUp() {
cut = new Idempotence();
}

@Property
public void idempotent(List<Integer> anyIntegers) {
List<Integer> ranOnce = cut.sortByEvenThenValue(anyIntegers);
List<Integer> ranTwice = cut.sortByEvenThenValue(ranOnce);

assertThat(ranOnce).isEqualTo(ranTwice);
}

@Test
public void empty_empty() {
assertThat(cut.sortByEvenThenValue(List())).isEqualTo(List());
Expand Down
14 changes: 0 additions & 14 deletions src/test/java/InvariantTest.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assumptions.assumeThat;

import com.pholser.junit.quickcheck.Property;
import com.pholser.junit.quickcheck.runner.JUnitQuickcheck;
import java.time.LocalDate;
import org.junit.Before;
Expand All @@ -18,18 +16,6 @@ public void setUp() {
cut = new Invariant();
}

@Property
public void invariant_31_12(short anyYear) {
assertThat(cut.isNewYearEve(LocalDate.of(anyYear, 12, 31))).isTrue();
}

@Property
public void otherwise_false(LocalDate anyDate) {
assumeThat(anyDate.getDayOfMonth() == 31 && anyDate.getMonthValue() == 12).isFalse();

assertThat(cut.isNewYearEve(anyDate)).isFalse();
}

@Test
public void _2018_12_31() {
assertThat(cut.isNewYearEve(LocalDate.of(2018, 12, 31))).isTrue();
Expand Down
9 changes: 0 additions & 9 deletions src/test/java/price/InverseTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import static org.assertj.core.api.Assertions.assertThat;

import com.pholser.junit.quickcheck.Property;
import com.pholser.junit.quickcheck.runner.JUnitQuickcheck;
import java.math.BigDecimal;
import org.junit.Before;
Expand All @@ -19,14 +18,6 @@ public void setUp() {
cut = new Inverse();
}

@Property
public void inverse(Price anyPrice) {
Price withTaxes = cut.addTaxes(anyPrice);
Price actual = cut.removeTaxes(withTaxes);

assertThat(actual).isEqualTo(anyPrice);
}

@Test
public void _1_1dot20() {
Price actual = cut.addTaxes(new Price().withValue(BigDecimal.valueOf(1.0)));
Expand Down

0 comments on commit 2fa7a5c

Please sign in to comment.