test/src/scale/scale_variant_test.cpp
/**
 * @given byte array of encoded variant of types uint8_t and uint32_t
 * containing uint32_t value
 * @when variant decoded from scale decoder stream
 * @then obtained varian has alternative type uint32_t and is equal to encoded
 * uint32_t value
 */
@given byte array of encoded variant of types uint8_t and uint32_t
containing uint32_t value
@when variant decoded from scale decoder stream
@then obtained varian has alternative type uint32_t and is equal to encoded
uint32_t value
@given byte array of encoded variant of types uint8_t and uint32_t containing uint32_t value @when variant decoded from scale decoder stream @then obtained varian has alternative type uint32_t and is equal to encoded uint32_t value
TEST(ScaleVariant, DecodeU32Success) {
  ByteArray match = {1, 1, 0, 0, 0};  
  ScaleDecoderStream s(match);
  boost::variant<uint8_t, uint32_t> val{};
  ASSERT_NO_THROW(s >> val);
  sgns::visit_in_place(
      val, [](uint32_t v) { ASSERT_EQ(v, 1); }, [](uint8_t v) { FAIL(); });
}
TEST ( ScaleVariant , DecodeU32Success ) { ByteArray match = { 1 , 1 , 0 , 0 , 0 } ; ScaleDecoderStream s ( match ) ; boost :: variant < uint8_t , uint32_t > val { } ; ASSERT_NO_THROW ( s >> val ) ; sgns :: visit_in_place ( val , [ ] ( uint32_t v ) { ASSERT_EQ ( v , 1 ) ; } , [ ] ( uint8_t v ) { FAIL ( ) ; } ) ; }
@given byte array of encoded variant of types uint8_t and uint32_t
 containing uint32_t value
 @when variant decoded from scale decoder stream
 @then obtained varian has alternative type uint32_t and is equal to encoded
 uint32_t value
@given byte array of encoded variant of types uint8_t and uint32_t containing uint32_t value @when variant decoded from scale decoder stream @then obtained varian has alternative type uint32_t and is equal to encoded uint32_t value
// uint32_t{1}