test/src/crypto/bip39/entropy_calculation_test.cpp
TEST_F(Bip39EntropyTest, DecodeSuccess) {
  EXPECT_OUTCOME_TRUE(mnemonic, Mnemonic::parse(phrase));
  auto joined_words = boost::algorithm::join(mnemonic.words, " ");
  ASSERT_EQ(joined_words, phrase);

  EXPECT_OUTCOME_TRUE(entropy,
                      bip39_provider->calculateEntropy(mnemonic.words));
  ASSERT_EQ(base::Buffer(entropy).toHex(), entropy_hex);

  EXPECT_OUTCOME_TRUE(seed, bip39_provider->makeSeed(entropy, "Substrate"));
  ASSERT_EQ(seed.toHex(), seed_hex);
}
/**
 * @given valid mnemonic, entropy and seed values
 * @when entropy is calculated by mnemonic
 * @and seed is calculated by entropy
 * @then entropy and seed come up with predefined values
 */
@given valid mnemonic, entropy and seed values
@when entropy is calculated by mnemonic
@and seed is calculated by entropy
@then entropy and seed come up with predefined values
@given valid mnemonic entropy and seed values @when entropy is calculated by mnemonic @and seed is calculated by entropy @then entropy and seed come up with predefined values
TEST_F(Bip39EntropyTest, DecodeSuccess) {
  EXPECT_OUTCOME_TRUE(mnemonic, Mnemonic::parse(phrase));
  auto joined_words = boost::algorithm::join(mnemonic.words, " ");
  ASSERT_EQ(joined_words, phrase);
  EXPECT_OUTCOME_TRUE(entropy,
                      bip39_provider->calculateEntropy(mnemonic.words));
  ASSERT_EQ(base::Buffer(entropy).toHex(), entropy_hex);
  EXPECT_OUTCOME_TRUE(seed, bip39_provider->makeSeed(entropy, "Substrate"));
  ASSERT_EQ(seed.toHex(), seed_hex);
}
TEST_F ( Bip39EntropyTest , DecodeSuccess ) { EXPECT_OUTCOME_TRUE ( mnemonic , Mnemonic :: parse ( phrase ) ) ; auto joined_words = boost :: algorithm :: join ( mnemonic . words , " " ) ; ASSERT_EQ ( joined_words , phrase ) ; EXPECT_OUTCOME_TRUE ( entropy , bip39_provider -> calculateEntropy ( mnemonic . words ) ) ; ASSERT_EQ ( base :: Buffer ( entropy ) . toHex ( ) , entropy_hex ) ; EXPECT_OUTCOME_TRUE ( seed , bip39_provider -> makeSeed ( entropy , " " ) ) ; ASSERT_EQ ( seed . toHex ( ) , seed_hex ) ; }
@given valid mnemonic, entropy and seed values
 @when entropy is calculated by mnemonic
 @and seed is calculated by entropy
 @then entropy and seed come up with predefined values
@given valid mnemonic entropy and seed values @when entropy is calculated by mnemonic @and seed is calculated by entropy @then entropy and seed come up with predefined values