-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathFooBarTests.cs
More file actions
45 lines (38 loc) · 928 Bytes
/
FooBarTests.cs
File metadata and controls
45 lines (38 loc) · 928 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
41
42
43
44
45
using System;
using Xunit;
using Mizux.DotnetNative.FooBar;
namespace Mizux.DotnetNative.Tests {
public class FooBarTest {
[Theory]
[InlineData(false)]
[InlineData(true)]
public void IntegerTest(bool callGC) {
// Instantiate FooBar
FooBar.FooBar obj = new FooBar.FooBar();
if (callGC) {
GC.Collect();
}
obj.SetBarInt(3);
obj.SetFooInt(5);
Assert.Equal(8, obj.GetInt());
obj.SetBarInt(11);
obj.SetFooInt(31);
Assert.Equal(42, obj.GetInt());
}
[Theory]
[InlineData(false)]
[InlineData(true)]
public void Integer64Test(bool callGC) {
// Instantiate FooBar
FooBar.FooBar obj = new FooBar.FooBar();
if (callGC) {
GC.Collect();
}
long a = 2147483647;
long b = 2147483648;
obj.SetBarInt64(a);
obj.SetFooInt64(b);
Assert.Equal(a+b, obj.GetInt64());
}
}
}