test: 增加 Lock Post 方法测试

This commit is contained in:
Argo Zhang 2019-08-21 15:37:44 +08:00
parent bbcfc15098
commit 8d1246f45f
No known key found for this signature in database
GPG Key ID: 152E398953DDF19F
1 changed files with 13 additions and 2 deletions

View File

@ -91,8 +91,19 @@ namespace Bootstrap.Admin.Controllers.SqlServer
var content = await r.Content.ReadAsStringAsync();
Assert.Contains("系统锁屏", content);
// relogin
await Client.LoginAsync();
// 第二次调用 跳转到登录页面
r = await Client.GetAsync("Lock");
Assert.True(r.IsSuccessStatusCode);
content = await r.Content.ReadAsStringAsync();
Assert.Contains("登 录", content);
// 调用Post
var data = new MultipartFormDataContent
{
{ new StringContent("Admin"), "userName" },
{ new StringContent("123789"), "password" }
};
await Client.PostAsync("Lock", data);
}
}
}