mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-05 23:06:10 +00:00
47 lines
1.3 KiB
C#
47 lines
1.3 KiB
C#
using System.Collections.Generic;
|
|
using Xunit;
|
|
|
|
namespace Octokit.Tests.Models
|
|
{
|
|
public class RepositoryTopicsTests
|
|
{
|
|
public class Ctor
|
|
{
|
|
[Fact]
|
|
public void EmptyListWhenCtorEmpty()
|
|
{
|
|
var result = new RepositoryTopics();
|
|
Assert.NotNull(result.Names);
|
|
Assert.Empty(result.Names);
|
|
}
|
|
|
|
[Fact]
|
|
public void EmptyListWhenCtorListIsEmpty()
|
|
{
|
|
var result = new RepositoryTopics(new List<string>());
|
|
Assert.NotNull(result.Names);
|
|
Assert.Empty(result.Names);
|
|
}
|
|
|
|
[Fact]
|
|
public void EmptyListWhenCtorIsNull()
|
|
{
|
|
var result = new RepositoryTopics(null);
|
|
Assert.NotNull(result.Names);
|
|
Assert.Empty(result.Names);
|
|
}
|
|
|
|
[Fact]
|
|
public void SetsListWhenListProvided()
|
|
{
|
|
var theItems = new List<string> {"one", "two", "three"};
|
|
var result = new RepositoryTopics(theItems);
|
|
|
|
Assert.Contains("one", result.Names);
|
|
Assert.Contains("two", result.Names);
|
|
Assert.Contains("three", result.Names);
|
|
}
|
|
}
|
|
}
|
|
}
|