Skip to content

Commit cbe0792

Browse files
authored
code cleanup (#367)
* code cleanup Release Notes for 3.9 * removed blank lines
1 parent 5a04cbd commit cbe0792

File tree

15 files changed

+75
-27
lines changed

15 files changed

+75
-27
lines changed

GitVersionConfig.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
next-version: 3.7.3
1+
next-version: 3.10.0
22
assembly-versioning-scheme: MajorMinorPatch
33
mode: ContinuousDeployment
44
build-metadata-padding: 0

ReleaseNotes.md

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,48 @@
1-
# 3.8.0 (12 March 2018)
2-
1+
# 3.9.0 (15 August 2018)
2+
3+
- [#366](https://github.com/mozts2005/ZendeskApi_v2/issues/366) - Do you support the new announced DDoS protection system? +Question
4+
- [#364](https://github.com/mozts2005/ZendeskApi_v2/pull/364) - Bump NUnit3TestAdapter from 3.9.0 to 3.10.0 in /src contributed by ([dependabot[bot]](https://github.com/apps/dependabot)) +dependencies
5+
- [#363](https://github.com/mozts2005/ZendeskApi_v2/pull/363) - Bump Microsoft.NET.Test.Sdk from 15.5.0 to 15.8.0 in /src contributed by ([dependabot[bot]](https://github.com/apps/dependabot)) +dependencies
6+
- [#362](https://github.com/mozts2005/ZendeskApi_v2/pull/362) - Bump MSBuild.Sdk.Extras from 1.0.9 to 1.6.46 in /src contributed by ([dependabot[bot]](https://github.com/apps/dependabot)) +dependencies
7+
- [#361](https://github.com/mozts2005/ZendeskApi_v2/pull/361) - Bump Newtonsoft.Json from 11.0.1 to 11.0.2 in /src contributed by ([dependabot[bot]](https://github.com/apps/dependabot)) +dependencies
8+
- [#359](https://github.com/mozts2005/ZendeskApi_v2/pull/359) - Bump NUnit from 3.9.0 to 3.10.1 in /src contributed by ([dependabot[bot]](https://github.com/apps/dependabot)) +dependencies
9+
- [#360](https://github.com/mozts2005/ZendeskApi_v2/pull/360) - Bump Microsoft.NETCore.UniversalWindowsPlatform from 5.4.1 to 6.1.7 in /src contributed by ([dependabot[bot]](https://github.com/apps/dependabot)) +dependencies
10+
- [#357](https://github.com/mozts2005/ZendeskApi_v2/issues/357) - Tickets.GetTicketsByViewID - int required, but must be long +More-Info-Needed
11+
- [#356](https://github.com/mozts2005/ZendeskApi_v2/pull/356) - Support incremental organization export contributed by Ben Emmett ([bcemmett](https://github.com/bcemmett)) +Enhancement
12+
- [#353](https://github.com/mozts2005/ZendeskApi_v2/issues/353) - Suddently my app stop work +Question
13+
- [#352](https://github.com/mozts2005/ZendeskApi_v2/issues/352) - Removal-of-support-for-TLS-protocol-versions-1-0-and-1-1 +Question
14+
- [#350](https://github.com/mozts2005/ZendeskApi_v2/issues/350) - TLS/1.0 Error +Question
15+
- [#349](https://github.com/mozts2005/ZendeskApi_v2/pull/349) - Fix Issue #345 + #337 + Fix UserTests that failed/was incorrectly implemented contributed by Rasmus Wulff Jensen ([rwjdk](https://github.com/rwjdk))
16+
- [#347](https://github.com/mozts2005/ZendeskApi_v2/pull/347) - Implementation of "Users.GetIncrementalUserExport" and "Users.GetIncrementalUserExportNextPage" (+Async versions) contributed by Rasmus Wulff Jensen ([rwjdk](https://github.com/rwjdk))
17+
- [#345](https://github.com/mozts2005/ZendeskApi_v2/issues/345) - Tickets.GetInrementalTicketExportAsync is spelled wrong and do not use the side-load options provided +fix
18+
- [#344](https://github.com/mozts2005/ZendeskApi_v2/pull/344) - Issue #330 + CRUD operations for Comments contributed by Rasmus Wulff Jensen ([rwjdk](https://github.com/rwjdk))
19+
- [#343](https://github.com/mozts2005/ZendeskApi_v2/pull/343) - Test "CanCreateTicketWithDueDate" can't run on PCs that use dd/MM/yyyy format contributed by Rasmus Wulff Jensen ([rwjdk](https://github.com/rwjdk))
20+
- [#342](https://github.com/mozts2005/ZendeskApi_v2/issues/342) - Can't sign Contributes Agreement
21+
- [#341](https://github.com/mozts2005/ZendeskApi_v2/issues/341) - Error Socket to connect zendesk
22+
- [#340](https://github.com/mozts2005/ZendeskApi_v2/issues/340) - Authentication Error +Question
23+
- [#338](https://github.com/mozts2005/ZendeskApi_v2/pull/338) - Bulk user delete support contributed by Devin Wall ([dm430](https://github.com/dm430))
24+
- [#337](https://github.com/mozts2005/ZendeskApi_v2/issues/337) - Missing field in ZendeskApi_v2.Models.Satisfaction.SatisfactionRating +Enhancement +help-wanted
25+
- [#336](https://github.com/mozts2005/ZendeskApi_v2/pull/336) - Add locale to categories contributed by Denis P. ([Lsdenis](https://github.com/Lsdenis))
26+
- [#335](https://github.com/mozts2005/ZendeskApi_v2/issues/335) - Issue with Tickets.GetAuditsAsync() +fix +More-Info-Needed
27+
- [#334](https://github.com/mozts2005/ZendeskApi_v2/pull/334) - Add netstandard2.0 as target framework contributed by Morten Brix Pedersen ([mbp](https://github.com/mbp)) +Enhancement
28+
- [#333](https://github.com/mozts2005/ZendeskApi_v2/issues/333) - Cannot set value for CustomField defined as drop-down type +Question
29+
- [#332](https://github.com/mozts2005/ZendeskApi_v2/issues/332) - Request: Get draft article/category/section
30+
- [#330](https://github.com/mozts2005/ZendeskApi_v2/issues/330) - Can you add ability to get the post comments ? +Enhancement
31+
- [#329](https://github.com/mozts2005/ZendeskApi_v2/issues/329) - Remove Microsoft.Bcl dependency for .net45 +Under-Review
32+
- [#328](https://github.com/mozts2005/ZendeskApi_v2/pull/328) - remove Microsoft.Net.Http dependency for .net4.5 contributed by Vlad Kurdzesau ([vlad-kurdesov](https://github.com/vlad-kurdesov))
33+
- [#315](https://github.com/mozts2005/ZendeskApi_v2/issues/315) - Dedicated method for user incremental export +Enhancement +help-wanted
34+
- [#235](https://github.com/mozts2005/ZendeskApi_v2/issues/235) - .net core support? +Enhancement +In-progress
35+
36+
Commits: 3094b3d604...e6fae0a245
37+
38+
39+
# v3.8.0 (12 March 2018)
40+
41+
- [#327](https://github.com/mozts2005/ZendeskApi_v2/pull/327) - Release v3.8 contributed by Elizabeth Schneider ([mozts2005](https://github.com/mozts2005))
42+
- [#326](https://github.com/mozts2005/ZendeskApi_v2/pull/326) - updated unit test contributed by Elizabeth Schneider ([mozts2005](https://github.com/mozts2005))
43+
- [#325](https://github.com/mozts2005/ZendeskApi_v2/pull/325) - Adding support for pagination in GetUsersInOrganization in the Users … contributed by Jean-Michel Provencher ([jmprovencher](https://github.com/jmprovencher)) +Enhancement
44+
- [#322](https://github.com/mozts2005/ZendeskApi_v2/issues/322) - PlatfromNotSupportedException in UWP Windows 10 app in .NET Native compilation mode +Enhancement
45+
- [#317](https://github.com/mozts2005/ZendeskApi_v2/issues/317) - Request Class is missing Type +fix +In-progress
346
- [#325](https://github.com/mozts2005/ZendeskApi_v2/pull/325) - Adding support for pagination in GetUsersInOrganization in the Users … contributed by Jean-Michel Provencher ([jmprovencher](https://github.com/jmprovencher)) +Enhancement
447
- [#324](https://github.com/mozts2005/ZendeskApi_v2/pull/324) - added UWP Support contributed by Elizabeth Schneider ([mozts2005](https://github.com/mozts2005))
548
- [#323](https://github.com/mozts2005/ZendeskApi_v2/pull/323) - added UWP Support contributed by Elizabeth Schneider ([mozts2005](https://github.com/mozts2005))
@@ -11,7 +54,7 @@
1154
- [#302](https://github.com/mozts2005/ZendeskApi_v2/issues/302) - Help Center Access Policies will be deprecated +fix
1255
- [#299](https://github.com/mozts2005/ZendeskApi_v2/issues/299) - GetArticlesBySectionId returns 0 results
1356

14-
Commits: a2af9c43c3...424470954e
57+
Commits: a2af9c43c3...8ecd5e1d8d
1558

1659

1760
# 3.7.2 (27 November 2017)

src/ZendeskApi_v2/Core.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public class Core : ICore
4949
protected string Password;
5050
protected string ZendeskUrl;
5151
protected string ApiToken;
52-
JsonSerializerSettings jsonSettings = new JsonSerializerSettings
52+
private readonly JsonSerializerSettings jsonSettings = new JsonSerializerSettings
5353
{
5454
NullValueHandling = NullValueHandling.Ignore,
5555
DateParseHandling = DateParseHandling.DateTimeOffset,
@@ -421,7 +421,7 @@ public async Task<RequestResult> RunRequestAsync(string resource, string request
421421
var content = string.Empty;
422422
using (var responseStream = response.GetResponseStream())
423423
{
424-
424+
425425
using (var sr = new StreamReader(responseStream))
426426
{
427427
content = await sr.ReadToEndAsync();
@@ -608,8 +608,7 @@ private WebException GetWebException(string resource, object body, WebException
608608

609609
if (body != null)
610610
{
611-
var zenFile = body as ZenFile;
612-
if (zenFile == null)
611+
if (!(body is ZenFile zenFile))
613612
{
614613
bodyMessage = $" Body: {JsonConvert.SerializeObject(body, Formatting.Indented, jsonSettings)}";
615614
}

src/ZendeskApi_v2/Requests/Users.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -332,13 +332,13 @@ public GroupUserResponse GetUsersInOrganization(long id, int? perPage = null, in
332332

333333
public IndividualUserResponse CreateUser(User user)
334334
{
335-
var body = new { user = user };
335+
var body = new { user };
336336
return GenericPost<IndividualUserResponse>("users.json", body);
337337
}
338338

339339
public JobStatusResponse BulkCreateUsers(IEnumerable<User> users)
340340
{
341-
var body = new { users = users };
341+
var body = new { users };
342342
return GenericPost<JobStatusResponse>("users/create_many.json", body);
343343
}
344344

@@ -350,7 +350,7 @@ public IndividualUserResponse SuspendUser(long id)
350350

351351
public IndividualUserResponse UpdateUser(User user)
352352
{
353-
var body = new { user = user };
353+
var body = new { user };
354354
return GenericPut<IndividualUserResponse>($"users/{user.Id}.json", body);
355355
}
356356

@@ -569,13 +569,13 @@ public async Task<GroupUserResponse> GetUsersInOrganizationAsync(long id, int? p
569569

570570
public async Task<IndividualUserResponse> CreateUserAsync(User user)
571571
{
572-
var body = new { user = user };
572+
var body = new { user };
573573
return await GenericPostAsync<IndividualUserResponse>("users.json", body);
574574
}
575575

576576
public async Task<JobStatusResponse> BulkCreateUsersAsync(IEnumerable<User> users)
577577
{
578-
var body = new { users = users };
578+
var body = new { users };
579579
return await GenericPostAsync<JobStatusResponse>("users/create_many.json", body);
580580
}
581581

@@ -587,7 +587,7 @@ public async Task<IndividualUserResponse> SuspendUserAsync(long id)
587587

588588
public async Task<IndividualUserResponse> UpdateUserAsync(User user)
589589
{
590-
var body = new { user = user };
590+
var body = new { user };
591591
return await GenericPutAsync<IndividualUserResponse>($"users/{user.Id}.json", body);
592592
}
593593

test/ZendeskApi_v2.Test/HelpCenter/CommentTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace Tests
1111
public class CommentTests
1212
{
1313
private ZendeskApi api = new ZendeskApi(Settings.Site, Settings.AdminEmail, Settings.AdminPassword);
14-
private long _testSectionIdForCommentsTest = 360000205286; //https://csharpapi.zendesk.com/hc/en-us/sections/360000205286-Test-Section-For-Comment-Tests
14+
private readonly long _testSectionIdForCommentsTest = 360000205286; //https://csharpapi.zendesk.com/hc/en-us/sections/360000205286-Test-Section-For-Comment-Tests
1515
private long _testTopicIdForCommentsTest = 360000016546; //https://csharpapi.zendesk.com/hc/en-us/community/topics/360000016546-Test-Topic-For-Comment-Tests
1616

1717
[OneTimeSetUp]

test/ZendeskApi_v2.Test/HelpCenter/TranslationTests.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,7 @@ public void CanListAllEnabledLocales()
189189
{
190190
//the only two locales enabled on the test site are us-en and fr. us-en is the default.
191191
//note: FR was already enabled in the Zendesk settings, however it had to be enabled again in the help center preferences.
192-
string default_locale;
193-
var res = api.HelpCenter.Translations.ListAllEnabledLocalesAndDefaultLocale(out default_locale);
192+
var res = api.HelpCenter.Translations.ListAllEnabledLocalesAndDefaultLocale(out var default_locale);
194193

195194
Assert.AreEqual(default_locale, "en-us");
196195
Assert.IsTrue(res.Contains("en-us"));

test/ZendeskApi_v2.Test/HelpCenter/VoteTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace Tests.HelpCenter
1010
public class VoteTests
1111
{
1212
private ZendeskApi api = new ZendeskApi(Settings.Site, Settings.AdminEmail, Settings.AdminPassword);
13-
private long _articleIdWithVotes = 204838115; //https://csharpapi.zendesk.com/hc/en-us/articles/204838115-Thing-4?page=1#comment_200486479
13+
private readonly long _articleIdWithVotes = 204838115; //https://csharpapi.zendesk.com/hc/en-us/articles/204838115-Thing-4?page=1#comment_200486479
1414

1515
[Test]
1616
public void CanGetArticleVotes()

test/ZendeskApi_v2.Test/OrganizationTests.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,11 @@ public void CanCreateManyAndDeleteOrganizationMemberships()
167167

168168
Assert.Greater(res.User.Id, 0);
169169

170-
var memberships = new List<OrganizationMembership>();
171-
memberships.Add(new OrganizationMembership() { UserId = res.User.Id, OrganizationId = org.Organization.Id });
172-
memberships.Add(new OrganizationMembership() { UserId = res.User.Id, OrganizationId = org2.Organization.Id });
170+
var memberships = new List<OrganizationMembership>
171+
{
172+
new OrganizationMembership() { UserId = res.User.Id, OrganizationId = org.Organization.Id },
173+
new OrganizationMembership() { UserId = res.User.Id, OrganizationId = org2.Organization.Id }
174+
};
173175

174176
var job = api.Organizations.CreateManyOrganizationMemberships(memberships).JobStatus;
175177

test/ZendeskApi_v2.Test/TicketTests.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
using NUnit.Framework;
1010
using ZendeskApi_v2;
1111
using ZendeskApi_v2.Extensions;
12+
using ZendeskApi_v2.Models.Brands;
1213
using ZendeskApi_v2.Models.Constants;
1314
using ZendeskApi_v2.Models.Shared;
1415
using ZendeskApi_v2.Models.Tickets;
1516
using ZendeskApi_v2.Requests;
16-
using ZendeskApi_v2.Models.Brands;
1717

1818
namespace Tests
1919
{
@@ -22,7 +22,7 @@ namespace Tests
2222
public class TicketTests
2323
{
2424
private ZendeskApi api = new ZendeskApi(Settings.Site, Settings.AdminEmail, Settings.AdminPassword);
25-
private TicketSideLoadOptionsEnum ticketSideLoadOptions = TicketSideLoadOptionsEnum.Users | TicketSideLoadOptionsEnum.Organizations | TicketSideLoadOptionsEnum.Groups;
25+
private readonly TicketSideLoadOptionsEnum ticketSideLoadOptions = TicketSideLoadOptionsEnum.Users | TicketSideLoadOptionsEnum.Organizations | TicketSideLoadOptionsEnum.Groups;
2626

2727
[OneTimeTearDown]
2828
public async Task TestCleanUp()
@@ -734,6 +734,7 @@ public void CanGetIncrementalTicketExportPaged()
734734
[Test]
735735
public void CanGetIncrementalTicketExportWithUsersSideLoadPaged()
736736
{
737+
Thread.Sleep(60000);
737738
const int maxTicketsPerPage = 1000;
738739

739740
var res = api.Tickets.GetIncrementalTicketExport(DateTime.Now.AddDays(-365), TicketSideLoadOptionsEnum.Users);
@@ -742,7 +743,7 @@ public void CanGetIncrementalTicketExportWithUsersSideLoadPaged()
742743
Assert.IsTrue(res.Users.Count > 0);
743744
Assert.That(res.NextPage, Is.Not.Null.Or.Empty);
744745

745-
res = this.api.Tickets.GetIncrementalTicketExportNextPage(res.NextPage);
746+
res = api.Tickets.GetIncrementalTicketExportNextPage(res.NextPage);
746747

747748
Assert.IsTrue(res.Tickets.Count > 0);
748749
Assert.IsTrue(res.Users.Count > 0);
@@ -751,6 +752,8 @@ public void CanGetIncrementalTicketExportWithUsersSideLoadPaged()
751752
[Test]
752753
public void CanGetIncrementalTicketExportWithGroupsSideLoadPaged()
753754
{
755+
Thread.Sleep(60000);
756+
754757
const int maxTicketsPerPage = 1000;
755758

756759
var res = api.Tickets.GetIncrementalTicketExport(DateTime.Now.AddDays(-700), TicketSideLoadOptionsEnum.Groups);
@@ -759,7 +762,7 @@ public void CanGetIncrementalTicketExportWithGroupsSideLoadPaged()
759762
Assert.IsTrue(res.Groups.Count > 0);
760763
Assert.That(res.NextPage, Is.Not.Null.Or.Empty);
761764

762-
res = this.api.Tickets.GetIncrementalTicketExportNextPage(res.NextPage);
765+
res = api.Tickets.GetIncrementalTicketExportNextPage(res.NextPage);
763766

764767
Assert.IsTrue(res.Tickets.Count > 0);
765768
Assert.IsTrue(res.Groups.Count > 0);

test/ZendeskApi_v2.Test/UserTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,8 @@ public void CanGetIncrementalUserExport()
515515
[Test]
516516
public void CanGetIncrementalUserExportWithSideLoadOptions()
517517
{
518+
Thread.Sleep(60000);
519+
518520
var incrementalUserExport = api.Users.GetIncrementalUserExport(DateTimeOffset.MinValue, UserSideLoadOptions.Organizations | UserSideLoadOptions.Groups | UserSideLoadOptions.Identities);
519521
Assert.That(incrementalUserExport.Users.Count, Is.GreaterThan(0));
520522
Assert.That(incrementalUserExport.Organizations, Is.Not.Null);

0 commit comments

Comments
 (0)