Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,26 @@ The format is based on [Keep a Changelog](http://keepachangelog.com)
and this project adheres to [Semantic Versioning](http://semver.org).

## [Unreleased] - TBD


## [1.2.0] - 2023-07-03
### Added
- Added Readme and License files to Nuget package
- `OAuth2Service`: added ability to configure token expiration time
- Added OAuth2 service to SignNow service container
- All the services can use custom HttpClient via constructor of class [#148](https://github.com/signnow/SignNow.NET/issues/148)
- Complex Text Tags support while upload document with Fields

### Changed
- `OAuth2Service` moved to `SignNow.Net.Services` namespace


## [1.1.1] - 2023-05-02
### Added
- Properties for sign invite that allows you to prefill text in the Signature field, allows for signers to use their saved signature, allows recipients reassign this invite to another email address, allow recipients decline the invite.
- Add support for field type `stamp` [#149](https://github.com/signnow/SignNow.NET/issues/149)


## [1.1.0] - 2023-01-23
### Added
- The `Thumbnail` property on `Model.SignNowDocument`, which allows you to get document thumbnails in small, medium and large image sizes
Expand All @@ -40,6 +46,7 @@ and this project adheres to [Semantic Versioning](http://semver.org).
### Changed
- `FieldJsonAttributes` added to `ISignNowFields` that allows you to get Field attributes


## [0.9.0] - 2021-07-07
### Added
- `IUserService.GetModifiedDocumentsAsync` that allows to get all modified documents for User
Expand All @@ -52,11 +59,13 @@ and this project adheres to [Semantic Versioning](http://semver.org).
- `IFolderService.RenameFolderAsync` that allows you to renames a folder.
- `IDocumentService.MoveDocumentAsync` that allows you to move the document to a specified folder.


## [0.8.0] - 2021-04-26
### Added
- `IDocumentService.CreateTemplateFromDocumentAsync` that allows to create template by flattening an existing document
- `IDocumentService.CreateDocumentFromTemplateAsync` that allows to create document from the template


## [0.7.0] - 2021-03-28
### Added
- `ISignInvite.CreateInviteAsync` that allows to create embedded signing invite for a document
Expand All @@ -66,6 +75,7 @@ and this project adheres to [Semantic Versioning](http://semver.org).
### Changed
- Changed JsonConverter for `Model.SignNowInvite` properties


## [0.6.0-beta] - 2020-11-17
### Added
- Carbon Copy for freeform invite and role-based invite [#106](https://github.com/signnow/SignNow.NET/issues/106)
Expand All @@ -87,6 +97,7 @@ and this project adheres to [Semantic Versioning](http://semver.org).
### Fixed
- Fixed `Models.FieldContents.RadiobuttonContent` converting error [#104](https://github.com/signnow/SignNow.NET/issues/104)


## [0.5.1-beta] - 2020-04-18
### Changed
- Upgraded netcore version from 2.x to 3.x for `SignNow.Net.Test`
Expand Down Expand Up @@ -172,8 +183,10 @@ and this project adheres to [Semantic Versioning](http://semver.org).
[create role-based invite]: https://github.com/signnow/SignNow.NET/blob/develop/README.md#create-role-based-invite
[create freeform invite]: https://github.com/signnow/SignNow.NET/blob/develop/README.md#create-freeform-invite


[Unreleased]: https://github.com/signnow/SignNow.NET/compare/1.1.0...HEAD
<!-- Links to compare changes from previous version vs new version -->
[Unreleased]: https://github.com/signnow/SignNow.NET/compare/1.2.0...HEAD
[1.1.1]: https://github.com/signnow/SignNow.NET/compare/1.1.1...1.2.0
[1.1.1]: https://github.com/signnow/SignNow.NET/compare/1.1.0...1.1.1
[1.1.0]: https://github.com/signnow/SignNow.NET/compare/1.0.0...1.1.0
[1.0.0]: https://github.com/signnow/SignNow.NET/compare/0.9.0...1.0.0
[0.9.0]: https://github.com/signnow/SignNow.NET/compare/0.8.0...0.9.0
Expand Down
2 changes: 1 addition & 1 deletion SignNow.Net.Examples/ExamplesRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public ExamplesRunner()
/// <summary>
/// Delete test document after test.
/// </summary>
public void DeleteTestDocument(string disposableDocumentId)
private void DeleteTestDocument(string disposableDocumentId)
{
if (string.IsNullOrEmpty(disposableDocumentId))
{
Expand Down
199 changes: 199 additions & 0 deletions SignNow.Net.Test/UnitTests/Models/ComplexTags/ComplexTagsTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
using System;
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SignNow.Net.Model.ComplexTags;

namespace UnitTests.Models.ComplexTags
{
[TestClass]
public class ComplexTagsTest
{
[TestMethod]
public void ShouldSerializeAttachmentsTag()
{
var tag = new AttachmentTag
{
Height = 100,
Width = 200,
Label = "label_name",
Required = true,
Role = "Role_1",
TagName = "attached document"
};

var expected = @"{
""type"": ""attachments"",
""label"": ""label_name"",
""tag_name"": ""attached document"",
""role"": ""Role_1"",
""required"": true,
""width"": 200,
""height"": 100
}";

Assert.That.JsonEqual(expected, tag);
}

[TestMethod]
public void ShouldSerializeCheckBoxTag()
{
var tag = new CheckBoxTag
{
Height = 12,
Width = 12,
Required = true,
Role = "CLIENT",
TagName = "CheckboxTagExample"
};

var expected = @"{
""type"": ""checkbox"",
""tag_name"": ""CheckboxTagExample"",
""role"": ""CLIENT"",
""required"": true,
""width"": 12,
""height"": 12
}";

Assert.That.JsonEqual(expected, tag);
}

[TestMethod]
public void ShouldSerializeDropdownTag()
{
var tag = new DropdownTag
{
TagName = "DropdownTagExample",
Role = "CLIENT",
Required = true,
EnumerationOptions = new List<string> {"All", "None"},
Width = 100,
Height = 15,
};

var expected = @"{
""type"": ""enumeration"",
""custom_defined_option"": false,
""enumeration_options"": [
""All"",
""None""
],
""tag_name"": ""DropdownTagExample"",
""role"": ""CLIENT"",
""required"": true,
""width"": 100,
""height"": 15
}";

Assert.That.JsonEqual(expected, tag);
}

[TestMethod]
public void ShouldSerializeHyperlinkTag()
{
var tag = new HyperlinkTag
{
TagName = "hyperlink_example",
PageNumber = 0,
Role = "CLIENT",
Name = "HyperlinkTagExampleUID",
Required = true,
Width = 100,
Height = 15,
Link = new Uri("https://signnow.com"),
Label = "signNow main page",
Hint = "click"
};

var expected = @"{
""type"": ""hyperlink"",
""page_number"": 0,
""name"": ""HyperlinkTagExampleUID"",
""link"": ""https://signnow.com"",
""hint"": ""click"",
""label"": ""signNow main page"",
""tag_name"": ""hyperlink_example"",
""role"": ""CLIENT"",
""required"": true,
""width"": 100,
""height"": 15
}";

Assert.That.JsonEqual(expected, tag);
}

[TestMethod]
public void ShouldSerializeInitialsTag()
{
var tag = new InitialsTag
{
TagName = "InitialsTagExample",
Role = "CLIENT",
Required = true,
Height = 15,
Width = 40,
};

var expected = @"{
""type"": ""initials"",
""tag_name"": ""InitialsTagExample"",
""role"": ""CLIENT"",
""required"": true,
""width"": 40,
""height"": 15
}";

Assert.That.JsonEqual(expected, tag);
}

[TestMethod]
public void ShouldSerializeSignatureTag()
{
var tag = new SignatureTag
{
TagName = "SignatureTagExample",
Role = "CLIENT",
Required = true,
Height = 15,
Width = 400,
};

var expected = @"{
""type"": ""signature"",
""tag_name"": ""SignatureTagExample"",
""role"": ""CLIENT"",
""required"": true,
""width"": 400,
""height"": 15
}";

Assert.That.JsonEqual(expected, tag);
}

[TestMethod]
public void ShouldSerializeTextTag()
{
var tag = new TextTag
{
TagName = "TextTagExample",
Role = "CLIENT",
Label = "Label1",
Required = true,
Height = 150,
Width = 400,
};

var expected = @"{
""type"": ""text"",
""label"": ""Label1"",
""tag_name"": ""TextTagExample"",
""role"": ""CLIENT"",
""required"": true,
""width"": 400,
""height"": 150
}";

Assert.That.JsonEqual(expected, tag);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SignNow.Net.Model.ComplexTags;

namespace UnitTests.Models.ComplexTags
{
[TestClass]
public class RadioButtonTagTest
{
[TestMethod]
public void ShouldProperSerialize()
{
var radioButton = new RadioButtonTag("Group_name")
{
TagName = "radio_group_1",
PageNumber = 0,
Role = "Signer 1",
Required = true,
X = 36,
Y = 246,
Width = 340,
Height = 13,
};

radioButton.AddOption("value-1", 0, 0);
radioButton.AddOption("value-2", 0, 14, 1);
radioButton.AddOption("value-3", 0, 28);

var expected = @"{
""type"":""radiobutton"",
""name"":""Group_name"",
""page_number"": 0,
""x"": 36,
""y"": 246,
""radio"": [
{
""page_number"": 0,
""x"": 36,
""y"": 246,
""width"": 13,
""height"": 13,
""value"": ""value-1"",
""checked"": 0,
""x-offset"": 0,
""y-offset"": 0
},
{
""page_number"": 0,
""x"": 36,
""y"": 246,
""width"": 13,
""height"": 13,
""value"": ""value-2"",
""checked"": 1,
""x-offset"": 0,
""y-offset"": 14
},
{
""page_number"": 0,
""x"": 36,
""y"": 246,
""width"": 13,
""height"": 13,
""value"": ""value-3"",
""checked"": 0,
""x-offset"": 0,
""y-offset"": 28
}
],
""tag_name"": ""radio_group_1"",
""role"": ""Signer 1"",
""required"": true,
""width"": 340,
""height"": 13
}";

Assert.That.JsonEqual(expected, radioButton);
}
}
}
Loading