Skip to content

Commit

Permalink
RX State all new State handling
Browse files Browse the repository at this point in the history
Fix two tests
  • Loading branch information
Bernhard Straub committed Apr 14, 2024
1 parent 8f716a5 commit 41879b4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions RxBlazorLightCoreTestBase/ServiceFixture.State.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,20 @@ public async Task IncrementStateAsyncC(IState<int> state)
await IntCommandAsync.ExecuteAsync(async c => { await Task.Delay(10, c.CancellationToken); state.Value++; });
}

public void ValueChanging(TestEnum testEnum)
public void ValueChanging(TestEnum oldValue, TestEnum newValue)
{
if (EnumStateGroup.Value != testEnum)
if (oldValue != newValue)
{
EnumStateGroupOldValue = EnumStateGroup.Value;
EnumStateGroupOldValue = oldValue;
}
}

public async Task ValueChangingAsync(TestEnum testEnum)
public async Task ValueChangingAsync(TestEnum oldValue, TestEnum newValue)
{
await Task.Delay(100);
if (EnumStateGroupAsync.Value != testEnum)
if (oldValue != newValue)
{
EnumStateGroupAsyncOldValue = EnumStateGroupAsync.Value;
EnumStateGroupAsyncOldValue = oldValue;
}
}

Expand Down
4 changes: 2 additions & 2 deletions RxBlazorLightCoreTestBase/ServiceFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ public ServiceFixture()

CRUDListCommand = this.CreateStateCommandAsync(true);
CRUDDictCommand = this.CreateStateCommandAsync(true);
EnumStateGroup = this.CreateStateGroup([TestEnum.ONE, TestEnum.TWO, TestEnum.THREE], TestEnum.ONE, ValueChanging, i => i == 1);
EnumStateGroupAsync = this.CreateStateGroupAsync([TestEnum.ONE, TestEnum.TWO, TestEnum.THREE], TestEnum.ONE, ValueChangingAsync, i => i == 1);
EnumStateGroup = this.CreateStateGroup([TestEnum.ONE, TestEnum.TWO, TestEnum.THREE], TestEnum.ONE, i => i == 1);
EnumStateGroupAsync = this.CreateStateGroupAsync([TestEnum.ONE, TestEnum.TWO, TestEnum.THREE], TestEnum.ONE, i => i == 1);
}
}
}
4 changes: 2 additions & 2 deletions RxBlazorLightCoreTests/StateTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ public void TestStateGroupSync()
}
});

fixture.EnumStateGroup.ChangeValue(TestEnum.THREE);
fixture.EnumStateGroup.ChangeValue(TestEnum.THREE, fixture.ValueChanging);
while (!done) ;
Assert.Equal(TestEnum.THREE, fixture.EnumStateGroup.Value);
Assert.Equal(TestEnum.ONE, fixture.EnumStateGroupOldValue);
Expand Down Expand Up @@ -684,7 +684,7 @@ public async Task TestStateGroupAsync()
}
});

await fixture.EnumStateGroupAsync.ChangeValueAsync(TestEnum.THREE);
await fixture.EnumStateGroupAsync.ChangeValueAsync(TestEnum.THREE, fixture.ValueChangingAsync);

while (!done) ;
Assert.Equal(TestEnum.THREE, fixture.EnumStateGroupAsync.Value);
Expand Down
2 changes: 1 addition & 1 deletion RxMudBlazorLight/RxMudBlazorLight.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<PackageTags>Blazor,MudBlazor,Rx,Reactive</PackageTags>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageOutputPath>..\Nuget</PackageOutputPath>
<PackageVersion>0.6.9</PackageVersion>
<PackageVersion>0.7.0</PackageVersion>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 41879b4

Please sign in to comment.