2019-04-08 16:01:40 +08:00
|
|
|
|
using Longbow.Web;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using Xunit;
|
|
|
|
|
|
|
|
|
|
namespace Bootstrap.Admin.Api
|
|
|
|
|
{
|
|
|
|
|
public class OnlineTest : ControllerTest
|
|
|
|
|
{
|
|
|
|
|
public OnlineTest(BAWebHost factory) : base(factory, "api/OnlineUsers") { }
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
public async void Get_Ok()
|
|
|
|
|
{
|
|
|
|
|
var users = await Client.GetAsJsonAsync<IEnumerable<OnlineUser>>();
|
|
|
|
|
Assert.Single(users);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
public async void GetById_Ok()
|
|
|
|
|
{
|
|
|
|
|
var urls = await Client.GetAsJsonAsync<IEnumerable<KeyValuePair<DateTime, string>>>("UnitTest");
|
|
|
|
|
Assert.Empty(urls);
|
2019-03-18 10:44:24 +08:00
|
|
|
|
}
|
|
|
|
|
|
2019-04-08 16:01:40 +08:00
|
|
|
|
[Fact]
|
|
|
|
|
public async void Put_Ok()
|
|
|
|
|
{
|
|
|
|
|
var ret = await Client.PutAsJsonAsync<string, bool>("");
|
|
|
|
|
Assert.False(ret);
|
2019-03-18 10:44:24 +08:00
|
|
|
|
}
|
2019-04-08 16:01:40 +08:00
|
|
|
|
}
|
|
|
|
|
}
|