Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/AI_Brain / tests/test_knowledge_pipeline.cs |
| Date | Not specified in source |
| Repository | Janady13/AI_Brain |
| Revision | 6d0767aad08781eb5c4e1eb14a42ec92c437be78 |
| Branch | copilot/convert-python-files-to-csharp |
| Path or archive member | tests/test_knowledge_pipeline.cs |
| Original SHA-256 | 976152503ab8b39f81dd44bb4adffdb9e89817b8bd6735bf4006a5f30ee471d2 |
| Git blob SHA | a734fddd023f99e1ceec0d9805e906f9d37b4cd2 |
| Reading-copy SHA-256 | 976152503ab8b39f81dd44bb4adffdb9e89817b8bd6735bf4006a5f30ee471d2 |
Recovered source transcript
Download complete source text ↓71 lines · 1.7 KB
// Tests for knowledge pipeline
using System;
using AIBrain.Services;
using Xunit;
namespace AIBrain.Tests
{
public class TestKnowledgePipeline
{
[Fact]
public void TestAddFact()
{
var pipeline = new KnowledgePipeline();
pipeline.AddFact("Test fact");
Assert.Equal(1, pipeline.Count);
}
[Fact]
public void TestGetFacts()
{
var pipeline = new KnowledgePipeline();
pipeline.AddFact("Fact 1");
pipeline.AddFact("Fact 2");
var facts = pipeline.GetFacts();
Assert.Equal(2, facts.Count);
Assert.Contains("Fact 1", facts);
Assert.Contains("Fact 2", facts);
}
[Fact]
public void TestSearchFacts()
{
var pipeline = new KnowledgePipeline();
pipeline.AddFact("Machine learning is powerful");
pipeline.AddFact("Deep learning uses neural networks");
pipeline.AddFact("Python is great for ML");
var results = pipeline.SearchFacts("learning");
Assert.Equal(2, results.Count);
}
[Fact]
public void TestClearFacts()
{
var pipeline = new KnowledgePipeline();
pipeline.AddFact("Test");
pipeline.ClearFacts();
Assert.Equal(0, pipeline.Count);
}
[Fact]
public void TestGetStatistics()
{
var pipeline = new KnowledgePipeline();
pipeline.AddFact("Fact 1");
pipeline.AddFact("Fact 2");
var stats = pipeline.GetStatistics();
Assert.Equal(2, stats["total_facts"]);
Assert.Equal(2, stats["unique_facts"]);
}
}
}