From 070ce923574dcc57435cb3fb2dfe86b6a38cd249 Mon Sep 17 00:00:00 2001 From: MDBijman Date: Tue, 24 Jan 2017 12:15:26 +0100 Subject: Initial code commit with organized dependencies --- .../include/simulation/workloads/WorkloadTest.h | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Testing/include/simulation/workloads/WorkloadTest.h (limited to 'Testing/include/simulation/workloads/WorkloadTest.h') diff --git a/Testing/include/simulation/workloads/WorkloadTest.h b/Testing/include/simulation/workloads/WorkloadTest.h new file mode 100644 index 00000000..e0da2138 --- /dev/null +++ b/Testing/include/simulation/workloads/WorkloadTest.h @@ -0,0 +1,34 @@ +#pragma once +#include "simulation\workloads\Workload.h" + +#include + +TEST(WorkloadTest, Constructor) +{ + Simulation::Workload w(100, 0, 5, 3, 0); + ASSERT_EQ(false, w.isFinished()); + ASSERT_EQ(5, w.getId()); + ASSERT_EQ(100, w.getRemainingOperations()); + ASSERT_EQ(100, w.getTotalOperations()); +} + +TEST(WorkloadTest, DoOperations) +{ + Simulation::Workload w(100, 0, 5, 3, 0); + w.doOperations(10); + ASSERT_EQ(90, w.getRemainingOperations()); +} + +TEST(WorkloadTest, GetTotalOperations) +{ + Simulation::Workload w(100, 0, 5, 3, 0); + w.doOperations(10); + ASSERT_EQ(100, w.getTotalOperations()); +} + +TEST(WorkloadTest, IsFinished) +{ + Simulation::Workload w(10, 0, 5, 3, 0); + w.doOperations(10); + ASSERT_EQ(true, w.isFinished()); +} -- cgit v1.2.3