Skip to content

Commit dd49b2d

Browse files
Updated nugets
Also minor code cleanup. Fixed #381
1 parent 6ba05f0 commit dd49b2d

6 files changed

Lines changed: 21 additions & 18 deletions

File tree

framework.maui.props

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11

22
<Project>
3+
<ItemGroup>
4+
<PackageReference Include="Microsoft.Maui.Controls" Version="[10.0.50,)" />
5+
<!--<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />-->
6+
</ItemGroup>
37
<PropertyGroup>
48
<TargetFrameworks>net10.0;net10.0-android</TargetFrameworks>
59
<!-- Needed for GitHub action, iOS and MacOS is not workig on Linux -->

src/SharedMauiCoreLibrary.Licensing/SharedMauiCoreLibrary.Licensing.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
</ItemGroup>
4242

4343
<ItemGroup>
44-
<PackageReference Include="Microsoft.Maui.Controls" Version="[10.0.30,)" />
44+
<!--<PackageReference Include="Microsoft.Maui.Controls" Version="[10.0.50,)" />-->
4545
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.2" />
4646
<PackageReference Include="RestSharp" Version="114.0.0" />
4747
</ItemGroup>

src/SharedMauiCoreLibrary.Test/CoreTests.cs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,11 @@ public void GenerateHexStringTest()
2525
byte[] salt = EncryptionManager.CreateRandomSalt(saltSize);
2626
string hex = EncryptionManager.GetHexStringFromSalt(salt);
2727

28-
Assert.That(!string.IsNullOrEmpty(hex));
29-
Assert.That(hex.Length, Is.EqualTo(saltSize * 2));
28+
using (Assert.EnterMultipleScope())
29+
{
30+
Assert.That(!string.IsNullOrEmpty(hex));
31+
Assert.That(hex, Has.Length.EqualTo(saltSize * 2));
32+
}
3033
}
3134
catch (Exception ex)
3235
{
@@ -49,27 +52,27 @@ public void EncryptionTests()
4952
Assert.That(!string.IsNullOrEmpty(encryptedWithKey));
5053

5154
string decrytpedTextWithKey = EncryptionManager.DecryptStringFromBase64String(encryptedWithKey, base64Key, 256);
52-
Assert.That(plainText == decrytpedTextWithKey);
55+
Assert.That(plainText, Is.EqualTo(decrytpedTextWithKey));
5356

5457
int saltSize = 16;
5558
string saltHexString = EncryptionManager.GetHexStringFromSalt(EncryptionManager.CreateRandomSalt(saltSize));
56-
Assert.That(saltHexString.Length == saltSize * 2);
59+
Assert.That(saltHexString, Has.Length.EqualTo(saltSize * 2));
5760
byte[] salt = EncryptionManager.GetSaltFromHexString(saltHexString);
5861

5962
string userpassword = "This is a secret text";
6063
byte[] hashedPassword = EncryptionManager.SaltWithPasswordString(userpassword, salt, 32);
61-
Assert.That(hashedPassword.Length, Is.EqualTo(32));
64+
Assert.That(hashedPassword, Has.Length.EqualTo(32));
6265

6366
string encryptedText = EncryptionManager.EncryptStringToBase64String(plainText, hashedPassword, 256);
6467

6568
string decrytpedText = EncryptionManager.DecryptStringFromBase64String(encryptedText, hashedPassword, 256);
66-
Assert.That(plainText == decrytpedText);
69+
Assert.That(plainText, Is.EqualTo(decrytpedText));
6770

6871
// Recreate hash from user password
6972
salt = EncryptionManager.GetSaltFromHexString(saltHexString);
7073
hashedPassword = EncryptionManager.SaltWithPasswordString(userpassword, salt, 32);
7174
decrytpedText = EncryptionManager.DecryptStringFromBase64String(encryptedText, hashedPassword, 256);
72-
Assert.That(plainText == decrytpedText);
75+
Assert.That(plainText, Is.EqualTo(decrytpedText));
7376
}
7477
catch (Exception ex)
7578
{
@@ -93,12 +96,12 @@ public void UsePasswordDoubleEncryptionTest()
9396
string encryptedPassphrase = EncryptionManager.EncryptStringToBase64String(passphrase, hashedPassword);
9497

9598
string decryptedPassphrase = EncryptionManager.DecryptStringFromBase64String(encryptedPassphrase, hashedPassword);
96-
Assert.That(passphrase == decryptedPassphrase);
99+
Assert.That(passphrase, Is.EqualTo(decryptedPassphrase));
97100

98101
var t = EncryptionManager.EncryptStringToBase64String(plainText, decryptedPassphrase);
99102
var t2 = EncryptionManager.DecryptStringFromBase64String(t, decryptedPassphrase);
100103

101-
Assert.That(plainText == t2);
104+
Assert.That(plainText, Is.EqualTo(t2));
102105
}
103106
catch (Exception ex)
104107
{

src/SharedMauiCoreLibrary/Models/NavigationManager/ShellNavigator.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -434,10 +434,7 @@ public void SubscribeNavigated()
434434
}
435435
public void UnsubscribeNavigated()
436436
{
437-
if (Shell.Current is not null)
438-
{
439-
Shell.Current.Navigated -= OnNavigated;
440-
}
437+
Shell.Current?.Navigated -= OnNavigated;
441438
}
442439

443440
private void OnNavigated(object? sender, ShellNavigatedEventArgs e)

src/SharedMauiCoreLibrary/SharedMauiCoreLibrary.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
</ItemGroup>
3434

3535
<ItemGroup>
36-
<PackageReference Include="Microsoft.Maui.Controls" Version="[10.0.30,)" />
37-
<PackageReference Include="CommunityToolkit.Maui" Version="14.0.0" />
36+
<!--<PackageReference Include="Microsoft.Maui.Controls" Version="[10.0.50,)" />-->
37+
<PackageReference Include="CommunityToolkit.Maui" Version="14.1.0" />
3838
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.2" />
3939
</ItemGroup>
4040

src/global.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"sdk": {
3-
//"version": "9.0.308",
4-
"version": "10.0.100"
3+
"version": "10.0.201"
54
}
65
}

0 commit comments

Comments
 (0)