From 53e76aad492f57535c4b54a64e9fddde00dd5792 Mon Sep 17 00:00:00 2001 From: Chad Tolkien Date: Thu, 28 Jan 2016 14:15:49 +1100 Subject: [PATCH] rename and namespace update --- README.md | 8 ++++---- src/TinyPNG/ResizeOperation.cs | 2 +- src/TinyPNG/Responses/ApiErrorResponse.cs | 2 +- src/TinyPNG/Responses/TinyPngCompressResponse.cs | 2 +- src/TinyPNG/Responses/TinyPngResizeResponse.cs | 2 +- src/TinyPNG/Responses/TinyPngResponse.cs | 2 +- src/TinyPNG/TinyPng.cs | 8 ++++---- src/TinyPNG/TinyPngApiException.cs | 2 +- src/TinyPNG/TinyPngApiResult.cs | 2 +- tests/TinyPng.Tests/TinyPngTests.cs | 7 ++++--- 10 files changed, 19 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index c80abcc..29bada5 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Install via Nuget ## Compressing Image ```csharp -using (var png = new TinyPng("yourSecretApiKey")) +using (var png = new TinyPngClient("yourSecretApiKey")) { var compressResult = await png.Compress("pathToFile or byte array or stream)"); @@ -33,7 +33,7 @@ using (var png = new TinyPng("yourSecretApiKey")) } ``` -Further details about the result of the compression are also available on the `Input` and `Output` properties. +Further details about the result of the compression are also available on the `Input` and `Output` properties. Some examples: ```csharp //old size @@ -50,7 +50,7 @@ Further details about the result of the compression are also available on the `I ## Resizing Images ```csharp -using (var png = new TinyPng("yourSecretApiKey")) +using (var png = new TinyPngClient("yourSecretApiKey")) { var compressResult = await png.Compress("pathToFile or byte array or stream)"); @@ -68,7 +68,7 @@ TinyPNG. We also include strongly type resize operations, depending on the type of resize you want to do. ```csharp -using (var png = new TinyPng("yourSecretApiKey")) +using (var png = new TinyPngClient("yourSecretApiKey")) { var compressResult = await png.Compress("pathToFile or byte array or stream)"); diff --git a/src/TinyPNG/ResizeOperation.cs b/src/TinyPNG/ResizeOperation.cs index bf063dd..bb00e30 100644 --- a/src/TinyPNG/ResizeOperation.cs +++ b/src/TinyPNG/ResizeOperation.cs @@ -1,6 +1,6 @@ using System; -namespace TinyPngApi +namespace TinyPng { public class ScaleWidthResizeOperation : ResizeOperation diff --git a/src/TinyPNG/Responses/ApiErrorResponse.cs b/src/TinyPNG/Responses/ApiErrorResponse.cs index b0bb8fe..d44997a 100644 --- a/src/TinyPNG/Responses/ApiErrorResponse.cs +++ b/src/TinyPNG/Responses/ApiErrorResponse.cs @@ -1,5 +1,5 @@  -namespace TinyPngApi.Responses +namespace TinyPng.Responses { public class ApiErrorResponse { diff --git a/src/TinyPNG/Responses/TinyPngCompressResponse.cs b/src/TinyPNG/Responses/TinyPngCompressResponse.cs index 6e20aec..fdda53b 100644 --- a/src/TinyPNG/Responses/TinyPngCompressResponse.cs +++ b/src/TinyPNG/Responses/TinyPngCompressResponse.cs @@ -3,7 +3,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Serialization; -namespace TinyPngApi.Responses +namespace TinyPng.Responses { public class TinyPngCompressResponse : TinyPngResponse { diff --git a/src/TinyPNG/Responses/TinyPngResizeResponse.cs b/src/TinyPNG/Responses/TinyPngResizeResponse.cs index dcc2240..34a2542 100644 --- a/src/TinyPNG/Responses/TinyPngResizeResponse.cs +++ b/src/TinyPNG/Responses/TinyPngResizeResponse.cs @@ -1,6 +1,6 @@ using System.Net.Http; -namespace TinyPngApi.Responses +namespace TinyPng.Responses { public class TinyPngResizeResponse : TinyPngResponse { diff --git a/src/TinyPNG/Responses/TinyPngResponse.cs b/src/TinyPNG/Responses/TinyPngResponse.cs index 2b6d789..9f1634c 100644 --- a/src/TinyPNG/Responses/TinyPngResponse.cs +++ b/src/TinyPNG/Responses/TinyPngResponse.cs @@ -1,6 +1,6 @@ using System.Net.Http; -namespace TinyPngApi +namespace TinyPng.Responses { public class TinyPngResponse { diff --git a/src/TinyPNG/TinyPng.cs b/src/TinyPNG/TinyPng.cs index ca3eede..facd3ef 100644 --- a/src/TinyPNG/TinyPng.cs +++ b/src/TinyPNG/TinyPng.cs @@ -6,11 +6,11 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Serialization; -using TinyPngApi.Responses; +using TinyPng.Responses; -namespace TinyPngApi +namespace TinyPng { - public class TinyPng : IDisposable + public class TinyPngClient : IDisposable { private readonly string _apiKey; private const string ApiEndpoint = "https://api.tinify.com/shrink"; @@ -21,7 +21,7 @@ public class TinyPng : IDisposable /// Wrapper for the tinypng.com API /// /// Your tinypng.com API key, signup here: https://tinypng.com/developers - public TinyPng(string apiKey) + public TinyPngClient(string apiKey) { if (string.IsNullOrEmpty(apiKey)) throw new ArgumentNullException(nameof(apiKey)); diff --git a/src/TinyPNG/TinyPngApiException.cs b/src/TinyPNG/TinyPngApiException.cs index 301604b..71238ed 100644 --- a/src/TinyPNG/TinyPngApiException.cs +++ b/src/TinyPNG/TinyPngApiException.cs @@ -1,6 +1,6 @@ using System; -namespace TinyPngApi +namespace TinyPng { public class TinyPngApiException : Exception { diff --git a/src/TinyPNG/TinyPngApiResult.cs b/src/TinyPNG/TinyPngApiResult.cs index 1a2f9b7..00253cc 100644 --- a/src/TinyPNG/TinyPngApiResult.cs +++ b/src/TinyPNG/TinyPngApiResult.cs @@ -1,4 +1,4 @@ -namespace TinyPngApi +namespace TinyPng { public class TinyPngApiResult diff --git a/tests/TinyPng.Tests/TinyPngTests.cs b/tests/TinyPng.Tests/TinyPngTests.cs index a5f7e02..fe60625 100644 --- a/tests/TinyPng.Tests/TinyPngTests.cs +++ b/tests/TinyPng.Tests/TinyPngTests.cs @@ -1,7 +1,8 @@ using System.Threading.Tasks; +using TinyPng; using Xunit; -namespace TinyPngApi.Tests +namespace TinyPng.Tests { public class TinyPngTests { @@ -10,7 +11,7 @@ public class TinyPngTests [Fact(Skip ="integration")] public async Task Compression() { - var pngx = new TinyPng(apiKey); + var pngx = new TinyPngClient(apiKey); var result = await pngx.Compress("Resources/cat.jpg"); @@ -24,7 +25,7 @@ public async Task Compression() [Fact(Skip = "integration")] public async Task Resizing() { - var pngx = new TinyPng(apiKey); + var pngx = new TinyPngClient(apiKey); var result = await pngx.Compress("Resources/cat.jpg");