aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/tvmauth/client/ut/client_status_ut.cpp
blob: a1c3ae74cea9f0340f44557a1f6629bdcce4f3c6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <library/cpp/tvmauth/client/client_status.h>

#include <library/cpp/testing/unittest/registar.h>

using namespace NTvmAuth;

Y_UNIT_TEST_SUITE(ClientStatus) {
    Y_UNIT_TEST(Common) {
        UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Ok, TClientStatus().GetCode());
        UNIT_ASSERT_VALUES_EQUAL("", TClientStatus().GetLastError());

        UNIT_ASSERT_VALUES_EQUAL(TClientStatus::Warning, TClientStatus(TClientStatus::Warning, "kek"));
        UNIT_ASSERT_VALUES_EQUAL("kek",
                                 TClientStatus(TClientStatus::Warning, "kek").GetLastError());
        UNIT_ASSERT_VALUES_EQUAL("2;TvmClient: kek\n",
                                 TClientStatus(TClientStatus::Error, "kek").CreateJugglerMessage());
    }
}