Created
April 27, 2019 09:19
-
-
Save tbelmega/e3a957417dd33656b113590de14b3038 to your computer and use it in GitHub Desktop.
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
@Test | |
fun `findMostOrderedProducts - 6 orders for 3 products in db - returns Top 2`() { | |
// given | |
val numberOfProducts = 2 | |
val product1 = Product("1", "Ryzen 7 2700X", "AMD") | |
val product2 = Product("2", "Core i9 9900K", "Intel") | |
// when | |
val foundProducts = productRepository.findMostOrderedProducts(numberOfProducts) | |
// then | |
assertThat(foundProducts).hasSize(numberOfProducts) | |
assertThat(foundProducts).containsExactlyInAnyOrder(product1, product2) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment