Skip to content

Commit

Permalink
Fix nulls
Browse files Browse the repository at this point in the history
  • Loading branch information
svegiraju-microsoft committed Dec 20, 2024
1 parent eee52e0 commit fc40254
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
12 changes: 12 additions & 0 deletions examples/AI/ConversationalAI/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"profiles": {
"ConversationalAI": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "https://localhost:62602;http://localhost:62603"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"profiles": {
"StreamingSubscriptionExample": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "https://localhost:62604;http://localhost:62605"
}
}
}
10 changes: 7 additions & 3 deletions test/Dapr.Workflow.Test/WorkflowActivityTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ namespace Dapr.Workflow.Test
using Moq;
using System.Threading.Tasks;
using Xunit;
using Xunit.Sdk;

/// <summary>
/// Contains tests for WorkflowActivityContext.
Expand All @@ -26,15 +27,18 @@ public class WorkflowActivityTest

private Mock<WorkflowActivityContext> workflowActivityContextMock;

[Fact]
public async Task RunAsync_ShouldReturnCorrectContextInstanceId()
public WorkflowActivityTest()
{
this.workflowActivity = new TestDaprWorkflowActivity();
this.workflowActivityContextMock = new Mock<WorkflowActivityContext>();
}

[Fact]
public async Task RunAsync_ShouldReturnCorrectContextInstanceId()
{
this.workflowActivityContextMock.Setup((x) => x.InstanceId).Returns("instanceId");

string result = (string) await this.workflowActivity.RunAsync(this.workflowActivityContextMock.Object, "input");
string result = (string) (await this.workflowActivity.RunAsync(this.workflowActivityContextMock.Object, "input"))!;

Assert.Equal("instanceId", result);
}
Expand Down

0 comments on commit fc40254

Please sign in to comment.