-
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathRandomDataTests.cs
More file actions
40 lines (30 loc) · 832 Bytes
/
Copy pathRandomDataTests.cs
File metadata and controls
40 lines (30 loc) · 832 Bytes
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
using Xunit;
namespace Exceptionless.Tests;
public class RandomDataTests {
[Fact]
public void RandomInt() {
int value = RandomData.GetInt(1, 5);
Assert.InRange(value, 1, 5);
value = _numbers.Random();
Assert.InRange(value, 1, 3);
}
[Fact]
public void RandomDecimal() {
decimal value = RandomData.GetDecimal(1, 5);
Assert.InRange(value, 1, 5);
}
[Fact]
public void GetEnumWithOneValueTest() {
var result = RandomData.GetEnum<Days>();
Assert.Equal(Days.Monday, result);
}
[Fact]
public void GetSentencesTest() {
string result = RandomData.GetSentence();
Assert.False(String.IsNullOrEmpty(result));
}
private readonly int[] _numbers = [1, 2, 3];
private enum Days {
Monday
}
}