mirror of
https://gitee.com/LongbowEnterprise/BootstrapBlazor.git
synced 2024-12-05 05:29:47 +08:00
parent
4df42641cd
commit
ba687fb0db
26
test/UnitTest/Components/AjaxTest.cs
Normal file
26
test/UnitTest/Components/AjaxTest.cs
Normal file
@ -0,0 +1,26 @@
|
||||
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
// Website: https://www.blazor.zone or https://argozhang.github.io/
|
||||
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace UnitTest.Components;
|
||||
|
||||
public class AjaxTest : BootstrapBlazorTestBase
|
||||
{
|
||||
[Fact]
|
||||
public void Ajax_Test()
|
||||
{
|
||||
var option = new AjaxOption
|
||||
{
|
||||
Url = "/api/Login",
|
||||
Method = "POST",
|
||||
Data = new { UserName = "admin", Password = "1234567" }
|
||||
};
|
||||
var service = Context.Services.GetRequiredService<AjaxService>();
|
||||
_ = service.GetMessage(option);
|
||||
|
||||
_ = Context.RenderComponent<Ajax>();
|
||||
_ = service.GetMessage(option);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user