Skip to content

Commit cff8e19

Browse files
committed
debug info
1 parent eddc9b2 commit cff8e19

File tree

7 files changed

+33
-4
lines changed

7 files changed

+33
-4
lines changed

ManagedCode.Orleans.Graph.Tests/GrainGraphManagerTests.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using ManagedCode.Orleans.Graph.Interfaces;
12
using ManagedCode.Orleans.Graph.Models;
23
using ManagedCode.Orleans.Graph.Tests.Cluster.Grains.Interfaces;
34
using Xunit;
@@ -81,7 +82,7 @@ public void IsTransitionAllowed_MethodRuleAllowed_ReturnsTrue()
8182
var graph = GrainCallsBuilder.Create()
8283
.From<IGrainA>()
8384
.To<IGrainB>()
84-
.Method(a => a.MethodA1(0), b => b.MethodB1(0))
85+
.Method(a => a.MethodA1(GraphParam.Any<int>()), b => b.MethodB1(GraphParam.Any<int>()))
8586
.And()
8687
.Build();
8788

@@ -152,7 +153,7 @@ public void IsTransitionAllowed_InvalidMethodRule_ReturnsFalse()
152153
var graph = GrainCallsBuilder.Create()
153154
.From<IGrainA>()
154155
.To<IGrainB>()
155-
.Method(a => a.MethodA1(0), b => b.MethodB1(0))
156+
.Method(a => a.MethodA1(GraphParam.Any<int>()), b => b.MethodB1(GraphParam.Any<int>()))
156157
.And()
157158
.Build();
158159

ManagedCode.Orleans.Graph.Tests/GraphTests.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@ public GraphTests(TestClusterApplication testApp, ITestOutputHelper outputHelper
1616
_testApp = testApp;
1717
_outputHelper = outputHelper;
1818
}
19+
20+
[Fact]
21+
public async Task GrainA_A1Test()
22+
{
23+
await _testApp.Cluster
24+
.Client
25+
.GetGrain<IGrainA>("1")
26+
.MethodA1(1);
27+
}
1928

2029
[Fact]
2130
public async Task GrainA_B1Test()
@@ -27,7 +36,7 @@ await _testApp.Cluster
2736
}
2837

2938
[Fact]
30-
public async Task GrainATest()
39+
public async Task GrainACallsTest()
3140
{
3241
await _testApp.Cluster
3342
.Client

ManagedCode.Orleans.Graph/Common/GrainGraphSourceGenerator.cs renamed to ManagedCode.Orleans.Graph/Common/GrainCallsBuilderSourceGenerator.cs

File renamed without changes.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
namespace ManagedCode.Orleans.Graph.Interfaces;
2+
3+
public static class GraphParam
4+
{
5+
public static T Any<T>()
6+
{
7+
return default(T)!;
8+
}
9+
10+
// public static dynamic Any()
11+
// {
12+
// return default;
13+
// }
14+
}

ManagedCode.Orleans.Graph/GrainGraphManager.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ public bool IsTransitionAllowed(CallHistory callHistory)
1818
{
1919
if (callHistory.IsEmpty())
2020
return false;
21-
//TODO: check this code
21+
22+
//TODO: check this code
2223
var calls = callHistory.History.Reverse().ToArray();
2324

2425
for (var i = 0; i < calls.Length - 1; i++)

ManagedCode.Orleans.Graph/Models/Call.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
using System.Diagnostics;
12
using Orleans;
23

34
namespace ManagedCode.Orleans.Graph.Models;
45

56
[Immutable]
67
[GenerateSerializer]
78
[Alias("MC.Call")]
9+
[DebuggerDisplay("{ToString()}")]
810
public class Call(Direction direction, string type, string method)
911
{
1012
[Id(0)]

ManagedCode.Orleans.Graph/Models/CallHistory.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.Diagnostics;
34
using System.Linq;
45
using Orleans;
56

@@ -8,6 +9,7 @@ namespace ManagedCode.Orleans.Graph.Models;
89
[Immutable]
910
[GenerateSerializer]
1011
[Alias("MC.CallHistory")]
12+
[DebuggerDisplay("{ToString()}")]
1113
public class CallHistory
1214
{
1315
[Id(0)] public Guid Id = Guid.NewGuid();

0 commit comments

Comments
 (0)