Skip to content

Commit

Permalink
Sync tests for practice exercise prime factors (#2613)
Browse files Browse the repository at this point in the history
  • Loading branch information
manumafe98 authored Dec 30, 2023
1 parent 3cb37cd commit 56b0d79
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 3 deletions.
28 changes: 25 additions & 3 deletions exercises/practice/prime-factors/.meta/tests.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,41 @@
# This is an auto-generated file. Regular comments will be removed when this
# file is regenerated. Regenerating will not touch any manually added keys,
# so comments can be added in a "comment" key.
# This is an auto-generated file.
#
# Regenerating this file via `configlet sync` will:
# - Recreate every `description` key/value pair
# - Recreate every `reimplements` key/value pair, where they exist in problem-specifications
# - Remove any `include = true` key/value pair (an omitted `include` key implies inclusion)
# - Preserve any other key/value pair
#
# As user-added comments (using the # character) will be removed when this file
# is regenerated, comments can be added via a `comment` key.

[924fc966-a8f5-4288-82f2-6b9224819ccd]
description = "no factors"

[17e30670-b105-4305-af53-ddde182cb6ad]
description = "prime number"

[238d57c8-4c12-42ef-af34-ae4929f94789]
description = "another prime number"

[f59b8350-a180-495a-8fb1-1712fbee1158]
description = "square of a prime"

[756949d3-3158-4e3d-91f2-c4f9f043ee70]
description = "product of first prime"

[bc8c113f-9580-4516-8669-c5fc29512ceb]
description = "cube of a prime"

[7d6a3300-a4cb-4065-bd33-0ced1de6cb44]
description = "product of second prime"

[073ac0b2-c915-4362-929d-fc45f7b9a9e4]
description = "product of third prime"

[6e0e4912-7fb6-47f3-a9ad-dbcd79340c75]
description = "product of first and second prime"

[00485cd3-a3fe-4fbe-a64a-a4308fc1f870]
description = "product of primes and non-primes"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,48 @@ public void testPrimeNumber() {
assertThat(primeFactorsCalculator.calculatePrimeFactorsOf(2L)).containsExactly(2L);
}

@Ignore("Remove to run test")
@Test
public void testAnotherPrimeNumber() {
assertThat(primeFactorsCalculator.calculatePrimeFactorsOf(3L)).containsExactly(3L);
}

@Ignore("Remove to run test")
@Test
public void testSquareOfAPrime() {
assertThat(primeFactorsCalculator.calculatePrimeFactorsOf(9L)).containsExactly(3L, 3L);
}

@Ignore("Remove to run test")
@Test
public void testProductOfFirstPrime() {
assertThat(primeFactorsCalculator.calculatePrimeFactorsOf(4L)).containsExactly(2L, 2L);
}

@Ignore("Remove to run test")
@Test
public void testCubeOfAPrime() {
assertThat(primeFactorsCalculator.calculatePrimeFactorsOf(8L)).containsExactly(2L, 2L, 2L);
}

@Ignore("Remove to run test")
@Test
public void testProductOfSecondPrime() {
assertThat(primeFactorsCalculator.calculatePrimeFactorsOf(625L)).containsExactly(5L, 5L, 5L, 5L);
}

@Ignore("Remove to run test")
@Test
public void testProductOfThirdPrime() {
assertThat(primeFactorsCalculator.calculatePrimeFactorsOf(27L)).containsExactly(3L, 3L, 3L);
}

@Ignore("Remove to run test")
@Test
public void testProductOfFirstAndSecondPrime() {
assertThat(primeFactorsCalculator.calculatePrimeFactorsOf(6L)).containsExactly(2L, 3L);
}

@Ignore("Remove to run test")
@Test
public void testProductOfPrimesAndNonPrimes() {
Expand Down

0 comments on commit 56b0d79

Please sign in to comment.