-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bugfix: GetReminder throws exception when reminder don't exists #1167
- Loading branch information
1 parent
d1fb614
commit a8a7508
Showing
8 changed files
with
101 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using Orleans; | ||
using System.Threading.Tasks; | ||
|
||
namespace UnitTests.GrainInterfaces | ||
{ | ||
public interface IReminderTestGrain : IGrainWithIntegerKey | ||
{ | ||
Task<bool> IsReminderExists(string reminderName); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using Orleans; | ||
using System.Threading.Tasks; | ||
using UnitTests.GrainInterfaces; | ||
|
||
namespace UnitTests.Grains | ||
{ | ||
internal class ReminderTestGrain : Grain, IReminderTestGrain | ||
{ | ||
public async Task<bool> IsReminderExists(string reminderName) | ||
{ | ||
var reminder = await this.GetReminder(reminderName); | ||
return reminder != null; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using Orleans.TestingHost; | ||
using System.Threading.Tasks; | ||
using UnitTests.GrainInterfaces; | ||
using UnitTests.Tester; | ||
|
||
namespace Tester | ||
{ | ||
[TestClass] | ||
public class ReminderTest : UnitTestSiloHost | ||
{ | ||
public ReminderTest() | ||
: base(new TestingSiloOptions { StartPrimary = true, StartSecondary = false }) | ||
{ | ||
} | ||
|
||
[ClassCleanup] | ||
public static void MyClassCleanup() | ||
{ | ||
StopAllSilos(); | ||
} | ||
|
||
[TestMethod, TestCategory("BVT"), TestCategory("Functional"), TestCategory("Reminders")] | ||
public async Task SimpleGrainGetGrain() | ||
{ | ||
IReminderTestGrain grain = GrainFactory.GetGrain<IReminderTestGrain>(0); | ||
bool notExists = await grain.IsReminderExists("not exists"); | ||
Assert.IsFalse(notExists); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters