-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Resolves GH-461
- Loading branch information
Showing
54 changed files
with
415 additions
and
335 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
namespace TraktNet.Enums | ||
{ | ||
/// <summary>Determines the privacy of a list.</summary> | ||
public sealed class TraktListPrivacy : TraktEnumeration | ||
{ | ||
/// <summary>An invalid privacy type.</summary> | ||
public static TraktListPrivacy Unspecified { get; } = new TraktListPrivacy(); | ||
|
||
/// <summary>The list is private. Only the user who created the list can see it.</summary> | ||
public static TraktListPrivacy Private { get; } = new TraktListPrivacy(1, "private", "private", "Private"); | ||
|
||
/// <summary>The list is only viewable by a shared link.</summary> | ||
public static TraktListPrivacy Link { get; } = new TraktListPrivacy(2, "link", "link", "Link"); | ||
|
||
/// <summary>The list can only be seen by friends.</summary> | ||
public static TraktListPrivacy Friends { get; } = new TraktListPrivacy(4, "friends", "friends", "Friends"); | ||
|
||
/// <summary>The list is public and anyone can see it.</summary> | ||
public static TraktListPrivacy Public { get; } = new TraktListPrivacy(8, "public", "public", "Public"); | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="TraktListPrivacy" /> class.<para /> | ||
/// The initialized <see cref="TraktListPrivacy" /> is invalid. | ||
/// </summary> | ||
public TraktListPrivacy() | ||
{ | ||
} | ||
|
||
private TraktListPrivacy(int value, string objectName, string uriName, string displayName) : base(value, objectName, uriName, displayName) | ||
{ | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
Source/Tests/Trakt.NET.Core.Tests/Enums/TraktListPrivacy_Tests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
namespace TraktNet.Core.Tests.Enums | ||
{ | ||
using FluentAssertions; | ||
using System.Collections.Generic; | ||
using Trakt.NET.Tests.Utility.Traits; | ||
using TraktNet.Enums; | ||
using Xunit; | ||
|
||
[TestCategory("Enums")] | ||
public class TraktListPrivacy_Tests | ||
{ | ||
[Fact] | ||
public void Test_TraktListPrivacy_GetAll() | ||
{ | ||
var allValues = TraktEnumeration.GetAll<TraktListPrivacy>(); | ||
|
||
allValues.Should().NotBeNull().And.HaveCount(5); | ||
allValues.Should().Contain(new List<TraktListPrivacy>() { TraktListPrivacy.Unspecified, TraktListPrivacy.Private, | ||
TraktListPrivacy.Link, TraktListPrivacy.Friends, | ||
TraktListPrivacy.Public }); | ||
} | ||
|
||
[Fact] | ||
public void Test_TraktListPrivacy_Properties() | ||
{ | ||
TraktListPrivacy.Private.Value.Should().Be(1); | ||
TraktListPrivacy.Private.ObjectName.Should().Be("private"); | ||
TraktListPrivacy.Private.UriName.Should().Be("private"); | ||
TraktListPrivacy.Private.DisplayName.Should().Be("Private"); | ||
|
||
TraktListPrivacy.Link.Value.Should().Be(2); | ||
TraktListPrivacy.Link.ObjectName.Should().Be("link"); | ||
TraktListPrivacy.Link.UriName.Should().Be("link"); | ||
TraktListPrivacy.Link.DisplayName.Should().Be("Link"); | ||
|
||
TraktListPrivacy.Friends.Value.Should().Be(4); | ||
TraktListPrivacy.Friends.ObjectName.Should().Be("friends"); | ||
TraktListPrivacy.Friends.UriName.Should().Be("friends"); | ||
TraktListPrivacy.Friends.DisplayName.Should().Be("Friends"); | ||
|
||
TraktListPrivacy.Public.Value.Should().Be(8); | ||
TraktListPrivacy.Public.ObjectName.Should().Be("public"); | ||
TraktListPrivacy.Public.UriName.Should().Be("public"); | ||
TraktListPrivacy.Public.DisplayName.Should().Be("Public"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.