aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/messagebus/coreconn_ut.cpp
blob: 87ef125bd8a279cdfc60f216901268b8a4b603e1 (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);
    }
}