单元测试:增加MessagesController单元测试
This commit is contained in:
parent
2abcfa724e
commit
53bfd3af08
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue