Skip to content

Commit

Permalink
feat(inpc): added set property support for NotifyPropertyChangedCore #6
Browse files Browse the repository at this point in the history
… (#7)

* feat(inpc): added set property support for NotifyPropertyChangedCore #6

* chore: bump version to 2.2.5
  • Loading branch information
godrose authored Dec 5, 2021
1 parent cf7b14b commit 7e964a3
Show file tree
Hide file tree
Showing 58 changed files with 1,023 additions and 221 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Core facilties
# Core facilities

<img src=https://ci.appveyor.com/api/projects/status/github/logofx/core>

Expand Down
2 changes: 1 addition & 1 deletion devops/deploy/deploy-all.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
rem TODO: Use common source for all version instances
SET version=2.2.5-rc1
SET version=2.2.5
rem TODO: Refactor using loop and automatic discovery
call deploy-single.bat LogoFX.Core %version%
call deploy-single.bat LogoFX.Practices.IoC %version%
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/10/nuspec.xsd">
<metadata>
<id>LogoFX.Client.Core.Core</id>
<version>2.2.5-rc1</version>
<version>2.2.5</version>
<title>LogoFX.Client.Core.Core</title>
<authors>Gennady Verdel, David Kossoglyad, Vlad Spivak</authors>
<owners>Gennady Verdel</owners>
Expand All @@ -14,7 +14,7 @@
<summary>LogoFX Client Core Core containing core facilities for client applications development, including implementation of INotifyPropertyChanged and ambient context for the dispatcher.</summary>
<releaseNotes>Added SetProperty functionality</releaseNotes>
<dependencies>
<dependency id="LogoFX.Core" version="2.2.5-rc1" />
<dependency id="LogoFX.Core" version="2.2.5" />
</dependencies>
<tags>framework logofx dotnet</tags>
<repository type="Open Source" url="https://github.com/LogoFX/core" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/10/nuspec.xsd">
<metadata>
<id>LogoFX.Client.Core</id>
<version>2.2.5-rc1</version>
<version>2.2.5</version>
<title>LogoFX.Client.Core</title>
<authors>Gennady Verdel, David Kossoglyad, Vlad Spivak</authors>
<owners>Gennady Verdel</owners>
Expand All @@ -14,7 +14,7 @@
<summary>LogoFX Client Core containing platform-specific utilities for client applications, including dispatcher.</summary>
<releaseNotes>Added .NET 5 support</releaseNotes>
<dependencies>
<dependency id="LogoFX.Client.Core.Core" version="2.2.5-rc1" />
<dependency id="LogoFX.Client.Core.Core" version="2.2.5" />
</dependencies>
<tags>framework logofx dotnet</tags>
<repository type="Open Source" url="https://github.com/LogoFX/core" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/10/nuspec.xsd">
<metadata>
<id>LogoFX.Client.Modularity</id>
<version>2.2.5-rc1</version>
<version>2.2.5</version>
<title>LogoFX.Client.Modularity</title>
<authors>Gennady Verdel, David Kossoglyad, Dmitry Bublik</authors>
<owners>Gennady Verdel</owners>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/10/nuspec.xsd">
<metadata>
<id>LogoFX.Client.Theming</id>
<version>2.2.5-rc1</version>
<version>2.2.5</version>
<title>LogoFX.Client.Theming</title>
<authors>Dmitry Bublik, David Kossoglyad, Gennady Verdel</authors>
<owners>Gennady Verdel</owners>
Expand Down
2 changes: 1 addition & 1 deletion devops/pack/LogoFX.Core/contents/LogoFX.Core.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/10/nuspec.xsd">
<metadata>
<id>LogoFX.Core</id>
<version>2.2.5-rc1</version>
<version>2.2.5</version>
<authors>Gennady Verdel, David Kossoglyad, Vlad Spivak, Dmitry Bublik</authors>
<owners>Gennady Verdel</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/10/nuspec.xsd">
<metadata>
<id>LogoFX.Practices.IoC</id>
<version>2.2.5-rc1</version>
<version>2.2.5</version>
<title>LogoFX.Practices.IoC</title>
<authors>Gennady Verdel, David Kossoglyad, Dmitry Bublik, Vlad Spivak</authors>
<owners>Gennady Verdel</owners>
Expand All @@ -15,7 +15,7 @@
<releaseNotes>
</releaseNotes>
<dependencies>
<dependency id="LogoFX.Core" version="2.2.5-rc1" />
<dependency id="LogoFX.Core" version="2.2.5" />
<dependency id="Solid.Practices.Modularity" version="2.3.3" />
</dependencies>
<tags>framework logofx dotnet</tags>
Expand Down
2 changes: 1 addition & 1 deletion devops/publish/publish-all.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cd ../../src
nuget restore
cd ../devops/publish
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& '../build/build-all.ps1'"
SET package_version=2.2.5-rc1
SET package_version=2.2.5
cd ../test
call test-all
cd ../pack
Expand Down
2 changes: 1 addition & 1 deletion devops/publish/publish-single.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
SET package_name=%1
SET package_version=2.2.5-rc1
SET package_version=2.2.5
SET target=../../../../packages/Tests-All
cd ../build
call build-all
Expand Down
1 change: 1 addition & 0 deletions devops/test/test-all.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
call test-tests-single.bat LogoFX.Core.Tests
call test-specs-single LogoFX.Core.Specs
call test-specs-single LogoFX.Client.Core.Specs
call test-specs-single LogoFX.Client.Core.Platform.NETCore.Specs
call test-specs-single.bat LogoFX.Practices.IoC.Specs
Expand Down
21 changes: 11 additions & 10 deletions src/LogoFX.Client.Core.Platform.NETCore.Specs/InvocationSteps.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,28 @@
using System.Threading;
using FluentAssertions;
using LogoFX.Client.Core.Specs.Common;
using LogoFX.Core.Specs.Common;
using TechTalk.SpecFlow;

namespace LogoFX.Client.Core.Platform.NETCore.Specs
{
[Binding]
internal sealed class InvocationSteps
{
private readonly DispatcherScenarioDataStoreBase<TestPlatformDispatch> _dispatcherScenarioDataStoreBase;
private readonly InvocationScenarioDataStoreBase _invocationScenarioDataStoreBase;
private readonly DispatcherScenarioDataStore<TestPlatformDispatch> _dispatcherScenarioDataStore;
private readonly InvocationScenarioDataStore _invocationScenarioDataStore;

public InvocationSteps(ScenarioContext scenarioContext)
{
_dispatcherScenarioDataStoreBase =
new DispatcherScenarioDataStoreBase<TestPlatformDispatch>(scenarioContext);
_invocationScenarioDataStoreBase = new InvocationScenarioDataStoreBase(scenarioContext);
_dispatcherScenarioDataStore =
new DispatcherScenarioDataStore<TestPlatformDispatch>(scenarioContext);
_invocationScenarioDataStore = new InvocationScenarioDataStore(scenarioContext);
}

[Given(@"The dispatcher is set to custom dispatcher")]
public void GivenTheDispatcherIsSetToCustomDispatcher()
{
_dispatcherScenarioDataStoreBase.Dispatch = new TestPlatformDispatch(new PlatformDispatch());
_dispatcherScenarioDataStore.Dispatch = new TestPlatformDispatch(new PlatformDispatch());
}

//TODO: Merge with the same class in LogoFX.Client.Core.Specs - pay attention to different dispatcher types
Expand All @@ -31,19 +32,19 @@ public void GivenTheDispatcherIsSetToCustomDispatcher()
public void WhenTheIsCreatedWithDispatcher(string name)
{
var @class = TestClassFactory.CreateTestClass(Assembly.GetExecutingAssembly(), name,
_dispatcherScenarioDataStoreBase.Dispatch);
_dispatcherScenarioDataStore.Dispatch);
if (@class != null)
{
var isCalledRef = TestClassHelper.ListenToPropertyChange(@class, "Number");
_invocationScenarioDataStoreBase.Class = @class;
_invocationScenarioDataStoreBase.IsCalledRef = isCalledRef;
_invocationScenarioDataStore.Class = @class;
_invocationScenarioDataStore.IsCalledRef = isCalledRef;
}
}

[Then(@"The property change notification is raised via the custom action invocation")]
public void ThenThePropertyChangeNotificationIsRaisedViaTheCustomActionInvocation()
{
var fakeDispatch = _dispatcherScenarioDataStoreBase.Dispatch;
var fakeDispatch = _dispatcherScenarioDataStore.Dispatch;
fakeDispatch.IsCustomActionInvoked.Should().BeTrue();
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Windows.Threading;
using LogoFX.Client.Core.Specs.Common;
using LogoFX.Core;

namespace LogoFX.Client.Core.Platform.NETCore.Specs
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
namespace LogoFX.Client.Core.Specs.Common
{
[Binding]
public sealed class DispatcherScenarioDataStoreBase<TDispatch> : ScenarioDataStoreBase
public sealed class DispatcherScenarioDataStore<TDispatch> : ScenarioDataStoreBase
{
public DispatcherScenarioDataStoreBase(ScenarioContext scenarioContext) : base(scenarioContext)
public DispatcherScenarioDataStore(ScenarioContext scenarioContext) : base(scenarioContext)
{
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<IsPackable>false</IsPackable>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<TargetFramework>netstandard2.0</TargetFramework>
<IsPackable>false</IsPackable>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<LangVersion>8</LangVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<LangVersion>8</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Attest.Tests.SpecFlow" Version="2.4.3" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\LogoFX.Client.Core\LogoFX.Client.Core.csproj" />
<ProjectReference Include="..\LogoFX.Core.Specs.Common\LogoFX.Core.Specs.Common.csproj" />
</ItemGroup>

</Project>
</Project>
11 changes: 6 additions & 5 deletions src/LogoFX.Client.Core.Specs.Common/NumberChangeSteps.cs
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
using TechTalk.SpecFlow;
using LogoFX.Core.Specs.Common;
using TechTalk.SpecFlow;

namespace LogoFX.Client.Core.Specs.Common
{
[Binding]
internal sealed class NumberChangeSteps
{
private readonly InvocationScenarioDataStoreBase _invocationScenarioDataStoreBase;
private readonly InvocationScenarioDataStore _invocationScenarioDataStore;

public NumberChangeSteps(ScenarioContext scenarioContext)
{
_invocationScenarioDataStoreBase = new InvocationScenarioDataStoreBase(scenarioContext);
_invocationScenarioDataStore = new InvocationScenarioDataStore(scenarioContext);
}

[When(@"The number is changed to (.*) in regular mode")]
public void WhenTheNumberIsChangedToInRegularMode(int value)
{
var @class = _invocationScenarioDataStoreBase.Class as TestClassBase;
var @class = _invocationScenarioDataStore.Class as TestClassBase;
@class.Number = value;
}

[When(@"The number is changed to (.*) via SetProperty API")]
public void WhenTheNumberIsChangedToViaSetPropertyAPI(int value)
{
var @class = _invocationScenarioDataStoreBase.Class as TestClassBase;
var @class = _invocationScenarioDataStore.Class as TestClassBase;
@class.Number = value;
}
}
Expand Down
13 changes: 0 additions & 13 deletions src/LogoFX.Client.Core.Specs.Common/TestClassFactory.cs

This file was deleted.

26 changes: 13 additions & 13 deletions src/LogoFX.Client.Core.Specs/Common/CommonSteps.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
using System.Reflection;
using LogoFX.Client.Core.Specs.Dispatcher;
using TechTalk.SpecFlow;
using LogoFX.Core.Specs.Common;

namespace LogoFX.Client.Core.Specs.Common
{
[Binding]
public sealed class CommonSteps
{
private readonly DispatcherScenarioDataStoreBase<FakeDispatch> _dispatcherScenarioDataStoreBase;
private readonly InvocationScenarioDataStoreBase _invocationScenarioDataStoreBase;
private readonly DispatcherScenarioDataStore<FakeDispatch> _dispatcherScenarioDataStore;
private readonly InvocationScenarioDataStore _invocationScenarioDataStore;

public CommonSteps(ScenarioContext scenarioContext)
{
_dispatcherScenarioDataStoreBase = new DispatcherScenarioDataStoreBase<FakeDispatch>(scenarioContext);
_invocationScenarioDataStoreBase = new InvocationScenarioDataStoreBase(scenarioContext);
_dispatcherScenarioDataStore = new DispatcherScenarioDataStore<FakeDispatch>(scenarioContext);
_invocationScenarioDataStore = new InvocationScenarioDataStore(scenarioContext);
}

[When(@"The '(.*)' is created")]
Expand All @@ -23,20 +23,20 @@ public void WhenTheIsCreated(string name)
if (@class != null)
{
var isCalledRef = TestClassHelper.ListenToPropertyChange(@class, "Number");
_invocationScenarioDataStoreBase.Class = @class;
_invocationScenarioDataStoreBase.IsCalledRef = isCalledRef;
_invocationScenarioDataStore.Class = @class;
_invocationScenarioDataStore.IsCalledRef = isCalledRef;
}
}

[When(@"The '(.*)' is created with dispatcher")]
public void WhenTheIsCreatedWithDispatcher(string name)
{
var @class = TestClassFactory.CreateTestClass(Assembly.GetExecutingAssembly(), name, _dispatcherScenarioDataStoreBase.Dispatch);
var @class = TestClassFactory.CreateTestClass(Assembly.GetExecutingAssembly(), name, _dispatcherScenarioDataStore.Dispatch);
if (@class != null)
{
var isCalledRef = TestClassHelper.ListenToPropertyChange(@class, "Number");
_invocationScenarioDataStoreBase.Class = @class;
_invocationScenarioDataStoreBase.IsCalledRef = isCalledRef;
_invocationScenarioDataStore.Class = @class;
_invocationScenarioDataStore.IsCalledRef = isCalledRef;
}
}

Expand All @@ -47,15 +47,15 @@ public void WhenTheIsCreatedAndEmptyNotificationIsListenedTo(string name)
if (@class != null)
{
var isCalledRef = TestClassHelper.ListenToPropertyChange(@class, string.Empty);
_invocationScenarioDataStoreBase.Class = @class;
_invocationScenarioDataStoreBase.IsCalledRef = isCalledRef;
_invocationScenarioDataStore.Class = @class;
_invocationScenarioDataStore.IsCalledRef = isCalledRef;
}
}

[When(@"The all properties change is invoked")]
public void WhenTheAllPropertiesChangeIsInvoked()
{
var @class = _invocationScenarioDataStoreBase.Class as TestNameClass;
var @class = _invocationScenarioDataStore.Class as TestNameClass;
@class.Refresh();
}
}
Expand Down
1 change: 0 additions & 1 deletion src/LogoFX.Client.Core.Specs/Common/LifecycleHook.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Threading;
using TechTalk.SpecFlow;

namespace LogoFX.Client.Core.Specs.Common
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using LogoFX.Core;

namespace LogoFX.Client.Core.Specs.Common
{
public class TestAfterValueUpdateClass : TestClassBase
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using LogoFX.Core;

namespace LogoFX.Client.Core.Specs.Common
{
public class TestBeforeValueUpdateClass : TestClassBase
Expand Down
2 changes: 2 additions & 0 deletions src/LogoFX.Client.Core.Specs/Common/TestMultipleClass.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using LogoFX.Core;

namespace LogoFX.Client.Core.Specs.Common
{
public class TestMultipleClass : NotifyPropertyChangedBase<TestMultipleClass>
Expand Down
Loading

0 comments on commit 7e964a3

Please sign in to comment.