start tests
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FeedlySharp.Tests
|
||||
{
|
||||
class AccountTests
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Xunit;
|
||||
|
||||
namespace FeedlySharp.Tests
|
||||
{
|
||||
public class TestsBase : IDisposable
|
||||
{
|
||||
protected FeedlyClient client;
|
||||
|
||||
// setup
|
||||
public TestsBase()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
// teardown
|
||||
public void Dispose()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
// async throws
|
||||
public static async Task ThrowsAsync<TException>(Func<Task> func)
|
||||
{
|
||||
var expected = typeof(TException);
|
||||
Type actual = null;
|
||||
try
|
||||
{
|
||||
await func();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
actual = e.GetType();
|
||||
}
|
||||
Assert.Equal(expected, actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="xunit" version="1.9.2" targetFramework="net45" />
|
||||
</packages>
|
||||
Reference in New Issue
Block a user