单元测试:增加MessagesController单元测试

This commit is contained in:
Argo-Surface 2019-01-16 14:41:17 +08:00
parent 2abcfa724e
commit 53bfd3af08
1 changed files with 33 additions and 0 deletions

View File

@ -0,0 +1,33 @@
using Bootstrap.Admin.Models;
using Bootstrap.DataAccess;
using System.Collections.Generic;
using Xunit;
namespace Bootstrap.Admin.Api
{
public class MessagesTest : ApiTest
{
public MessagesTest(BAWebHost factory) : base(factory, "Messages", true)
{
}
[Theory]
[InlineData("inbox")]
[InlineData("sendmail")]
[InlineData("mark")]
[InlineData("trash")]
public async void Get_Ok(string action)
{
var resp = await Client.GetAsJsonAsync<IEnumerable<Message>>(action);
Assert.NotNull(resp);
}
[Fact]
public async void GetCount_Ok()
{
var resp = await Client.GetAsJsonAsync<MessageCountModel>(string.Empty);
Assert.NotNull(resp);
}
}
}