✅ Persistance de SearchText ajoutée
This commit is contained in:
parent
51286b2a64
commit
14dcd31da1
13 changed files with 302 additions and 197 deletions
|
|
@ -1,3 +1,5 @@
|
|||
using System.Text.Json;
|
||||
|
||||
namespace PostIt.Tests;
|
||||
|
||||
public class SettingsLoadTests
|
||||
|
|
@ -149,4 +151,26 @@ public class SettingsLoadTests
|
|||
|
||||
Assert.True(settings.Loaded);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SearchText_is_serialized_in_settings_and_round_trips()
|
||||
{
|
||||
var settings = new PostIt.ViewModels.Settings
|
||||
{
|
||||
Authentication = new AuthenticationSettings
|
||||
{
|
||||
Authority = "https://example.test/",
|
||||
ClientId = "postit-tests",
|
||||
Scopes = new[] { "openid" }
|
||||
}
|
||||
};
|
||||
|
||||
settings.SearchText = "bonjour";
|
||||
|
||||
var json = JsonSerializer.Serialize(settings);
|
||||
var roundTrip = JsonSerializer.Deserialize<PostIt.ViewModels.Settings>(json);
|
||||
|
||||
Assert.NotNull(roundTrip);
|
||||
Assert.Equal("bonjour", roundTrip.SearchText);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue