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

#include <wmconsole/version3/library/jupiter/jupiter.h>

using namespace NWebmaster;

Y_UNIT_TEST_SUITE(TJupiterUtilTest) {
    Y_UNIT_TEST(TJupiterUtilTest_SourceIdTest01) {

        const char *F_SOURCE_ID = "SourceId";
        const char *F_SOURCE_NAME = "SourceName";

        UNIT_ASSERT(IsSpreadUrlBannedBySourceId(NYT::TNode()
            (F_SOURCE_ID, 254u)
            (F_SOURCE_NAME, "ukrop_ersatz")
        ));

        UNIT_ASSERT(IsSpreadUrlBannedBySourceId(NYT::TNode()
            (F_SOURCE_ID, 255u)
            (F_SOURCE_NAME, "ukrop_xxxxxx")
        ));

        UNIT_ASSERT(!IsSpreadUrlBannedBySourceId(NYT::TNode()
            (F_SOURCE_ID, 255u)
            (F_SOURCE_NAME, "ukrop_ersatz")
        ));

        UNIT_ASSERT(!IsSpreadUrlBannedBySourceId(NYT::TNode()("dummy", 1)));
    }
}
