Fix tests

This commit is contained in:
2025-05-14 12:18:38 +02:00
parent 8ac8b78758
commit c0f4b69d80
6 changed files with 11 additions and 94 deletions
@@ -1,41 +0,0 @@
using FluentAssertions;
using System.ComponentModel;
using System.Windows.Controls;
using System.Windows.Extensions;
using System.Windows.Media.Effects;
namespace WpfExtended.SourceGeneration.Tests;
internal partial class Class1 : UserControl, INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
private bool calledEvent;
[GenerateDependencyProperty]
public int someF;
[GenerateDependencyProperty(InitialValue = "This has a value")]
public string someValue;
[GenerateDependencyProperty]
public Effect effect;
[GenerateNotifyPropertyChanged]
public string someNotifyingValue;
public void TestValues()
{
this.PropertyChanged += Class1_PropertyChanged;
this.SomeF.Should().Be(0);
this.SomeValue.Should().Be("This has a value");
this.Effect.Should().BeNull();
this.SomeNotifyingValue = "NewValue";
this.calledEvent.Should().BeTrue();
this.someNotifyingValue.Should().Be("NewValue");
}
private void Class1_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
this.calledEvent = true;
}
}
@@ -1,15 +0,0 @@
using System;
namespace WpfExtended.SourceGeneration.Tests
{
public class Launcher
{
[STAThread]
public static int Main()
{
var cls = new Class1();
cls.TestValues();
return 0;
}
}
}
@@ -1,20 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0-windows</TargetFramework>
<UseWPF>true</UseWPF>
<LangVersion>preview</LangVersion>
<OutputType>Exe</OutputType>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<CompilerGeneratedFilesOutputPath>obj</CompilerGeneratedFilesOutputPath>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.7.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\WpfExtended.SourceGeneration\WpfExtended.SourceGeneration.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>
</Project>
@@ -5,7 +5,6 @@ using Slim;
using Slim.Integration.ServiceCollection;
using System;
using System.Extensions;
using System.Http;
using System.Logging;
using System.Net.Http;
using System.Windows.Extensions;
+9 -9
View File
@@ -8,15 +8,15 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FlaUI.UIA3" Version="3.2.0" />
<PackageReference Include="FluentAssertions" Version="6.7.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="6.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.1" />
<PackageReference Include="Microsoft.TestPlatform" Version="17.3.1" />
<PackageReference Include="Microsoft.TestPlatform.TestHost" Version="17.3.1" />
<PackageReference Include="MSTest.TestAdapter" Version="2.2.10" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.10" />
<PackageReference Include="SystemExtensions.NetStandard" Version="1.5.0" />
<PackageReference Include="FlaUI.UIA3" Version="5.0.0" />
<PackageReference Include="FluentAssertions" Version="8.2.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="9.0.5" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
<PackageReference Include="Microsoft.TestPlatform" Version="17.13.0" />
<PackageReference Include="Microsoft.TestPlatform.TestHost" Version="17.13.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.8.3" />
<PackageReference Include="MSTest.TestFramework" Version="3.8.3" />
<PackageReference Include="SystemExtensions.NetStandard" Version="1.6.11" />
</ItemGroup>
<ItemGroup>
+2 -8
View File
@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30804.86
# Visual Studio Version 17
VisualStudioVersion = 17.13.35919.96 d17.13
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WpfExtended", "WpfExtended\WpfExtended.csproj", "{E822AE0D-5EA1-4C61-A1DC-76CF73C8A524}"
EndProject
@@ -9,8 +9,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WpfExtended.Tests", "WpfExt
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WpfExtended.SourceGeneration", "WpfExtended.SourceGeneration\WpfExtended.SourceGeneration.csproj", "{BB890187-DF49-4E58-AE41-09C40F541292}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WpfExtended.SourceGeneration.Tests", "WpfExtended.SourceGeneration.Tests\WpfExtended.SourceGeneration.Tests.csproj", "{BDD41E4C-3F5D-4734-8BD2-62B444E4845D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -29,10 +27,6 @@ Global
{BB890187-DF49-4E58-AE41-09C40F541292}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BB890187-DF49-4E58-AE41-09C40F541292}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BB890187-DF49-4E58-AE41-09C40F541292}.Release|Any CPU.Build.0 = Release|Any CPU
{BDD41E4C-3F5D-4734-8BD2-62B444E4845D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BDD41E4C-3F5D-4734-8BD2-62B444E4845D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BDD41E4C-3F5D-4734-8BD2-62B444E4845D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BDD41E4C-3F5D-4734-8BD2-62B444E4845D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE