diff --git a/StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp10/Lightup/IImportScopeWrapperCSharp10UnitTests.cs b/StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp10/Lightup/IImportScopeWrapperCSharp10UnitTests.cs new file mode 100644 index 000000000..cfefc9fa5 --- /dev/null +++ b/StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp10/Lightup/IImportScopeWrapperCSharp10UnitTests.cs @@ -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 + { + } +} diff --git a/StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp11/Lightup/IImportScopeWrapperCSharp11UnitTests.cs b/StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp11/Lightup/IImportScopeWrapperCSharp11UnitTests.cs index 68ae4de6e..1980e143e 100644 --- a/StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp11/Lightup/IImportScopeWrapperCSharp11UnitTests.cs +++ b/StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp11/Lightup/IImportScopeWrapperCSharp11UnitTests.cs @@ -1,33 +1,17 @@ // 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 +namespace StyleCop.Analyzers.Test.CSharp11.Lightup { using System; using System.Collections.Immutable; using Microsoft.CodeAnalysis; using StyleCop.Analyzers.Lightup; + using StyleCop.Analyzers.Test.CSharp10.Lightup; using Xunit; - public class IImportScopeWrapperCSharp11UnitTests + public partial class IImportScopeWrapperCSharp11UnitTests : IImportScopeWrapperCSharp10UnitTests { - [Fact] - public void TestNull() - { - object? obj = null; - Assert.False(IImportScopeWrapper.IsInstance(obj!)); - var wrapper = IImportScopeWrapper.FromObject(obj!); - Assert.Throws(() => wrapper.Aliases); - } - - [Fact] - public void TestIncompatibleInstance() - { - var obj = new object(); - Assert.False(IImportScopeWrapper.IsInstance(obj)); - Assert.Throws(() => IImportScopeWrapper.FromObject(obj)); - } - [Fact] public void TestCompatibleInstance() { diff --git a/StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp12/Lightup/IImportScopeWrapperCSharp12UnitTests.cs b/StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp12/Lightup/IImportScopeWrapperCSharp12UnitTests.cs index 5cae05686..1efc9b3a7 100644 --- a/StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp12/Lightup/IImportScopeWrapperCSharp12UnitTests.cs +++ b/StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp12/Lightup/IImportScopeWrapperCSharp12UnitTests.cs @@ -1,8 +1,10 @@ // 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 +namespace StyleCop.Analyzers.Test.CSharp12.Lightup { + using StyleCop.Analyzers.Test.CSharp11.Lightup; + public partial class IImportScopeWrapperCSharp12UnitTests : IImportScopeWrapperCSharp11UnitTests { } diff --git a/StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp7/Lightup/IImportScopeWrapperCSharp7UnitTests.cs b/StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp7/Lightup/IImportScopeWrapperCSharp7UnitTests.cs new file mode 100644 index 000000000..8f55c55c3 --- /dev/null +++ b/StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp7/Lightup/IImportScopeWrapperCSharp7UnitTests.cs @@ -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 + { + } +} diff --git a/StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp8/Lightup/IImportScopeWrapperCSharp8UnitTests.cs b/StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp8/Lightup/IImportScopeWrapperCSharp8UnitTests.cs new file mode 100644 index 000000000..2ea970a41 --- /dev/null +++ b/StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp8/Lightup/IImportScopeWrapperCSharp8UnitTests.cs @@ -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 + { + } +} diff --git a/StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp9/Lightup/IImportScopeWrapperCSharp9UnitTests.cs b/StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp9/Lightup/IImportScopeWrapperCSharp9UnitTests.cs new file mode 100644 index 000000000..f0134039d --- /dev/null +++ b/StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp9/Lightup/IImportScopeWrapperCSharp9UnitTests.cs @@ -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 + { + } +} diff --git a/StyleCop.Analyzers/StyleCop.Analyzers.Test/Lightup/IImportScopeWrapperUnitTests.cs b/StyleCop.Analyzers/StyleCop.Analyzers.Test/Lightup/IImportScopeWrapperUnitTests.cs new file mode 100644 index 000000000..63fb22a06 --- /dev/null +++ b/StyleCop.Analyzers/StyleCop.Analyzers.Test/Lightup/IImportScopeWrapperUnitTests.cs @@ -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(() => wrapper.Aliases); + } + + [Fact] + public void TestIncompatibleInstance() + { + var obj = new object(); + Assert.False(IImportScopeWrapper.IsInstance(obj)); + Assert.Throws(() => IImportScopeWrapper.FromObject(obj)); + } + } +}