mirror of
https://github.com/microsoft/autogen.git
synced 2026-01-08 05:01:59 +00:00
* #2708 add Add a judgment to the graph constructor * #2708 add Add a judgment to the graph constructor & added unit test * #2708 #2079 move GraphTests to AutoGen.Tests; delete AutoGen.Core.Tests project
This commit is contained in:
parent
5e744f7fe4
commit
08726421fc
@ -1,4 +1,4 @@
|
||||
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.8.34322.80
|
||||
@ -206,4 +206,4 @@ Global
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {93384647-528D-46C8-922C-8DB36A382F0B}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
EndGlobal
|
||||
@ -12,9 +12,16 @@ public class Graph
|
||||
{
|
||||
private readonly List<Transition> transitions = new List<Transition>();
|
||||
|
||||
public Graph(IEnumerable<Transition> transitions)
|
||||
public Graph()
|
||||
{
|
||||
this.transitions.AddRange(transitions);
|
||||
}
|
||||
|
||||
public Graph(IEnumerable<Transition>? transitions)
|
||||
{
|
||||
if (transitions != null)
|
||||
{
|
||||
this.transitions.AddRange(transitions);
|
||||
}
|
||||
}
|
||||
|
||||
public void AddTransition(Transition transition)
|
||||
|
||||
18
dotnet/test/AutoGen.Tests/GroupChat/GraphTests.cs
Normal file
18
dotnet/test/AutoGen.Tests/GroupChat/GraphTests.cs
Normal file
@ -0,0 +1,18 @@
|
||||
|
||||
using Xunit;
|
||||
|
||||
namespace AutoGen.Tests
|
||||
{
|
||||
public class GraphTests
|
||||
{
|
||||
[Fact]
|
||||
public void GraphTest()
|
||||
{
|
||||
var graph1 = new Graph();
|
||||
Assert.NotNull(graph1);
|
||||
|
||||
var graph2 = new Graph(null);
|
||||
Assert.NotNull(graph2);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user