Premiere commit - Omika

This commit is contained in:
2026-10-23 18:46:50 +02:00
commit 8ea76c1b24
2155 changed files with 984301 additions and 0 deletions
@@ -0,0 +1,51 @@
using Omika.App.Services;
namespace Omika.Tests.Mobile.Local;
/// <summary>
/// Tests du PlatformDeviceIdProvider : génération d'un identifiant unique et
/// stable entre les lancements. Ne contient aucune donnée personnelle.
/// </summary>
public class PlatformDeviceIdProviderTests
{
[Fact]
public async Task GetDeviceId_RetourneIdentifiantNonVide()
{
// Arrange
var provider = new PlatformDeviceIdProvider();
// Act
string deviceId = await provider.GetDeviceIdAsync();
// Assert
Assert.False(string.IsNullOrWhiteSpace(deviceId));
}
[Fact]
public async Task GetDeviceId_StableEntreAppels()
{
// Arrange
var provider = new PlatformDeviceIdProvider();
// Act
string first = await provider.GetDeviceIdAsync();
string second = await provider.GetDeviceIdAsync();
// Assert : l'identifiant est stable.
Assert.Equal(first, second);
}
[Fact]
public async Task GetDeviceId_FormatGuid()
{
// Arrange
var provider = new PlatformDeviceIdProvider();
// Act
string deviceId = await provider.GetDeviceIdAsync();
// Assert : l'identifiant est un GUID (32 hex sans tirets).
Assert.Equal(32, deviceId.Length);
Assert.True(Guid.TryParseExact(deviceId, "N", out _));
}
}