From c865f84fd5bb4235b310f56aee3441b8dadd6e15 Mon Sep 17 00:00:00 2001 From: Geo Perez <1775792+geoperez@users.noreply.github.com> Date: Mon, 4 Mar 2019 21:32:54 -0600 Subject: [PATCH] Update test fx --- src/Unosquare.Swan.Lite/Components/ObjectMapper.cs | 12 +++++------- src/Unosquare.Swan.Lite/Extensions.ValueTypes.cs | 2 +- src/Unosquare.Swan.Lite/Terminal.cs | 2 +- src/Unosquare.Swan.Lite/Unosquare.Swan.Lite.csproj | 4 ++-- src/Unosquare.Swan/Components/CircularBuffer.cs | 2 +- src/Unosquare.Swan/Components/DelayProvider.cs | 4 ++++ .../Exceptions/JsonRequestException.cs | 1 - src/Unosquare.Swan/Network.cs | 2 +- src/Unosquare.Swan/Networking/Enums.Smtp.cs | 3 +-- src/Unosquare.Swan/Unosquare.Swan.csproj | 1 - test/Unosquare.Swan.Test/Unosquare.Swan.Test.csproj | 8 ++++---- 11 files changed, 20 insertions(+), 21 deletions(-) diff --git a/src/Unosquare.Swan.Lite/Components/ObjectMapper.cs b/src/Unosquare.Swan.Lite/Components/ObjectMapper.cs index bcee8279d..060c9edaf 100644 --- a/src/Unosquare.Swan.Lite/Components/ObjectMapper.cs +++ b/src/Unosquare.Swan.Lite/Components/ObjectMapper.cs @@ -279,14 +279,12 @@ private static bool TrySetValue(PropertyInfo propertyInfo, Tuple p return true; } - if (!type.IsValueType() && propertyInfo.PropertyType == type) - { - propertyInfo.SetValue(target, GetValue(value, propertyInfo.PropertyType)); + if (type.IsValueType() || propertyInfo.PropertyType != type) + return propertyInfo.TrySetBasicType(value, target); + + propertyInfo.SetValue(target, GetValue(value, propertyInfo.PropertyType)); - return true; - } - - return propertyInfo.TrySetBasicType(value, target); + return true; } catch { diff --git a/src/Unosquare.Swan.Lite/Extensions.ValueTypes.cs b/src/Unosquare.Swan.Lite/Extensions.ValueTypes.cs index 6454eacea..2f1804f2d 100644 --- a/src/Unosquare.Swan.Lite/Extensions.ValueTypes.cs +++ b/src/Unosquare.Swan.Lite/Extensions.ValueTypes.cs @@ -127,7 +127,7 @@ public static byte[] ToBytes(this T obj) /// contained in longBytes. /// public static uint SwapEndianness(this ulong longBytes) - => (uint) (((longBytes & 0x000000ff) << 24) + + => (uint)(((longBytes & 0x000000ff) << 24) + ((longBytes & 0x0000ff00) << 8) + ((longBytes & 0x00ff0000) >> 8) + ((longBytes & 0xff000000) >> 24)); diff --git a/src/Unosquare.Swan.Lite/Terminal.cs b/src/Unosquare.Swan.Lite/Terminal.cs index 32be14142..a9013eda7 100644 --- a/src/Unosquare.Swan.Lite/Terminal.cs +++ b/src/Unosquare.Swan.Lite/Terminal.cs @@ -229,7 +229,7 @@ public static void Flush(TimeSpan? timeout = null) /// The top. public static void SetCursorPosition(int left, int top) { - if (IsConsolePresent == false) return; + if (!IsConsolePresent) return; lock (SyncLock) { diff --git a/src/Unosquare.Swan.Lite/Unosquare.Swan.Lite.csproj b/src/Unosquare.Swan.Lite/Unosquare.Swan.Lite.csproj index 45d76cacb..0530f9f4e 100644 --- a/src/Unosquare.Swan.Lite/Unosquare.Swan.Lite.csproj +++ b/src/Unosquare.Swan.Lite/Unosquare.Swan.Lite.csproj @@ -27,13 +27,13 @@ - + - + diff --git a/src/Unosquare.Swan/Components/CircularBuffer.cs b/src/Unosquare.Swan/Components/CircularBuffer.cs index c8cf6db71..bf7f1b963 100644 --- a/src/Unosquare.Swan/Components/CircularBuffer.cs +++ b/src/Unosquare.Swan/Components/CircularBuffer.cs @@ -13,7 +13,7 @@ namespace Unosquare.Swan.Components public sealed class CircularBuffer : IDisposable { private readonly object _syncLock = new object(); - private IntPtr _buffer = IntPtr.Zero; + private IntPtr _buffer; /// /// Initializes a new instance of the class. diff --git a/src/Unosquare.Swan/Components/DelayProvider.cs b/src/Unosquare.Swan/Components/DelayProvider.cs index 51a3a24b4..875d027a2 100644 --- a/src/Unosquare.Swan/Components/DelayProvider.cs +++ b/src/Unosquare.Swan/Components/DelayProvider.cs @@ -34,7 +34,9 @@ public sealed class DelayProvider : IDisposable private readonly Stopwatch _delayStopwatch = new Stopwatch(); private bool _isDisposed; +#if !NETSTANDARD1_3 private IWaitEvent _delayEvent; +#endif /// /// Initializes a new instance of the class. @@ -111,7 +113,9 @@ public void Dispose() { if (_isDisposed) return; _isDisposed = true; +#if !NETSTANDARD1_3 _delayEvent?.Dispose(); +#endif } } diff --git a/src/Unosquare.Swan/Exceptions/JsonRequestException.cs b/src/Unosquare.Swan/Exceptions/JsonRequestException.cs index 0ae094902..8c43e6f92 100644 --- a/src/Unosquare.Swan/Exceptions/JsonRequestException.cs +++ b/src/Unosquare.Swan/Exceptions/JsonRequestException.cs @@ -12,7 +12,6 @@ public class JsonRequestException : Exception { - /// /// /// Initializes a new instance of the class. /// diff --git a/src/Unosquare.Swan/Network.cs b/src/Unosquare.Swan/Network.cs index b0a2bd45e..1c4bf0309 100644 --- a/src/Unosquare.Swan/Network.cs +++ b/src/Unosquare.Swan/Network.cs @@ -190,7 +190,7 @@ public static Task GetDnsHostEntryAsync(string fqdn) /// /// An array of local ip addresses of the result produced by this task. /// - /// fqdn + /// fqdn. public static async Task GetDnsHostEntryAsync(string fqdn, IPAddress dnsServer, int port) { if (fqdn == null) diff --git a/src/Unosquare.Swan/Networking/Enums.Smtp.cs b/src/Unosquare.Swan/Networking/Enums.Smtp.cs index 5d05d0203..6c3e299f5 100644 --- a/src/Unosquare.Swan/Networking/Enums.Smtp.cs +++ b/src/Unosquare.Swan/Networking/Enums.Smtp.cs @@ -2,9 +2,8 @@ namespace Unosquare.Swan.Networking { #if NETSTANDARD1_3 - /// - /// Defines the different SMTP status codes + /// Defines the different SMTP status codes. /// public enum SmtpStatusCode { diff --git a/src/Unosquare.Swan/Unosquare.Swan.csproj b/src/Unosquare.Swan/Unosquare.Swan.csproj index 3e9b7689f..5f7dfc8d9 100644 --- a/src/Unosquare.Swan/Unosquare.Swan.csproj +++ b/src/Unosquare.Swan/Unosquare.Swan.csproj @@ -18,7 +18,6 @@ - All diff --git a/test/Unosquare.Swan.Test/Unosquare.Swan.Test.csproj b/test/Unosquare.Swan.Test/Unosquare.Swan.Test.csproj index 023e12f20..97506753c 100644 --- a/test/Unosquare.Swan.Test/Unosquare.Swan.Test.csproj +++ b/test/Unosquare.Swan.Test/Unosquare.Swan.Test.csproj @@ -15,17 +15,17 @@ - + all runtime; build; native; contentfiles; analyzers - - + + All - +