Skip to content

Commit ae83527

Browse files
Copilotjaviercn
andcommitted
Fix PublicAPI and test compilation issues with obsolete APIs
Co-authored-by: javiercn <[email protected]>
1 parent 6d7ae8c commit ae83527

File tree

2 files changed

+1
-52
lines changed

2 files changed

+1
-52
lines changed

src/Components/WebAssembly/WebAssembly.Authentication/test/RemoteAuthenticatorCoreTests.cs

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -370,37 +370,6 @@ public async Task AuthenticationManager_Logout_DoesNothingOnRedirect()
370370

371371
}
372372

373-
[Fact]
374-
public async Task AuthenticationManager_Logout_RedirectsToFailureOnInvalidSignOutState()
375-
{
376-
// Arrange
377-
var (remoteAuthenticator, renderer, authServiceMock) = CreateAuthenticationManager(
378-
"https://www.example.com/base/authentication/logout",
379-
new InteractiveRequestOptions { Interaction = InteractionType.SignIn, ReturnUrl = "https://www.example.com/base/fetchData" }.ToState());
380-
381-
if (remoteAuthenticator.SignOutManager is TestSignOutSessionStateManager testManager)
382-
{
383-
testManager.SignOutState = false;
384-
}
385-
386-
var parameters = ParameterView.FromDictionary(new Dictionary<string, object>
387-
{
388-
[_action] = RemoteAuthenticationActions.LogOut
389-
});
390-
391-
// Act
392-
await renderer.Dispatcher.InvokeAsync<object>(() => remoteAuthenticator.SetParametersAsync(parameters));
393-
394-
// Assert
395-
Assert.Equal(
396-
"https://www.example.com/base/authentication/logout-failed",
397-
remoteAuthenticator.Navigation.Uri);
398-
399-
Assert.Equal(
400-
"The logout was not initiated from within the page.",
401-
((TestNavigationManager)remoteAuthenticator.Navigation).HistoryEntryState);
402-
}
403-
404373
[Fact]
405374
public async Task AuthenticationManager_Logout_NavigatesToLogoutFailureOnError()
406375
{
@@ -731,8 +700,6 @@ private static
731700
Mock.Of<IOptionsSnapshot<RemoteAuthenticationOptions<OidcProviderOptions>>>(),
732701
navigationManager);
733702

734-
remoteAuthenticator.SignOutManager = new TestSignOutSessionStateManager();
735-
736703
remoteAuthenticator.AuthenticationService = authenticationServiceMock;
737704
remoteAuthenticator.AuthenticationProvider = authenticationServiceMock;
738705
return (remoteAuthenticator, renderer, authenticationServiceMock);
@@ -756,24 +723,6 @@ protected override void NavigateToCore(string uri, NavigationOptions options)
756723
}
757724
}
758725

759-
#pragma warning disable CS0618 // Type or member is obsolete, we keep it for now for backwards compatibility
760-
private class TestSignOutSessionStateManager : SignOutSessionStateManager
761-
#pragma warning restore CS0618 // Type or member is obsolete, we keep it for now for backwards compatibility
762-
{
763-
public TestSignOutSessionStateManager() : base(null)
764-
{
765-
}
766-
public bool SignOutState { get; set; } = true;
767-
768-
public override ValueTask SetSignOutState()
769-
{
770-
SignOutState = true;
771-
return default;
772-
}
773-
774-
public override Task<bool> ValidateSignOutState() => Task.FromResult(SignOutState);
775-
}
776-
777726
private class TestJsRuntime : IJSRuntime
778727
{
779728
public (string identifier, object[] args) LastInvocation { get; set; }

src/Components/WebAssembly/WebAssembly/src/PublicAPI.Shipped.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,6 @@ static Microsoft.AspNetCore.Components.WebAssembly.Http.WebAssemblyHttpRequestMe
115115
static Microsoft.AspNetCore.Components.WebAssembly.Http.WebAssemblyHttpRequestMessageExtensions.SetBrowserRequestOption(this System.Net.Http.HttpRequestMessage! requestMessage, string! name, object! value) -> System.Net.Http.HttpRequestMessage!
116116
static Microsoft.AspNetCore.Components.WebAssembly.Http.WebAssemblyHttpRequestMessageExtensions.SetBrowserRequestStreamingEnabled(this System.Net.Http.HttpRequestMessage! requestMessage, bool streamingEnabled) -> System.Net.Http.HttpRequestMessage!
117117
static Microsoft.AspNetCore.Components.WebAssembly.Http.WebAssemblyHttpRequestMessageExtensions.SetBrowserResponseStreamingEnabled(this System.Net.Http.HttpRequestMessage! requestMessage, bool streamingEnabled) -> System.Net.Http.HttpRequestMessage!
118-
static Microsoft.AspNetCore.Components.WebAssembly.Infrastructure.JSInteropMethods.NotifyLocationChanged(string! uri, bool isInterceptedLink) -> void
118+
119119
static Microsoft.AspNetCore.Components.WebAssembly.Infrastructure.JSInteropMethods.NotifyLocationChanged(string! uri, string? state, bool isInterceptedLink) -> void
120120
static Microsoft.AspNetCore.Components.WebAssembly.Infrastructure.JSInteropMethods.NotifyLocationChangingAsync(string! uri, string? state, bool isInterceptedLink) -> System.Threading.Tasks.ValueTask<bool>

0 commit comments

Comments
 (0)