Skip to content

Commit 8dbc957

Browse files
authored
Merge pull request #69 from CallFire/nunit
Nunit upgrade
2 parents 01967e3 + b45a746 commit 8dbc957

37 files changed

+497
-468
lines changed

CallfireApiClient.nuspec

Lines changed: 108 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?><package>
22
<metadata>
33
<id>CallfireApiClient</id>
4-
<version>1.1.28</version>
4+
<version>1.1.29</version>
55
<title>CallFire API v2 client</title>
66
<authors>
77
Vladimir Mikhailov
@@ -13,111 +13,114 @@
1313
<iconUrl>https://www.callfire.com/favicon.ico</iconUrl>
1414
<requireLicenseAcceptance>false</requireLicenseAcceptance>
1515
<description>C# client library for integration with Callfire REST API v2 services</description>
16-
<releaseNotes>
17-
Callfire API client Changelog
18-
=============================
19-
Version 1.1.28 - March 06 2019
20-
- added date interval filtering parameters to broadcasts lookup
21-
22-
Version 1.1.27 - Feb 28 2019
23-
- fixed isssue with Broadcast Status enum
24-
25-
Version 1.1.26 - Jan 17 2019
26-
- updated RestSharp version to 106.6
27-
28-
Version 1.1.24 - Oct 17 2018
29-
- removed potential security vulnerability connected with DotNetZip library
30-
31-
Version 1.1.23 - Sept 26 2018
32-
- added findMedia API operation to sdk
33-
34-
Version 1.1.22 - Sept 04 2018
35-
- updated version of RestSharp client to 106.3.0
36-
- downgraded version of .NET framework to 4.6
37-
38-
Version 1.1.21 - August 10 2018
39-
- added StrongNamer library to sign unsigned assembly in a nuget package
40-
41-
Version 1.1.20 - August 1 2018
42-
- updated .NET framework target version to latest for support TLS 1.2 by default
43-
44-
Version 1.1.19 - Jun 13 2017
45-
- added fromNumber to Recipient object for sending calls/texts
46-
- added strictValidation flag for adding contacts to broadcast
47-
- added useCustomFields to createContactList/addContactListContacts apis
48-
- added media array parameter for TextRecipient
49-
- added a way to upload files from byte array for media and campaign sounds api
50-
51-
Version 1.1.18 - May 29 2017
52-
- upgraded dependencies
53-
54-
Version 1.1.17 - May 4 2017
55-
- removed subscriptions api (not supported from v2 api client)
56-
- fixed findWebhooks api to use enums instead strings
57-
- trivial tests fixes
58-
59-
Version 1.1.16 - Mar 28 2017
60-
- fixed DayOfWeek enum for scheduler
61-
62-
Version 1.1.15 - Jan 27 2017
63-
- added dnc apis
64-
65-
Version 1.1.14 - Jan 17 2017
66-
- added possibility to use client without config file
67-
68-
Version 1.1.13 - Dec 30 2016
69-
- minor fixes for get contacts history api
70-
71-
Version 1.1.12 - Dec 28 2016
72-
- updated CallRecord dto to include originateTime, answerTime, duration, callerName and switchId fields
73-
- updated Webhook dto to include singleUse parameter
74-
- minor extension of requests objects for upload and find sounds api, get contacts history api and find tollfree numbers api
75-
- temporary turning dnc api off due to full remake of callfire dnc apis
76-
77-
Version 1.1.11 - Nov 18 2016
78-
- added deleteCampaignSound api
79-
- added getCreditsHistory api
80-
- remove dnc lists api (not supported anymore)
81-
82-
Version 1.1.10 - Oct 26 2016
83-
- added more parameters to call tracking config in Number Lease config object
84-
85-
Version 1.1.9 - Jul 11 2016
86-
- added loading labels parameter in Number Lease objects
87-
88-
Version 1.1.8 - May 27 2016
89-
- defaultLiveMessage, defaultMachineMessage, defaultLiveMessageSoundId, defaultMachineMessageSoundId, defaultVoice params added to send calls api
90-
- added batch id filter parameter for get broadcast calls/texts
91-
- added fields filter parameter for add sound via call, returns CampaignSound object
92-
- added fields filter parameter for add sound via text-to-speech, returns CampaignSound object
93-
- defaultMessage parameter added to send texts function
94-
- added findWebhookResource and findWebhookResources methods to use new webhooks apis
95-
- resumeNextDay parameter added to CallBroadcast object
96-
- transferMessage, transferMessageSoundId, transferDigit, transferNumber params added to CallRecipient object for sending calls and texts
97-
- added questionResponses parameter to CallRecord object
98-
- added duplicate parameter to CampaignSound object
99-
- get call recordings api functions implemented in CallsApi
100-
101-
Version 1.1.7 - Apr 18 2016
102-
- migration to 4.5 net framework
103-
- migration to gradle
104-
105-
Version 1.1.6 - Mar 25 2016
106-
- added mono debug files generation on Windows platform
107-
- removed get/update batch api calls from TextBroadcastsApi
108-
109-
Version 1.1.5 - Mar 14 2016
110-
- added debug support for Mono platform
111-
- fixed issue with uploading mp3 media
112-
113-
Version 1.1.4 - Mar 4 2016
114-
- added proxy with basic authorization support, see out docs how to configure it.
115-
116-
Version 1.1.3 - Feb 16 2016
117-
- added nuget symbolsource package to debug source code.
16+
<releaseNotes>Callfire API client Changelog
17+
=============================
18+
Version 1.1.29 - May 29 2019
19+
- dependecies upgraded (Nunit to v3)
20+
- added allowedVersions for dependencies
11821

119-
Version 1.1.2 - Jan 27 2016
120-
- added find by batchId parameter to FindCalls &amp; FindTexts requests.
22+
Version 1.1.28 - March 06 2019
23+
- added date interval filtering parameters to broadcasts lookup
24+
25+
Version 1.1.27 - Feb 28 2019
26+
- fixed isssue with Broadcast Status enum
27+
28+
Version 1.1.26 - Jan 17 2019
29+
- updated RestSharp version to 106.6
30+
31+
Version 1.1.24 - Oct 17 2018
32+
- removed potential security vulnerability connected with DotNetZip library
33+
34+
Version 1.1.23 - Sept 26 2018
35+
- added findMedia API operation to sdk
36+
37+
Version 1.1.22 - Sept 04 2018
38+
- updated version of RestSharp client to 106.3.0
39+
- downgraded version of .NET framework to 4.6
40+
41+
Version 1.1.21 - August 10 2018
42+
- added StrongNamer library to sign unsigned assembly in a nuget package
43+
44+
Version 1.1.20 - August 1 2018
45+
- updated .NET framework target version to latest for support TLS 1.2 by default
46+
47+
Version 1.1.19 - Jun 13 2017
48+
- added fromNumber to Recipient object for sending calls/texts
49+
- added strictValidation flag for adding contacts to broadcast
50+
- added useCustomFields to createContactList/addContactListContacts apis
51+
- added media array parameter for TextRecipient
52+
- added a way to upload files from byte array for media and campaign sounds api
53+
54+
Version 1.1.18 - May 29 2017
55+
- upgraded dependencies
56+
57+
Version 1.1.17 - May 4 2017
58+
- removed subscriptions api (not supported from v2 api client)
59+
- fixed findWebhooks api to use enums instead strings
60+
- trivial tests fixes
61+
62+
Version 1.1.16 - Mar 28 2017
63+
- fixed DayOfWeek enum for scheduler
64+
65+
Version 1.1.15 - Jan 27 2017
66+
- added dnc apis
67+
68+
Version 1.1.14 - Jan 17 2017
69+
- added possibility to use client without config file
70+
71+
Version 1.1.13 - Dec 30 2016
72+
- minor fixes for get contacts history api
73+
74+
Version 1.1.12 - Dec 28 2016
75+
- updated CallRecord dto to include originateTime, answerTime, duration, callerName and switchId fields
76+
- updated Webhook dto to include singleUse parameter
77+
- minor extension of requests objects for upload and find sounds api, get contacts history api and find tollfree numbers api
78+
- temporary turning dnc api off due to full remake of callfire dnc apis
79+
80+
Version 1.1.11 - Nov 18 2016
81+
- added deleteCampaignSound api
82+
- added getCreditsHistory api
83+
- remove dnc lists api (not supported anymore)
84+
85+
Version 1.1.10 - Oct 26 2016
86+
- added more parameters to call tracking config in Number Lease config object
87+
88+
Version 1.1.9 - Jul 11 2016
89+
- added loading labels parameter in Number Lease objects
90+
91+
Version 1.1.8 - May 27 2016
92+
- defaultLiveMessage, defaultMachineMessage, defaultLiveMessageSoundId, defaultMachineMessageSoundId, defaultVoice params added to send calls api
93+
- added batch id filter parameter for get broadcast calls/texts
94+
- added fields filter parameter for add sound via call, returns CampaignSound object
95+
- added fields filter parameter for add sound via text-to-speech, returns CampaignSound object
96+
- defaultMessage parameter added to send texts function
97+
- added findWebhookResource and findWebhookResources methods to use new webhooks apis
98+
- resumeNextDay parameter added to CallBroadcast object
99+
- transferMessage, transferMessageSoundId, transferDigit, transferNumber params added to CallRecipient object for sending calls and texts
100+
- added questionResponses parameter to CallRecord object
101+
- added duplicate parameter to CampaignSound object
102+
- get call recordings api functions implemented in CallsApi
103+
104+
Version 1.1.7 - Apr 18 2016
105+
- migration to 4.5 net framework
106+
- migration to gradle
107+
108+
Version 1.1.6 - Mar 25 2016
109+
- added mono debug files generation on Windows platform
110+
- removed get/update batch api calls from TextBroadcastsApi
111+
112+
Version 1.1.5 - Mar 14 2016
113+
- added debug support for Mono platform
114+
- fixed issue with uploading mp3 media
115+
116+
Version 1.1.4 - Mar 4 2016
117+
- added proxy with basic authorization support, see out docs how to configure it.
118+
119+
Version 1.1.3 - Feb 16 2016
120+
- added nuget symbolsource package to debug source code.
121+
122+
Version 1.1.2 - Jan 27 2016
123+
- added find by batchId parameter to FindCalls &amp; FindTexts requests.
121124
- fixed NumberApi.findNumbersLocal and NumberApi.findNumbersTollfree methods to accept an updated server responses
122125

123126
Version 1.1.1 - Jan 25 2016

Changelog.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
Callfire API client Changelog
22
=============================
3+
Version 1.1.29 - May 29 2019
4+
- dependecies upgraded (Nunit to v3)
5+
- added allowedVersions for dependencies
6+
37
Version 1.1.28 - March 06 2019
48
- added date interval filtering parameters to broadcasts lookup
59

README.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ C# client for Callfire platform API version 2. See link:https://developers.callf
77
* .NET 4.6+
88
99
.*Dependencies:*
10-
* Newtonsoft.Json >= 7.0.1
11-
* RestSharp >= 106.4.2
10+
* Newtonsoft.Json >= 12.0.2
11+
* RestSharp = 106.6.4 (RestSharp have a bug with serialization to camelCase json string, wait for fix https://github.com/restsharp/RestSharp/issues/1251 before upgrade to newer)
1212
1313
.*Table of contents*
1414
* link:https://developers.callfire.com/callfire-api-client-csharp.html[Getting Started]

build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ plugins {
1515
}
1616

1717
archivesBaseName = 'callfire-api-client'
18+
ext['nunitConsoleVersion'] = '3.6.1'
1819
ext['buildReleaseConfiguration'] = "CallfireApiClient"
1920
ext['buildReleaseConfiguration'] = "Release"
2021
ext['buildDebugConfiguration'] = "Debug"
@@ -45,6 +46,7 @@ task msbuildDebug (type: com.ullink.Msbuild) {
4546
msbuildDebug.dependsOn nunit
4647

4748
nunit {
49+
nunitVersion = nunitConsoleVersion
4850
testAssemblies = [ msbuild.projects['CallfireApiClient.Tests'].properties.TargetPath ]
4951
}
5052
nunit.dependsOn msbuild
@@ -162,6 +164,7 @@ task msbuildForIntegrationTests (type: com.ullink.Msbuild) {
162164
msbuildForIntegrationTests.dependsOn prepareTestData
163165

164166
task integrationTests (type: com.ullink.gradle.nunit.NUnit) {
167+
nunitVersion = nunitConsoleVersion
165168
testAssemblies = [ msbuild.projects['CallfireApiClient.IntegrationTests'].properties.TargetPath ]
166169
}
167170
integrationTests.dependsOn msbuildForIntegrationTests

src/CallfireApiClient.IntegrationTests/Api/AbstractIntegrationTest.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
using System;
1+
using NUnit.Framework;
2+
using System;
23
using System.Configuration;
3-
4+
using System.IO;
45

56
namespace CallfireApiClient.IntegrationTests.Api
67
{
@@ -38,6 +39,11 @@ private void ReadAllSettings()
3839
Console.WriteLine("Error reading app settings");
3940
}
4041
}
42+
43+
public static string GetFullPath(string path)
44+
{
45+
return Directory.GetParent(TestContext.CurrentContext.TestDirectory).Parent.FullName + path;
46+
}
4147
}
4248
}
4349

