forked from AlejandroSherman/CS100Lab4Composite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rand_test.hpp
41 lines (31 loc) · 778 Bytes
/
rand_test.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef __RAND__TEST_HPP__
#define __RAND__TEST_HPP__
#include "gtest/gtest.h"
#include "base.hpp"
#include "rand.hpp"
#include <string>
#include <stdlib.h>
TEST(RandTest, RandEvalutateLT101){
Rand* test = new Rand();
EXPECT_LT(test->evaluate(), 101);
}
TEST(RandTest, RandEvaluateGTNegOne){
Rand* test = new Rand();
EXPECT_GT(test->evaluate(), -1);
}
TEST(RandTest, RandStringNot101){
Rand* test = new Rand();
std::string result = "101";
EXPECT_NE(test->stringify(), result);
}
TEST(RandTest, RandEvauateValEightyThree){
srand(1);
Rand* test = new Rand();
EXPECT_EQ(test->evaluate(), 83);
}
TEST(RandTest, RandStringValEightyThree){
srand(1);
Rand* test = new Rand();
EXPECT_EQ(test->stringify(), "83");
}
#endif