-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor MassTransitHelpers and tests to extensions project
- Loading branch information
1 parent
feb0bce
commit dabf9a6
Showing
9 changed files
with
117 additions
and
163 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
50 changes: 0 additions & 50 deletions
50
src/Agent/NewRelic/Agent/Extensions/Providers/Wrapper/MassTransit/MassTransitHelpers.cs
This file was deleted.
Oops, something went wrong.
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
53 changes: 0 additions & 53 deletions
53
tests/Agent/UnitTests/Core.UnitTest/Instrumentation/MassTransit.cs
This file was deleted.
Oops, something went wrong.
44 changes: 44 additions & 0 deletions
44
tests/Agent/UnitTests/NewRelic.Agent.Extensions.Tests/Helpers/MassTransitHelperTests.cs
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,44 @@ | ||
// Copyright 2020 New Relic, Inc. All rights reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
using System; | ||
using NUnit.Framework; | ||
using NewRelic.Agent.Extensions.Providers.Wrapper; | ||
using NewRelic.Agent.Extensions.Helpers; | ||
|
||
namespace Agent.Extensions.Tests.Helpers | ||
{ | ||
[TestFixture] | ||
public class MassTransitHelperTests | ||
{ | ||
|
||
[Test] | ||
[TestCase("rabbitmq://localhost/SomeHostname_MassTransitTest_bus_myqueuename?temporary=true", "myqueuename")] | ||
[TestCase("rabbitmq://localhost/SomeHostname_MassTransitTest_bus_myqueuename", "myqueuename")] | ||
[TestCase("rabbitmq://localhost/bogus", "Unknown")] | ||
[TestCase(null, "Unknown")] | ||
public void GetQueueName(Uri uri, string expectedQueueName) | ||
{ | ||
// Act | ||
var queueName = MassTransitHelpers.GetQueueData(uri).QueueName; | ||
|
||
// Assert | ||
Assert.AreEqual(expectedQueueName, queueName, "Did not get expected queue name"); | ||
} | ||
|
||
[Test] | ||
[TestCase("rabbitmq://localhost/NRHXPSQL3_MassTransitTest_bus_myqueuename?temporary=true", MessageBrokerDestinationType.TempQueue)] | ||
[TestCase("rabbitmq://localhost/NRHXPSQL3_MassTransitTest_bus_myqueuename?temporary=false", MessageBrokerDestinationType.Queue)] | ||
[TestCase("rabbitmq://localhost/NRHXPSQL3_MassTransitTest_bus_myqueuename", MessageBrokerDestinationType.Queue)] | ||
[TestCase(null, MessageBrokerDestinationType.Queue)] | ||
public void GetBrokerDestinationType(Uri uri, MessageBrokerDestinationType expectedDestType) | ||
{ | ||
// Act | ||
var destType = MassTransitHelpers.GetQueueData(uri).DestinationType; | ||
|
||
// Assert | ||
Assert.AreEqual(expectedDestType, destType, "Did not get expected queue type"); | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.