mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
add GetCommitDatesAsyncShould test (#582)
* add GetNthIndexOfCharShould tests * add GetCommitDatesAsyncShould test
This commit is contained in:
parent
51481d2da2
commit
de6cc43884
1 changed files with 25 additions and 0 deletions
|
|
@ -0,0 +1,25 @@
|
|||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using FilterLists.Services.GitHub;
|
||||
using FilterLists.Services.GitHub.Models;
|
||||
using Xunit;
|
||||
|
||||
namespace FilterLists.Services.Tests.GitHub
|
||||
{
|
||||
public class GetCommitDatesAsyncShould
|
||||
{
|
||||
[Fact]
|
||||
public async Task ReturnCorrectCommitDatesForValidGitHubRawUrl()
|
||||
{
|
||||
const string rawFileUrl = "https://raw.githubusercontent.com/collinbarrett/FilterLists/master/LICENSE";
|
||||
var expectedCommitDates = new CommitDates
|
||||
{
|
||||
First = DateTime.Parse("2016-12-10T20:28:16.0000000"),
|
||||
Last = DateTime.Parse("2018-01-24T00:08:21.0000000")
|
||||
};
|
||||
var actualCommitDates = await new GitHubService().GetCommitDatesAsync(rawFileUrl);
|
||||
Assert.Equal(expectedCommitDates.First, actualCommitDates.First);
|
||||
Assert.Equal(expectedCommitDates.Last, actualCommitDates.Last);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue