CanadianMachines / MachineTests / MachineSystemActualTest.cpp
MachineSystemActualTest.cpp
Raw
/**
 * @file MachineSystemActualTest.cpp
 * @author sriram
 */

#include "pch.h"
#include "gtest/gtest.h"

#include <miniaudio.h>
#include <MachineSystemFactory.h>
#include <MachineSystemActual.h>
#include <Component.h>
#include <Machine.h>

// Test fixture that creates an audio engine to use
class MachineSystemActualTest : public ::testing::Test {
protected:
	// The audio engine to use
	ma_engine mAudioEngine;

	void SetUp() override
	{
		auto result = ma_engine_init(NULL, &mAudioEngine);
		ASSERT_EQ(result, MA_SUCCESS);
	}

	void TearDown() override
	{
		ma_engine_uninit(&mAudioEngine);
	}

};

TEST_F(MachineSystemActualTest, Construct)
{
	MachineSystemActual machine(L".", &mAudioEngine);
}

TEST_F(MachineSystemActualTest, MachineOne)
{
	MachineSystemActual machine(L".", &mAudioEngine);

	machine.SetMachineNumber(1);

	ASSERT_NE(nullptr, machine.GetMachine());
}


TEST_F(MachineSystemActualTest, AddComponent)
{
	MachineSystemActual machine(L".", &mAudioEngine);

	machine.SetMachineNumber(1);

	auto machineOne = machine.GetMachine();

	auto component = std::make_shared<Component>(L"Shape");
	machineOne->AddComponent(component);
}