Skip to content

Commit 564ead1

Browse files
committed
Added test case for #62
1 parent 7ad3b31 commit 564ead1

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Source/Tests/Plugins/PluginTests.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Linq;
3+
using System.Threading.Tasks;
34
using Exceptionless.Dependency;
45
using Exceptionless.Plugins;
56
using Exceptionless.Plugins.Default;
@@ -52,6 +53,20 @@ public void EnvironmentInfo_IncorrectEventType(string eventType) {
5253
Assert.Equal(0, context.Event.Data.Count);
5354
}
5455

56+
[Fact]
57+
public void EnvironmentInfo_CanRunInParallel() {
58+
var client = new ExceptionlessClient();
59+
var ev = new Event { Type = Event.KnownTypes.SessionStart };
60+
var plugin = new EnvironmentInfoPlugin();
61+
62+
Parallel.For(0, 10000, i => {
63+
var context = new EventPluginContext(client, ev);
64+
plugin.Run(context);
65+
Assert.Equal(1, context.Event.Data.Count);
66+
Assert.NotNull(context.Event.Data[Event.KnownDataKeys.EnvironmentInfo]);
67+
});
68+
}
69+
5570
[Fact]
5671
public void EnvironmentInfo_ShouldAddSessionStart() {
5772
var client = new ExceptionlessClient();

0 commit comments

Comments
 (0)