src/CallfireApiClient.IntegrationTests/Api/CallsTexts/CallsApiIntegrationTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public void GetCallRecording()
101101
[Test]
102102
public void GetCallRecordingInMp3Format()
103103
{
104-
string mp3FilePath = "Resources/File-examples/testDownloadRecordingById.mp3";
104+
string mp3FilePath = GetFullPath("/Resources/File-examples/testDownloadRecordingById.mp3");
105105
MemoryStream ms = (MemoryStream)Client.CallsApi.GetCallRecordingMp3(64837518003);
106106
File.WriteAllBytes(mp3FilePath, ms.ToArray());
107107
}
@@ -139,7 +139,7 @@ public void GetCallRecordingByName()
139139
public void CallRecordingMp3ByName()
140140
{
141141
CallRecording rec = Client.CallsApi.GetCallRecording(18666772003);
142-
string mp3FilePath = "Resources/File-examples/testDownloadRecordingByName.mp3";
142+
string mp3FilePath = GetFullPath("/Resources/File-examples/testDownloadRecordingByName.mp3");
143143
MemoryStream ms = (MemoryStream)Client.CallsApi.GetCallRecordingMp3ByName((long) rec.CallId, rec.Name);
144144
File.WriteAllBytes(mp3FilePath, ms.ToArray());
145145
}

