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

#include "task_crawler.h"

Y_UNIT_TEST_SUITE(TCrawlerTest1) {
    Y_UNIT_TEST(WeekConfigTest) {
        using namespace NWebmaster;

        TWeekTableConfig config1(1487451600);
        TWeekTableConfig config2(1487451600 - 1);
        TWeekTableConfig config3(1488056399);
        TWeekTableConfig config4(1488056399 + 1);

        UNIT_ASSERT_EQUAL(config1.WeekName(), "20170219_20170225");
        UNIT_ASSERT_EQUAL(config2.WeekName(), "20170212_20170218");
        UNIT_ASSERT_EQUAL(config3.WeekName(), "20170219_20170225");
        UNIT_ASSERT_EQUAL(config4.WeekName(), "20170226_20170304");
    }
}
