Skip to content

Commit

Permalink
Fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
congminh1254 committed Sep 5, 2023
1 parent 67a53c6 commit 553912c
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 50 deletions.
90 changes: 45 additions & 45 deletions Box.V2.Test/BoxSignTemplateManagerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,61 +14,61 @@ namespace Box.V2.Test
[TestClass]
public class BoxSignTemplatesManagerTest : BoxResourceManagerTest
{
private readonly BoxSignTemplatesManager _signTemplatesManager;
private readonly BoxSignTemplatesManager _signTemplatesManager;

public BoxSignTemplatesManagerTest()
{
_signTemplatesManager = new BoxSignTemplatesManager(Config.Object, Service, Converter, AuthRepository);
}
public BoxSignTemplatesManagerTest()
{
_signTemplatesManager = new BoxSignTemplatesManager(Config.Object, Service, Converter, AuthRepository);
}

[TestMethod]
public async Task GetSignTemplateById_Success()
{
/** Arrange **/
const string signTemplateId = "93153068-5420-467b-b8ef-8e54bfb7be42";
IBoxRequest boxRequest = null;
Handler.Setup(h => h.ExecuteAsync<BoxSignTemplate>(It.IsAny<IBoxRequest>()))
.Returns(Task.FromResult<IBoxResponse<BoxSignTemplate>>(new BoxResponse<BoxSignTemplate>()
{
Status = ResponseStatus.Success,
ContentString = LoadFixtureFromJson("Fixtures/BoxSignTemplate/GetSignTemplate200.json")
}))
.Callback<IBoxRequest>(r => boxRequest = r);
[TestMethod]
public async Task GetSignTemplateById_Success()
{
/** Arrange **/
const string signTemplateId = "93153068-5420-467b-b8ef-8e54bfb7be42";
IBoxRequest boxRequest = null;
Handler.Setup(h => h.ExecuteAsync<BoxSignTemplate>(It.IsAny<IBoxRequest>()))
.Returns(Task.FromResult<IBoxResponse<BoxSignTemplate>>(new BoxResponse<BoxSignTemplate>()
{
Status = ResponseStatus.Success,
ContentString = LoadFixtureFromJson("Fixtures/BoxSignTemplate/GetSignTemplate200.json")
}))
.Callback<IBoxRequest>(r => boxRequest = r);

/*** Act ***/
BoxSignTemplate response = await _signTemplatesManager.GetSignTemplateByIdAsync(signTemplateId);
/*** Act ***/
BoxSignTemplate response = await _signTemplatesManager.GetSignTemplateByIdAsync(signTemplateId);

/*** Assert ***/
// Request check
Assert.IsNotNull(boxRequest);
Assert.AreEqual(RequestMethod.Get, boxRequest.Method);
Assert.AreEqual(new Uri("https://api.box.com/2.0/sign_templates/93153068-5420-467b-b8ef-8e54bfb7be42"), boxRequest.AbsoluteUri);
/*** Assert ***/
// Request check
Assert.IsNotNull(boxRequest);
Assert.AreEqual(RequestMethod.Get, boxRequest.Method);
Assert.AreEqual(new Uri("https://api.box.com/2.0/sign_templates/93153068-5420-467b-b8ef-8e54bfb7be42"), boxRequest.AbsoluteUri);

// Response check
Assert.AreEqual(signTemplateId, response.Id);
Assert.AreEqual("requirements-dev.pdf", response.Name);
Assert.AreEqual("Please sign this document.\n\nKind regards", response.EmailMessage);
Assert.AreEqual("Someone ([email protected]) has requested your signature on a document", response.EmailSubject);
Assert.AreEqual("1234567890", response.ParentFolder.Id);
Assert.AreEqual(1, response.SourceFiles.Count);
Assert.AreEqual("1234567890", response.SourceFiles[0].Id);
Assert.AreEqual("https://app.box.com/sign/ready-sign-link/59917816-c12b-4ef6-8f1d-aaaaaaa", response.ReadySignLink.Url);
}
// Response check
Assert.AreEqual(signTemplateId, response.Id);
Assert.AreEqual("requirements-dev.pdf", response.Name);
Assert.AreEqual("Please sign this document.\n\nKind regards", response.EmailMessage);
Assert.AreEqual("Someone ([email protected]) has requested your signature on a document", response.EmailSubject);
Assert.AreEqual("1234567890", response.ParentFolder.Id);
Assert.AreEqual(1, response.SourceFiles.Count);
Assert.AreEqual("1234567890", response.SourceFiles[0].Id);
Assert.AreEqual("https://app.box.com/sign/ready-sign-link/59917816-c12b-4ef6-8f1d-aaaaaaa", response.ReadySignLink.Url);
}

[TestMethod]
public async Task GetSignTemplates_Success()
{
/** Arrange **/
IBoxRequest boxRequest = null;
Handler.Setup(h => h.ExecuteAsync<BoxCollectionMarkerBased<BoxSignTemplate>>(It.IsAny<IBoxRequest>()))
[TestMethod]
public async Task GetSignTemplates_Success()
{
/** Arrange **/
IBoxRequest boxRequest = null;
Handler.Setup(h => h.ExecuteAsync<BoxCollectionMarkerBased<BoxSignTemplate>>(It.IsAny<IBoxRequest>()))
.Returns(Task.FromResult<IBoxResponse<BoxCollectionMarkerBased<BoxSignTemplate>>>(new BoxResponse<BoxCollectionMarkerBased<BoxSignTemplate>>()
{
Status = ResponseStatus.Success,
ContentString = LoadFixtureFromJson("Fixtures/BoxSignTemplate/GetAllSignTemplates200.json")
}))
.Callback<IBoxRequest>(r => boxRequest = r);

/*** Act ***/
/*** Act ***/
BoxCollectionMarkerBased<BoxSignTemplate> response = await _signTemplatesManager.GetSignTemplatesAsync(1000, "JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii");

/*** Assert ***/
Expand All @@ -77,9 +77,9 @@ public async Task GetSignTemplates_Success()
Assert.AreEqual(RequestMethod.Get, boxRequest.Method);
Assert.AreEqual(new Uri("https://api.box.com/2.0/sign_templates?limit=1000&marker=JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"), boxRequest.AbsoluteUri);

// Response check
Assert.AreEqual(1, response.Entries.Count);
// Response check
Assert.AreEqual(1, response.Entries.Count);
Assert.AreEqual("93153068-5420-467b-b8ef-8e54bfb7be42", response.Entries[0].Id);
}
}
}
}
2 changes: 1 addition & 1 deletion Box.V2/Managers/IBoxSignTemplatesManager.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Threading.Tasks;
using System.Threading.Tasks;
using Box.V2.Models;
using Box.V2.Models.Request;

Expand Down
4 changes: 2 additions & 2 deletions Box.V2/Models/BoxSignTemplateAdditionalInfo.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
Expand Down Expand Up @@ -30,7 +30,7 @@ public class BoxSignTemplateAdditionalInfo
public class BoxSignTemplateAdditionalInfoRequired
{
public const string FieldSigners = "signers";

/// <summary>
/// Required signer fields.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion Box.V2/Models/BoxSignTemplateCustomBranding.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ public class BoxSignTemplateCustomBranding
[JsonProperty(PropertyName = FieldLogoUri)]
public virtual string LogoUri { get; private set; }
}
}
}
2 changes: 1 addition & 1 deletion Box.V2/Models/BoxSignTemplateReadySignLink.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
Expand Down

0 comments on commit 553912c

Please sign in to comment.