From a33667801055a938d08c3b85f6d8225a5e913178 Mon Sep 17 00:00:00 2001 From: Devedse Date: Tue, 27 Apr 2021 14:22:11 +0200 Subject: [PATCH] Updated nuget packages + fixed unit test --- DeveImageOptimizerWPF.Tests/Converters/KbConverterTests.cs | 2 +- DeveImageOptimizerWPF/Converters/KbConverter.cs | 4 ++-- ...ableCollectionOptimizedFileResultToSizeReducedConverter.cs | 4 ++-- ...eCollectionOptimizedFileResultToTotalSizeAfterConverter.cs | 4 ++-- ...CollectionOptimizedFileResultToTotalSizeBeforeConverter.cs | 4 ++-- .../Converters/OptimizedFileResultToSizeConverter.cs | 4 ++-- DeveImageOptimizerWPF/DeveImageOptimizerWPF.csproj | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/DeveImageOptimizerWPF.Tests/Converters/KbConverterTests.cs b/DeveImageOptimizerWPF.Tests/Converters/KbConverterTests.cs index 5753c24..c00dd32 100644 --- a/DeveImageOptimizerWPF.Tests/Converters/KbConverterTests.cs +++ b/DeveImageOptimizerWPF.Tests/Converters/KbConverterTests.cs @@ -16,7 +16,7 @@ public void KbToString() var result = kbConverter.Convert(123456789L, null, null, CultureInfo.InvariantCulture); //Assert - Assert.Equal("117,7MB", result.ToString()); + Assert.Equal("117.7MB", result.ToString()); } } } diff --git a/DeveImageOptimizerWPF/Converters/KbConverter.cs b/DeveImageOptimizerWPF/Converters/KbConverter.cs index ab69b8d..3039210 100644 --- a/DeveImageOptimizerWPF/Converters/KbConverter.cs +++ b/DeveImageOptimizerWPF/Converters/KbConverter.cs @@ -1,4 +1,4 @@ -using DeveImageOptimizer.Helpers; +using DeveCoolLib.Conversion; using System; using System.Globalization; using System.Windows.Data; @@ -10,7 +10,7 @@ public sealed class KbConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { - return ValuesToStringHelper.BytesToString((long)value); + return ValuesToStringHelper.BytesToString((long)value, culture); } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) diff --git a/DeveImageOptimizerWPF/Converters/ObservableCollectionOptimizedFileResultToSizeReducedConverter.cs b/DeveImageOptimizerWPF/Converters/ObservableCollectionOptimizedFileResultToSizeReducedConverter.cs index 8256aa4..be514d0 100644 --- a/DeveImageOptimizerWPF/Converters/ObservableCollectionOptimizedFileResultToSizeReducedConverter.cs +++ b/DeveImageOptimizerWPF/Converters/ObservableCollectionOptimizedFileResultToSizeReducedConverter.cs @@ -1,4 +1,4 @@ -using DeveImageOptimizer.Helpers; +using DeveCoolLib.Conversion; using DeveImageOptimizerWPF.State.ProcessingState; using System; using System.Collections.ObjectModel; @@ -19,7 +19,7 @@ public object Convert(object value, Type targetType, object parameter, CultureIn } var ofr = (ObservableCollection)value; var totalOptimizedSize = ofr.Sum(t => t.OriginalSize - t.OptimizedSize); - return ValuesToStringHelper.BytesToString(totalOptimizedSize); + return ValuesToStringHelper.BytesToString(totalOptimizedSize, culture); } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) diff --git a/DeveImageOptimizerWPF/Converters/ObservableCollectionOptimizedFileResultToTotalSizeAfterConverter.cs b/DeveImageOptimizerWPF/Converters/ObservableCollectionOptimizedFileResultToTotalSizeAfterConverter.cs index 72af104..50200bb 100644 --- a/DeveImageOptimizerWPF/Converters/ObservableCollectionOptimizedFileResultToTotalSizeAfterConverter.cs +++ b/DeveImageOptimizerWPF/Converters/ObservableCollectionOptimizedFileResultToTotalSizeAfterConverter.cs @@ -1,4 +1,4 @@ -using DeveImageOptimizer.Helpers; +using DeveCoolLib.Conversion; using DeveImageOptimizerWPF.State.ProcessingState; using System; using System.Collections.ObjectModel; @@ -19,7 +19,7 @@ public object Convert(object value, Type targetType, object parameter, CultureIn } var ofr = (ObservableCollection)value; var totalOptimizedSize = ofr.Sum(t => t.OptimizedSize); - return ValuesToStringHelper.BytesToString(totalOptimizedSize); + return ValuesToStringHelper.BytesToString(totalOptimizedSize, culture); } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) diff --git a/DeveImageOptimizerWPF/Converters/ObservableCollectionOptimizedFileResultToTotalSizeBeforeConverter.cs b/DeveImageOptimizerWPF/Converters/ObservableCollectionOptimizedFileResultToTotalSizeBeforeConverter.cs index 92973d0..5874621 100644 --- a/DeveImageOptimizerWPF/Converters/ObservableCollectionOptimizedFileResultToTotalSizeBeforeConverter.cs +++ b/DeveImageOptimizerWPF/Converters/ObservableCollectionOptimizedFileResultToTotalSizeBeforeConverter.cs @@ -1,4 +1,4 @@ -using DeveImageOptimizer.Helpers; +using DeveCoolLib.Conversion; using DeveImageOptimizerWPF.State.ProcessingState; using System; using System.Collections.ObjectModel; @@ -19,7 +19,7 @@ public object Convert(object value, Type targetType, object parameter, CultureIn } var ofr = (ObservableCollection)value; var totalOptimizedSize = ofr.Sum(t => t.OriginalSize); - return ValuesToStringHelper.BytesToString(totalOptimizedSize); + return ValuesToStringHelper.BytesToString(totalOptimizedSize, culture); } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) diff --git a/DeveImageOptimizerWPF/Converters/OptimizedFileResultToSizeConverter.cs b/DeveImageOptimizerWPF/Converters/OptimizedFileResultToSizeConverter.cs index a07aa62..f2a7541 100644 --- a/DeveImageOptimizerWPF/Converters/OptimizedFileResultToSizeConverter.cs +++ b/DeveImageOptimizerWPF/Converters/OptimizedFileResultToSizeConverter.cs @@ -1,4 +1,4 @@ -using DeveImageOptimizer.Helpers; +using DeveCoolLib.Conversion; using DeveImageOptimizerWPF.State.ProcessingState; using System; using System.Globalization; @@ -16,7 +16,7 @@ public object Convert(object value, Type targetType, object parameter, CultureIn return string.Empty; } var ofr = (OptimizableFileUI)value; - return ValuesToStringHelper.BytesToString(ofr.OriginalSize - ofr.OptimizedSize); + return ValuesToStringHelper.BytesToString(ofr.OriginalSize - ofr.OptimizedSize, culture); } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) diff --git a/DeveImageOptimizerWPF/DeveImageOptimizerWPF.csproj b/DeveImageOptimizerWPF/DeveImageOptimizerWPF.csproj index ca72c47..775e133 100644 --- a/DeveImageOptimizerWPF/DeveImageOptimizerWPF.csproj +++ b/DeveImageOptimizerWPF/DeveImageOptimizerWPF.csproj @@ -11,8 +11,8 @@ - - + +