Skip to content

Commit ebdd23d

Browse files
committed
Merge branch 'bugfix/C#10-implicit-usings' into develop
Unfortunately, when implementing the C# 10 implicit and global using directives (c9f6b17; #93), I inadvertently introduced an ambiguous reference in the unit tests which prevents compilation, since a `[Collection()]` attribute exists in both `Xunit` and `OnTopic`. This is fixed by removing `Xunit` as a global directive. Despite the fact that this is a unit test project, the vast majority of the files are actually POCO models, many of which use the `OnTopic` attribute, and so it makes sense to manually include `Xunit` on the twenty-something files that are actual unit tests.
2 parents c9f6b17 + e03cd1a commit ebdd23d

23 files changed

Lines changed: 26 additions & 12 deletions

OnTopic.Tests/AttributeCollectionTest.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using OnTopic.Attributes;
99
using OnTopic.Collections.Specialized;
1010
using OnTopic.Tests.Entities;
11+
using Xunit;
1112

1213
namespace OnTopic.Tests {
1314

OnTopic.Tests/AttributeValueConverterTest.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
| Project Topics Library
55
\=============================================================================================================================*/
66
using OnTopic.Attributes;
7+
using Xunit;
78

89
namespace OnTopic.Tests {
910

OnTopic.Tests/ContentTypeDescriptorTest.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
| Project Topics Library
55
\=============================================================================================================================*/
66
using OnTopic.Metadata;
7+
using Xunit;
78

89
namespace OnTopic.Tests {
910

OnTopic.Tests/ContractTest.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
| Project Topics Library
55
\=============================================================================================================================*/
66

7+
using Xunit;
8+
79
namespace OnTopic.Tests {
810

911
/*============================================================================================================================

OnTopic.Tests/Fixtures/SharedRepositoryCollection.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
| Project Topics Library
55
\=============================================================================================================================*/
66
using OnTopic.TestDoubles;
7+
using Xunit;
78

89
#pragma warning disable CA1711 // Identifiers should not have incorrect suffix
910

OnTopic.Tests/Fixtures/TopicInfrastructureFixture.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
| Client Ignia, LLC
44
| Project Topics Library
55
\=============================================================================================================================*/
6-
using System.Text;
76
using OnTopic.Data.Caching;
87
using OnTopic.Lookup;
98
using OnTopic.Mapping;
109
using OnTopic.Repositories;
1110
using OnTopic.TestDoubles;
1211
using OnTopic.Tests.TestDoubles;
1312

14-
namespace OnTopic.Tests.Fixtures {
13+
namespace OnTopic.Tests.Fixtures
14+
{
1515

1616
/*============================================================================================================================
1717
| CLASS: TOPIC INFRASTRUCTURE FIXTURE

OnTopic.Tests/Fixtures/TypeAccessorFixture.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,10 @@
33
| Client Ignia, LLC
44
| Project Topics Library
55
\=============================================================================================================================*/
6-
using System.Text;
7-
using OnTopic.Data.Caching;
86
using OnTopic.Internal.Reflection;
9-
using OnTopic.Lookup;
10-
using OnTopic.Mapping;
11-
using OnTopic.Repositories;
12-
using OnTopic.TestDoubles;
13-
using OnTopic.Tests.TestDoubles;
147

15-
namespace OnTopic.Tests.Fixtures {
8+
namespace OnTopic.Tests.Fixtures
9+
{
1610

1711
/*============================================================================================================================
1812
| CLASS: TYPE ACCESSOR FIXTURE

OnTopic.Tests/HierarchicalTopicMappingServiceTest.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using OnTopic.Repositories;
99
using OnTopic.TestDoubles;
1010
using OnTopic.Tests.Fixtures;
11+
using Xunit;
1112

1213
namespace OnTopic.Tests {
1314

OnTopic.Tests/ITopicRepositoryTest.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using OnTopic.Repositories;
99
using OnTopic.TestDoubles;
1010
using OnTopic.Tests.Fixtures;
11+
using Xunit;
1112

1213
namespace OnTopic.Tests {
1314

@@ -22,7 +23,7 @@ namespace OnTopic.Tests {
2223
/// underlying <see cref="TopicRepository"/> functions are also operating correctly.
2324
/// </remarks>
2425
[ExcludeFromCodeCoverage]
25-
[Collection("Shared Repository")]
26+
[Xunit.Collection("Shared Repository")]
2627
public class ITopicRepositoryTest {
2728

2829
/*==========================================================================================================================

OnTopic.Tests/ITypeLookupServiceTest.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using OnTopic.Lookup;
77
using OnTopic.Tests.TestDoubles;
88
using OnTopic.Tests.ViewModels;
9+
using Xunit;
910

1011
namespace OnTopic.Tests {
1112

0 commit comments

Comments
 (0)