Example #1
0
        public void CreateDataset()
        {
            Assert.Throws <ArgumentNullException>(() => manager.CreateDataset(null, CancellationToken.None));
            var arff = manager.CreateDataset(set, CancellationToken.None);

            Assert.IsNull(arff);

            set.Document = new[]
            {
                new DocumentDefinition
                {
                    Labels = new [] { "One", "Two" }
                }
            };

            set.Document[0].WordsTable["Test1"] = 1;
            set.Document[0].WordsTable["Test2"] = 2;
            arff = manager.CreateDataset(set, CancellationToken.None);
            Assert.AreEqual(1, arff.TotalDocuments);
            Assert.AreEqual("Two", arff.Documents.First().Class.Value);
            Assert.AreEqual(3, arff.Header.Total);
        }