coreconn_ut.cpp 618 B

12345678910111213141516171819202122232425
  1. #include <library/cpp/testing/unittest/registar.h>
  2. #include "coreconn.h"
  3. #include <util/generic/yexception.h>
  4. Y_UNIT_TEST_SUITE(TMakeIpVersionTest) {
  5. using namespace NBus;
  6. Y_UNIT_TEST(IpV4Allowed) {
  7. UNIT_ASSERT_EQUAL(MakeIpVersion(true, false), EIP_VERSION_4);
  8. }
  9. Y_UNIT_TEST(IpV6Allowed) {
  10. UNIT_ASSERT_EQUAL(MakeIpVersion(false, true), EIP_VERSION_6);
  11. }
  12. Y_UNIT_TEST(AllAllowed) {
  13. UNIT_ASSERT_EQUAL(MakeIpVersion(true, true), EIP_VERSION_ANY);
  14. }
  15. Y_UNIT_TEST(NothingAllowed) {
  16. UNIT_ASSERT_EXCEPTION(MakeIpVersion(false, false), yexception);
  17. }
  18. }