-
Notifications
You must be signed in to change notification settings - Fork 508
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update tests for IImportScopeWrapper to run in all test projects
- Loading branch information
1 parent
a7f11d5
commit 972a866
Showing
7 changed files
with
79 additions
and
20 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
...nalyzers/StyleCop.Analyzers.Test.CSharp10/Lightup/IImportScopeWrapperCSharp10UnitTests.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,11 @@ | ||
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved. | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
||
namespace StyleCop.Analyzers.Test.CSharp10.Lightup | ||
{ | ||
using StyleCop.Analyzers.Test.CSharp9.Lightup; | ||
|
||
public partial class IImportScopeWrapperCSharp10UnitTests : IImportScopeWrapperCSharp9UnitTests | ||
{ | ||
} | ||
} |
22 changes: 3 additions & 19 deletions
22
...nalyzers/StyleCop.Analyzers.Test.CSharp11/Lightup/IImportScopeWrapperCSharp11UnitTests.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
4 changes: 3 additions & 1 deletion
4
...nalyzers/StyleCop.Analyzers.Test.CSharp12/Lightup/IImportScopeWrapperCSharp12UnitTests.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
11 changes: 11 additions & 0 deletions
11
....Analyzers/StyleCop.Analyzers.Test.CSharp7/Lightup/IImportScopeWrapperCSharp7UnitTests.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,11 @@ | ||
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved. | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
||
namespace StyleCop.Analyzers.Test.CSharp7.Lightup | ||
{ | ||
using StyleCop.Analyzers.Test.Lightup; | ||
|
||
public partial class IImportScopeWrapperCSharp7UnitTests : IImportScopeWrapperUnitTests | ||
{ | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
....Analyzers/StyleCop.Analyzers.Test.CSharp8/Lightup/IImportScopeWrapperCSharp8UnitTests.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,11 @@ | ||
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved. | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
||
namespace StyleCop.Analyzers.Test.CSharp8.Lightup | ||
{ | ||
using StyleCop.Analyzers.Test.CSharp7.Lightup; | ||
|
||
public partial class IImportScopeWrapperCSharp8UnitTests : IImportScopeWrapperCSharp7UnitTests | ||
{ | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
....Analyzers/StyleCop.Analyzers.Test.CSharp9/Lightup/IImportScopeWrapperCSharp9UnitTests.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,11 @@ | ||
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved. | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
||
namespace StyleCop.Analyzers.Test.CSharp9.Lightup | ||
{ | ||
using StyleCop.Analyzers.Test.CSharp8.Lightup; | ||
|
||
public partial class IImportScopeWrapperCSharp9UnitTests : IImportScopeWrapperCSharp8UnitTests | ||
{ | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
StyleCop.Analyzers/StyleCop.Analyzers.Test/Lightup/IImportScopeWrapperUnitTests.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,29 @@ | ||
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved. | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
||
namespace StyleCop.Analyzers.Test.Lightup | ||
{ | ||
using System; | ||
using StyleCop.Analyzers.Lightup; | ||
using Xunit; | ||
|
||
public class IImportScopeWrapperUnitTests | ||
{ | ||
[Fact] | ||
public void TestNull() | ||
{ | ||
object? obj = null; | ||
Assert.False(IImportScopeWrapper.IsInstance(obj!)); | ||
var wrapper = IImportScopeWrapper.FromObject(obj!); | ||
Assert.Throws<NullReferenceException>(() => wrapper.Aliases); | ||
} | ||
|
||
[Fact] | ||
public void TestIncompatibleInstance() | ||
{ | ||
var obj = new object(); | ||
Assert.False(IImportScopeWrapper.IsInstance(obj)); | ||
Assert.Throws<InvalidCastException>(() => IImportScopeWrapper.FromObject(obj)); | ||
} | ||
} | ||
} |