-
Notifications
You must be signed in to change notification settings - Fork 16
/
FooTests.cs
42 lines (35 loc) · 810 Bytes
/
FooTests.cs
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
using System;
using Xunit;
using Mizux.DotnetNative.Foo;
namespace Mizux.DotnetNative.Tests {
public class FooTest {
[Theory]
[InlineData(false)]
[InlineData(true)]
public void IntegerTest(bool callGC) {
// Instantiate Foo
Foo.Foo obj = new Foo.Foo();
if (callGC) {
GC.Collect();
}
obj.SetInt(42);
Assert.Equal(42, obj.GetInt());
}
[Theory]
[InlineData(false)]
[InlineData(true)]
public void Integer64Test(bool callGC) {
// Instantiate Foo
Foo.Foo obj = new Foo.Foo();
if (callGC) {
GC.Collect();
}
long a = 2147483647;
obj.SetInt64(a);
Assert.Equal(a, obj.GetInt64());
long b = 2147483648;
obj.SetInt64(b);
Assert.Equal(b, obj.GetInt64());
}
}
}