aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/messagebus/coreconn_ut.cpp
blob: beb6850f26f5ac6bf946c4dd9647c7012c22dba6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <library/cpp/testing/unittest/registar.h>

#include "coreconn.h"

#include <util/generic/yexception.h>

Y_UNIT_TEST_SUITE(TMakeIpVersionTest) {
    using namespace NBus;

    Y_UNIT_TEST(IpV4Allowed) {
        UNIT_ASSERT_EQUAL(MakeIpVersion(true, false), EIP_VERSION_4);
    }

    Y_UNIT_TEST(IpV6Allowed) {
        UNIT_ASSERT_EQUAL(MakeIpVersion(false, true), EIP_VERSION_6);
    }

    Y_UNIT_TEST(AllAllowed) {
        UNIT_ASSERT_EQUAL(MakeIpVersion(true, true), EIP_VERSION_ANY);
    }

    Y_UNIT_TEST(NothingAllowed) {
        UNIT_ASSERT_EXCEPTION(MakeIpVersion(false, false), yexception);
    }
}