-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDataVectorTests.cs
43 lines (37 loc) · 1.28 KB
/
DataVectorTests.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
43
using System;
using Xunit;
using RLDT;
using System.Linq;
namespace RLDT.Tests
{
public class DataVectorTests
{
[Fact]
public void Constructor_With2Inputs_2()
{
string[] featureNames = new string[] {"name1", "name2" };
object[] featureValues = new object[] { 0.0, 5.0 };
DataVector dv = new DataVector(featureNames, featureValues);
Assert.Equal(2, dv.Features.Count);
Assert.Contains("name1", dv.Features.Select(p => p.Name));
Assert.Contains("name2", dv.Features.Select(p => p.Name));
}
[Fact]
public void Indexer_validName_FeatureValuePair()
{
string[] featureNames = new string[] { "name1", "name2" };
object[] featureValues = new object[] { 0.0, 5.0 };
DataVector dv = new DataVector(featureNames, featureValues);
Assert.NotNull(dv);
}
[Fact]
public void Indexer_invalidName_null()
{
string[] featureNames = new string[] { "name1", "name2" };
object[] featureValues = new object[] { 0.0, 5.0 };
DataVector dv = new DataVector(featureNames, featureValues);
var result = dv["name3"];
Assert.Null(result);
}
}
}