Skip to content

Commit

Permalink
Update to C#12
Browse files Browse the repository at this point in the history
  • Loading branch information
Socolin committed Jul 27, 2024
1 parent daa6020 commit f8d865f
Show file tree
Hide file tree
Showing 15 changed files with 709 additions and 738 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,16 @@

[assembly: Apartment(ApartmentState.STA)]

namespace ReSharperPlugin.NSubstituteComplete.Tests
{
[ZoneDefinition]
public interface INSubstituteCompleteTestZone : ITestsEnvZone, IRequire<PsiFeatureTestZone>;
namespace ReSharperPlugin.NSubstituteComplete.Tests;

[ZoneActivator]
public class PsiFeatureTestZoneActivator : IActivate<PsiFeatureTestZone>
{
public bool ActivatorEnabled() => true;
}
[ZoneDefinition]
public interface INSubstituteCompleteTestZone : ITestsEnvZone, IRequire<PsiFeatureTestZone>;

[SetUpFixture]
public class TestEnvironment : ExtensionTestEnvironmentAssembly<INSubstituteCompleteTestZone>;
[ZoneActivator]
public class PsiFeatureTestZoneActivator : IActivate<PsiFeatureTestZone>
{
public bool ActivatorEnabled() => true;
}

[SetUpFixture]
public class TestEnvironment : ExtensionTestEnvironmentAssembly<INSubstituteCompleteTestZone>;
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,30 @@
using ReSharperPlugin.NSubstituteComplete.Options;
using ReSharperPlugin.NSubstituteComplete.QuickFixes;

namespace ReSharperPlugin.NSubstituteComplete.Tests.CSharp.QuickFixes
namespace ReSharperPlugin.NSubstituteComplete.Tests.CSharp.QuickFixes;

[TestPackages("NSubstitute/4.2.2")]
[TestNetFramework46]
[TestCSharpNamingPredefinedRules(NamedElementKinds.PrivateInstanceFields, "_", NamingStyleKinds.aaBb, "")]
public class FillMissingConstructorArgumentsWithMockTests : CSharpQuickFixTestBase<FillMissingConstructorArgumentsWithMock>
{
[TestPackages("NSubstitute/4.2.2")]
[TestNetFramework46]
[TestCSharpNamingPredefinedRules(NamedElementKinds.PrivateInstanceFields, "_", NamingStyleKinds.aaBb, "")]
public class FillMissingConstructorArgumentsWithMockTests : CSharpQuickFixTestBase<FillMissingConstructorArgumentsWithMock>
{
protected override string RelativeTestDataPath => @"CSharp\QuickFixes\FillMissingConstructorArgumentsWithMock";
protected override string RelativeTestDataPath => @"CSharp\QuickFixes\FillMissingConstructorArgumentsWithMock";

[Test] public void FillFromEmpty_Simple01() { DoNamedTest(); }
[Test] public void FillFromEmpty_Simple02() { DoNamedTest(); }
[Test] public void FillLastArg_AddAfterLastMock() { DoNamedTest(); }
[TestSetting(typeof(NSubstituteCompleteSettings), nameof(NSubstituteCompleteSettings.MockAliases), "IDep3<T>=FakeDep3;IDep4=FakeDep4;IDep5=FakeDep5<T>;IDep6<TKey,TValue>=FakeDep6<TKey,TValue>;IDep7=FakeDep7;IDep9<IDep1>=FakeDep91;IDep9<IDep2>=FakeDep92")]
[Test] public void FillLastArg_ComplexAliases() { DoNamedTest(); }
[TestSetting(typeof(NSubstituteCompleteSettings), nameof(NSubstituteCompleteSettings.MockAliases), "IDep<T>=FakeDep")]
[Test] public void MockAlias01() { DoNamedTest(); }
[TestSetting(typeof(NSubstituteCompleteSettings), nameof(NSubstituteCompleteSettings.MockAliases), "IDep=FakeDep")]
[Test] public void MockAlias02() { DoNamedTest(); }
[TestSetting(typeof(NSubstituteCompleteSettings), nameof(NSubstituteCompleteSettings.MockAliases), "IDep=FakeDep<T>")]
[Test] public void MockAlias03() { DoNamedTest(); }
[TestSetting(typeof(NSubstituteCompleteSettings), nameof(NSubstituteCompleteSettings.MockAliases), "IDep<TKey, TValue>=FakeDep<TKey, TValue>")]
[Test] public void MockAlias04() { DoNamedTest(); }
[TestSetting(typeof(NSubstituteCompleteSettings), nameof(NSubstituteCompleteSettings.MockAliases), "IDep=FakeDep")]
[Test] public void MockAlias05_UseMatchingField() { DoNamedTest(); }
[TestSetting(typeof(NSubstituteCompleteSettings), nameof(NSubstituteCompleteSettings.MockAliases), "IDep3<IDep1>=FakeDep31;IDep3<IDep2>=FakeDep32")]
[Test] public void MockAlias06_MultipleMock() { DoNamedTest(); }
}
[Test] public void FillFromEmpty_Simple01() { DoNamedTest(); }
[Test] public void FillFromEmpty_Simple02() { DoNamedTest(); }
[Test] public void FillLastArg_AddAfterLastMock() { DoNamedTest(); }
[TestSetting(typeof(NSubstituteCompleteSettings), nameof(NSubstituteCompleteSettings.MockAliases), "IDep3<T>=FakeDep3;IDep4=FakeDep4;IDep5=FakeDep5<T>;IDep6<TKey,TValue>=FakeDep6<TKey,TValue>;IDep7=FakeDep7;IDep9<IDep1>=FakeDep91;IDep9<IDep2>=FakeDep92")]
[Test] public void FillLastArg_ComplexAliases() { DoNamedTest(); }
[TestSetting(typeof(NSubstituteCompleteSettings), nameof(NSubstituteCompleteSettings.MockAliases), "IDep<T>=FakeDep")]
[Test] public void MockAlias01() { DoNamedTest(); }
[TestSetting(typeof(NSubstituteCompleteSettings), nameof(NSubstituteCompleteSettings.MockAliases), "IDep=FakeDep")]
[Test] public void MockAlias02() { DoNamedTest(); }
[TestSetting(typeof(NSubstituteCompleteSettings), nameof(NSubstituteCompleteSettings.MockAliases), "IDep=FakeDep<T>")]
[Test] public void MockAlias03() { DoNamedTest(); }
[TestSetting(typeof(NSubstituteCompleteSettings), nameof(NSubstituteCompleteSettings.MockAliases), "IDep<TKey, TValue>=FakeDep<TKey, TValue>")]
[Test] public void MockAlias04() { DoNamedTest(); }
[TestSetting(typeof(NSubstituteCompleteSettings), nameof(NSubstituteCompleteSettings.MockAliases), "IDep=FakeDep")]
[Test] public void MockAlias05_UseMatchingField() { DoNamedTest(); }
[TestSetting(typeof(NSubstituteCompleteSettings), nameof(NSubstituteCompleteSettings.MockAliases), "IDep3<IDep1>=FakeDep31;IDep3<IDep2>=FakeDep32")]
[Test] public void MockAlias06_MultipleMock() { DoNamedTest(); }
}
Loading

0 comments on commit f8d865f

Please sign in to comment.