52 lines
1.2 KiB
C++
52 lines
1.2 KiB
C++
#include "test_harness.h"
|
|
#include "../src/provisioning.h"
|
|
|
|
using radiantwave::provisioning::firstMissingStep;
|
|
using radiantwave::provisioning::indicatesFirstRun;
|
|
using radiantwave::provisioning::Step;
|
|
|
|
TEST(first_missing_step_all_satisfied)
|
|
{
|
|
ASSERT_EQ(firstMissingStep(true, true, true), Step::Done);
|
|
}
|
|
|
|
TEST(first_missing_step_no_internet)
|
|
{
|
|
// Internet is checked before email/license regardless of the others.
|
|
ASSERT_EQ(firstMissingStep(false, false, false), Step::Internet);
|
|
ASSERT_EQ(firstMissingStep(false, true, true), Step::Internet);
|
|
}
|
|
|
|
TEST(first_missing_step_no_email)
|
|
{
|
|
ASSERT_EQ(firstMissingStep(true, false, false), Step::Email);
|
|
ASSERT_EQ(firstMissingStep(true, false, true), Step::Email);
|
|
}
|
|
|
|
TEST(first_missing_step_no_license)
|
|
{
|
|
ASSERT_EQ(firstMissingStep(true, true, false), Step::License);
|
|
}
|
|
|
|
TEST(first_run_all_missing)
|
|
{
|
|
ASSERT_TRUE(indicatesFirstRun(false, false, false));
|
|
}
|
|
|
|
TEST(first_run_has_internet)
|
|
{
|
|
ASSERT_FALSE(indicatesFirstRun(true, false, false));
|
|
}
|
|
|
|
TEST(first_run_has_email)
|
|
{
|
|
ASSERT_FALSE(indicatesFirstRun(false, true, false));
|
|
}
|
|
|
|
TEST(first_run_has_license)
|
|
{
|
|
ASSERT_FALSE(indicatesFirstRun(false, false, true));
|
|
}
|
|
|
|
RUN_ALL_TESTS()
|