summaryrefslogtreecommitdiffstats
path: root/library/cpp/unified_agent_client/ut/async_joiner_ut.cpp
blob: da11a27aac9407055223ae258a4a7319b57d16a6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <library/cpp/unified_agent_client/async_joiner.h>

#include <library/cpp/testing/gtest/gtest.h>

using namespace NUnifiedAgent;

TEST(TAsyncJoiner, TryRefBeforeJoinReturnsTrue) {
    TAsyncJoiner joiner;
    EXPECT_TRUE(joiner.TryRef());
    joiner.UnRef();
    joiner.Join().Wait();
}

TEST(TAsyncJoiner, TryRefAfterJoinReturnsFalse) {
    TAsyncJoiner joiner;
    joiner.Join().Wait();
    EXPECT_FALSE(joiner.TryRef());
}