Skip to content

Commit

Permalink
#632: Add notes add request
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikfroehling committed Mar 29, 2024
1 parent 8a56750 commit e6f1d42
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Source/Lib/Trakt.NET/Requests/Notes/OAuth/NotesAddRequest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
namespace TraktNet.Requests.Notes.OAuth
{
using System.Collections.Generic;
using TraktNet.Objects.Get.Notes;
using TraktNet.Objects.Post.Notes;
using TraktNet.Requests.Base;

internal sealed class NotesAddRequest : APostRequest<ITraktNote, ITraktNotePost>
{
public override ITraktNotePost RequestBody { get; set; }

public override string UriTemplate => "notes";

public override IDictionary<string, object> GetUriPathParameters() => new Dictionary<string, object>();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
namespace TraktNet.Requests.Tests.Notes.OAuth
{
using FluentAssertions;
using Trakt.NET.Tests.Utility.Traits;
using TraktNet.Requests.Base;
using TraktNet.Requests.Notes.OAuth;
using Xunit;

[TestCategory("Requests.Notes.OAuth")]
public class NotesAddRequest_Tests
{
[Fact]
public void Test_NotesAddRequest_Has_AuthorizationRequirement_Required()
{
var request = new NotesAddRequest();
request.AuthorizationRequirement.Should().Be(AuthorizationRequirement.Required);
}

[Fact]
public void Test_NotesAddRequest_Has_Valid_UriTemplate()
{
var request = new NotesAddRequest();
request.UriTemplate.Should().Be("notes");
}

[Fact]
public void Test_NotesAddRequest_Returns_Valid_UriPathParameters()
{
var request = new NotesAddRequest();
request.GetUriPathParameters().Should().NotBeNull().And.HaveCount(0);
}
}
}

0 comments on commit e6f1d42

Please sign in to comment.