#include <parser.h>
#include <gtest/gtest.h>

TEST(SmokeTests, ParseSuccesfullyTest)
{
    ASSERT_EQ(16, mixplus::Parser::parseNumber("0x10"));
    ASSERT_EQ(1, mixplus::Parser::parseNumber("1"));
    ASSERT_EQ(1, mixplus::Parser::parseNumber("0x1"));
}

TEST(SmokeTests, ParseFailedTest)
{
    ASSERT_ANY_THROW(mixplus::Parser::parseNumber("0x0dragonegg"));
    ASSERT_ANY_THROW(mixplus::Parser::parseNumber("ox"));
    ASSERT_ANY_THROW(mixplus::Parser::parseNumber("oxdragon"));
}

TEST(ParseAndAddTests, Test1)
{
    const char* argv[3] = {"", "1", "2"};
    ASSERT_EQ(3, mixplus::Parser::parseAndAdd(3,argv));
}

TEST(ParseAndAddTests, Test2)
{
    const char* argv[3] = {"", "0x10", "2"};
    ASSERT_EQ(18, mixplus::Parser::parseAndAdd(3,argv));
}