src/CallfireApiClient.IntegrationTests/Api/CallsTexts/MediaApiIntegrationTest.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ namespace CallfireApiClient.IntegrationTests.Api.CallsTexts
1010
[TestFixture]
1111
public class MediaApiIntegrationTest : AbstractIntegrationTest
1212
{
13-
private const string mp3FilePath = "Resources/File-examples/train1.mp3";
14-
private const string wavFilePath = "Resources/File-examples/train1.wav";
15-
private const string cfLogoFilePath = "Resources/File-examples/cf.png";
16-
private const string ezLogoFilePath = "Resources/File-examples/ez.png";
13+
private string mp3FilePath = GetFullPath("/Resources/File-examples/train1.mp3");
14+
private string wavFilePath = GetFullPath("/Resources/File-examples/train1.wav");
15+
private string cfLogoFilePath = GetFullPath("/Resources/File-examples/cf.png");
16+
private string ezLogoFilePath = GetFullPath("/Resources/File-examples/ez.png");
1717

1818
[Test]
1919
public void TestFind()
@@ -49,9 +49,10 @@ public void TestUpload()
4949
[Test]
5050
public void TestUploadWithFileData()
5151
{
52-
String soundName = "mp3_test_" + DateTime.Now.Millisecond.ToString();
53-
ResourceId wavResourceId = Client.MediaApi.Upload(File.ReadAllBytes(wavFilePath), MediaType.WAV);
54-
ResourceId mp3ResourceId = Client.MediaApi.Upload(File.ReadAllBytes(mp3FilePath), MediaType.MP3, soundName);
52+
string mp3Name = "mp3_test_" + DateTime.Now.Millisecond.ToString();
53+
string wavName = "wav_test_" + DateTime.Now.Millisecond.ToString();
54+
ResourceId wavResourceId = Client.MediaApi.Upload(File.ReadAllBytes(wavFilePath), MediaType.WAV, wavName);
55+
ResourceId mp3ResourceId = Client.MediaApi.Upload(File.ReadAllBytes(mp3FilePath), MediaType.MP3, mp3Name);
5556
Assert.NotNull(mp3ResourceId.Id);
5657
}
5758

src/CallfireApiClient.IntegrationTests/Api/Campaigns/CampaignSoundsApiIntegrationTest.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public void TestFind()
3636
public void TestUploadSoundAndDeleteIt()
3737
{
3838
String soundName = "mp3_test_" + DateTime.Now.ToString();
39-
string mp3FilePath = "Resources/File-examples/train1.mp3";
39+
string mp3FilePath = GetFullPath("/Resources/File-examples/train1.mp3");
4040
CampaignSound campaignSound = Client.CampaignSoundsApi.UploadAndGetSoundDetails(mp3FilePath, soundName);
4141
Assert.NotNull(campaignSound.Id);
4242

@@ -52,7 +52,7 @@ public void TestUploadSoundAndDeleteIt()
5252
public void TestUploadSoundWithFileDataAndDeleteIt()
5353
{
5454
String soundName = "mp3_test_" + DateTime.Now.ToString();
55-
string mp3FilePath = "Resources/File-examples/train1.mp3";
55+
string mp3FilePath = GetFullPath("/Resources/File-examples/train1.mp3");
5656
CampaignSound campaignSound = Client.CampaignSoundsApi.UploadAndGetSoundDetails(File.ReadAllBytes(mp3FilePath), soundName);
5757
Assert.NotNull(campaignSound.Id);
5858

@@ -88,8 +88,8 @@ public void TestUploadMp3WavFilesAndGetThem()
8888
{
8989
String soundName = "mp3_test_" + DateTime.Now.ToString();
9090

91-
string mp3FilePath = "Resources/File-examples/train1.mp3";
92-
string wavFilePath = "Resources/File-examples/train1.wav";
91+
string mp3FilePath = GetFullPath("/Resources/File-examples/train1.mp3");
92+
string wavFilePath = GetFullPath("/Resources/File-examples/train1.wav");
9393
ResourceId mp3ResourceId = Client.CampaignSoundsApi.Upload(mp3FilePath, soundName);
9494
ResourceId wavResourceId = Client.CampaignSoundsApi.Upload(wavFilePath);
9595

@@ -105,13 +105,13 @@ public void TestUploadMp3WavFilesAndGetThem()
105105

106106
// get mp3
107107
MemoryStream ms = (MemoryStream)Client.CampaignSoundsApi.GetMp3(mp3ResourceId.Id);
108-
string existingFilePath = Path.GetFullPath("Resources/File-examples/train1.mp3");
108+
string existingFilePath = GetFullPath("/Resources/File-examples/train1.mp3");
109109
string pathToSaveNewFile = existingFilePath.Replace("train.mp3", "mp3_sound.mp3");
110110
File.WriteAllBytes(pathToSaveNewFile, ms.ToArray());
111111

112112
// get wav
113113
ms = (MemoryStream)Client.CampaignSoundsApi.GetWav(wavResourceId.Id);
114-
existingFilePath = Path.GetFullPath("Resources/File-examples/train1.wav");
114+
existingFilePath = GetFullPath("/Resources/File-examples/train1.wav");
115115
pathToSaveNewFile = existingFilePath.Replace("train.wav", "wav_sound.wav");
116116
File.WriteAllBytes(pathToSaveNewFile, ms.ToArray());
117117

src/CallfireApiClient.IntegrationTests/Api/Campaigns/TextBroadcastsApiIntegrationTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public void AddRecipientsAndAddRemoveBatches()
151151
var texts = Client.TextBroadcastsApi.AddRecipients((long)id, recipients, null, true);
152152
Console.WriteLine(texts);
153153
Assert.AreEqual(2, texts.Count);
154-
Assert.That(texts[0].Message, Is.StringStarting("test_msg"));
154+
Assert.That(texts[0].Message, Does.StartWith("test_msg"));
155155

156156
// get batches
157157
var getBatchesRequest = new GetByIdRequest { Id = id };

0 commit comments

Comments
 (0)