BGC Tools
Public Member Functions | Private Attributes
BGC.Tests.RandomValueTests Class Reference
Collaboration diagram for BGC.Tests.RandomValueTests:
Collaboration graph
[legend]

Public Member Functions

void RVTestMaxIndicies ()
 
void RVTestOutOfRangeIndicies ()
 
void RVTestAllButOneIndicies ()
 
void RVTestNoIndicies ()
 
void RVTestEmptyList ()
 

Private Attributes

readonly List< int > sampleList = new List<int>() { 1, 2, 3 }
 
readonly List< int > emptyList = new List<int>() { }
 

Detailed Description

Definition at line 7 of file RandomValueTests.cs.

Member Function Documentation

◆ RVTestAllButOneIndicies()

void BGC.Tests.RandomValueTests.RVTestAllButOneIndicies ( )
inline

Definition at line 33 of file RandomValueTests.cs.

34  {
35  int rv = sampleList.RandomValue<int>(0, 2);
36 
37  Assert.IsTrue(rv == 2);
38  }
readonly List< int > sampleList

◆ RVTestEmptyList()

void BGC.Tests.RandomValueTests.RVTestEmptyList ( )
inline

Definition at line 49 of file RandomValueTests.cs.

50  {
51  int rv = emptyList.RandomValue<int>();
52 
53  UnityEngine.TestTools.LogAssert.Expect(
54  UnityEngine.LogType.Error,
55  "Received list of length 0 which doesn't allow for random value, " +
56  "returning default value");
57  Assert.IsTrue(rv == default(int));
58  }
readonly List< int > emptyList

◆ RVTestMaxIndicies()

void BGC.Tests.RandomValueTests.RVTestMaxIndicies ( )
inline

Definition at line 13 of file RandomValueTests.cs.

14  {
15  int rv = sampleList.RandomValue<int>(0, 1, 2);
16 
17  UnityEngine.TestTools.LogAssert.Expect(
18  UnityEngine.LogType.Error,
19  "Recieved array of excludedIndicies that does not allow for any values to be returned, " +
20  "returning default value");
21  Assert.IsTrue(rv == default(int));
22  }
readonly List< int > sampleList

◆ RVTestNoIndicies()

void BGC.Tests.RandomValueTests.RVTestNoIndicies ( )
inline

Definition at line 41 of file RandomValueTests.cs.

42  {
43  int rv = sampleList.RandomValue<int>();
44 
45  Assert.IsTrue(rv > 0 && rv < 4);
46  }
readonly List< int > sampleList

◆ RVTestOutOfRangeIndicies()

void BGC.Tests.RandomValueTests.RVTestOutOfRangeIndicies ( )
inline

Definition at line 25 of file RandomValueTests.cs.

26  {
27  int rv = sampleList.RandomValue<int>(-2, -1, 3, 4);
28 
29  Assert.IsTrue(rv > 0 && rv < 4);
30  }
readonly List< int > sampleList

Field Documentation

◆ emptyList

readonly List<int> BGC.Tests.RandomValueTests.emptyList = new List<int>() { }
private

Definition at line 10 of file RandomValueTests.cs.

◆ sampleList

readonly List<int> BGC.Tests.RandomValueTests.sampleList = new List<int>() { 1, 2, 3 }
private

Definition at line 9 of file RandomValueTests.cs.


The documentation for this class was generated from the following file: