Skip to content

Commit 02f125e

Browse files
committed
Update unit test to use feature switch .targets
1 parent f2c7cc4 commit 02f125e

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

dotnet Community Toolkit.sln

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{CD16E790
5353
build\Update-Headers.ps1 = build\Update-Headers.ps1
5454
EndProjectSection
5555
EndProject
56-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Configuration", "Configuration", "{6640D447-C28D-4DBB-91F4-3ADCE0CA64AD}"
56+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "FeatureSwitches", "FeatureSwitches", "{6640D447-C28D-4DBB-91F4-3ADCE0CA64AD}"
5757
EndProject
5858
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommunityToolkit.Mvvm.DisableINotifyPropertyChanging.UnitTests", "tests\CommunityToolkit.Mvvm.DisableINotifyPropertyChanging.UnitTests\CommunityToolkit.Mvvm.DisableINotifyPropertyChanging.UnitTests.csproj", "{9E09DA49-4389-4ECE-8B68-EBDB1221DA90}"
5959
EndProject
@@ -81,7 +81,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommunityToolkit.Mvvm.Exter
8181
EndProject
8282
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommunityToolkit.Mvvm.ExternalAssembly.Roslyn431", "tests\CommunityToolkit.Mvvm.ExternalAssembly.Roslyn431\CommunityToolkit.Mvvm.ExternalAssembly.Roslyn431.csproj", "{4FCD501C-1BB5-465C-AD19-356DAB6600C6}"
8383
EndProject
84-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommunityToolkit.Mvvm.CodeFixers", "src\CommunityToolkit.Mvvm.CodeFixers\CommunityToolkit.Mvvm.CodeFixers.csproj", "{E79DCA2A-4C59-499F-85BD-F45215ED6B72}"
84+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommunityToolkit.Mvvm.CodeFixers", "src\CommunityToolkit.Mvvm.CodeFixers\CommunityToolkit.Mvvm.CodeFixers.csproj", "{E79DCA2A-4C59-499F-85BD-F45215ED6B72}"
8585
EndProject
8686
Global
8787
GlobalSection(SolutionConfigurationPlatforms) = preSolution

tests/CommunityToolkit.Mvvm.DisableINotifyPropertyChanging.UnitTests/CommunityToolkit.Mvvm.DisableINotifyPropertyChanging.UnitTests.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
<PropertyGroup>
44
<TargetFrameworks>net472;net6.0;net7.0;net8.0</TargetFrameworks>
5+
6+
<!-- Disable 'INotifyPropertyChanging' support -->
7+
<MvvmToolkitEnableINotifyPropertyChangedSupport>false</MvvmToolkitEnableINotifyPropertyChangedSupport>
58
</PropertyGroup>
69

710
<ItemGroup>
@@ -15,4 +18,6 @@
1518
<ProjectReference Include="..\..\src\CommunityToolkit.Mvvm.SourceGenerators.Roslyn401\CommunityToolkit.Mvvm.SourceGenerators.Roslyn401.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" PrivateAssets="contentfiles;build" />
1619
</ItemGroup>
1720

21+
<Import Project="..\..\src\CommunityToolkit.Mvvm\CommunityToolkit.Mvvm.FeatureSwitches.targets" />
22+
1823
</Project>

tests/CommunityToolkit.Mvvm.DisableINotifyPropertyChanging.UnitTests/Test_DisableINotifyPropertyChanging.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5-
using System;
65
using System.ComponentModel;
76
using CommunityToolkit.Mvvm.ComponentModel;
87
using Microsoft.VisualStudio.TestTools.UnitTesting;
@@ -12,11 +11,6 @@ namespace CommunityToolkit.Mvvm.DisableINotifyPropertyChanging.UnitTests;
1211
[TestClass]
1312
public class Test_DisableINotifyPropertyChanging
1413
{
15-
static Test_DisableINotifyPropertyChanging()
16-
{
17-
AppContext.SetSwitch("MVVMTOOLKIT_DISABLE_INOTIFYPROPERTYCHANGING", true);
18-
}
19-
2014
[TestMethod]
2115
public void Test_ObservableObject_Events()
2216
{

0 commit comments

Comments
 (0)