chore: deprecate standalone SecureStoreManager utility
Move SecureStoreManager project and tests to Deprecated folder and remove from solution. SecureStore functionality is now integrated into ConfigManager.
This commit is contained in:
@@ -0,0 +1,114 @@
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Headless.XUnit;
|
||||
using Avalonia.VisualTree;
|
||||
using Shouldly;
|
||||
using Xunit;
|
||||
using JdeScoping.SecureStoreManager.ViewModels;
|
||||
using JdeScoping.SecureStoreManager.Views;
|
||||
|
||||
namespace JdeScoping.SecureStoreManager.Tests.Views;
|
||||
|
||||
public class SecretEditDialogTests
|
||||
{
|
||||
[AvaloniaFact]
|
||||
public void SecretEditDialog_DefaultConstructor_ShowsAddSecretTitle()
|
||||
{
|
||||
// Arrange & Act
|
||||
var dialog = new SecretEditDialog();
|
||||
dialog.Show();
|
||||
|
||||
// Assert
|
||||
dialog.Title.ShouldBe("Add Secret");
|
||||
}
|
||||
|
||||
[AvaloniaFact]
|
||||
public void SecretEditDialog_WithKeyValueParams_ShowsEditSecretTitle()
|
||||
{
|
||||
// Arrange & Act
|
||||
var dialog = new SecretEditDialog("existingKey", "existingValue");
|
||||
dialog.Show();
|
||||
|
||||
// Assert
|
||||
dialog.Title.ShouldBe("Edit Secret");
|
||||
}
|
||||
|
||||
[AvaloniaFact]
|
||||
public void SecretEditDialog_DataContextIsSecretEditDialogViewModel()
|
||||
{
|
||||
// Arrange & Act
|
||||
var dialog = new SecretEditDialog();
|
||||
dialog.Show();
|
||||
|
||||
// Assert
|
||||
dialog.DataContext.ShouldBeOfType<SecretEditDialogViewModel>();
|
||||
}
|
||||
|
||||
[AvaloniaFact]
|
||||
public void SecretEditDialog_HasKeyAndValueTextBoxes()
|
||||
{
|
||||
// Arrange & Act
|
||||
var dialog = new SecretEditDialog();
|
||||
dialog.Show();
|
||||
|
||||
// Assert
|
||||
var textBoxes = dialog.GetVisualDescendants().OfType<TextBox>().ToList();
|
||||
textBoxes.Count.ShouldBeGreaterThanOrEqualTo(2);
|
||||
}
|
||||
|
||||
[AvaloniaFact]
|
||||
public void SecretEditDialog_HasSaveAndCancelButtons()
|
||||
{
|
||||
// Arrange & Act
|
||||
var dialog = new SecretEditDialog();
|
||||
dialog.Show();
|
||||
|
||||
// Assert
|
||||
var buttons = dialog.GetVisualDescendants().OfType<Button>().ToList();
|
||||
buttons.Any(b => b.Content?.ToString() == "Save").ShouldBeTrue();
|
||||
buttons.Any(b => b.Content?.ToString() == "Cancel").ShouldBeTrue();
|
||||
}
|
||||
|
||||
[AvaloniaFact]
|
||||
public void SecretEditDialog_ViewModelProperty_ReturnsDataContext()
|
||||
{
|
||||
// Arrange & Act
|
||||
var dialog = new SecretEditDialog();
|
||||
dialog.Show();
|
||||
|
||||
// Assert
|
||||
dialog.ViewModel.ShouldBe(dialog.DataContext);
|
||||
}
|
||||
|
||||
[AvaloniaFact]
|
||||
public void SecretEditDialog_ParameterizedConstructor_SetsViewModelWithKey()
|
||||
{
|
||||
// Arrange & Act
|
||||
var dialog = new SecretEditDialog("testKey", "testValue");
|
||||
dialog.Show();
|
||||
|
||||
// Assert
|
||||
dialog.ViewModel.Key.ShouldBe("testKey");
|
||||
}
|
||||
|
||||
[AvaloniaFact]
|
||||
public void SecretEditDialog_ParameterizedConstructor_SetsViewModelWithValue()
|
||||
{
|
||||
// Arrange & Act
|
||||
var dialog = new SecretEditDialog("testKey", "testValue");
|
||||
dialog.Show();
|
||||
|
||||
// Assert
|
||||
dialog.ViewModel.Value.ShouldBe("testValue");
|
||||
}
|
||||
|
||||
[AvaloniaFact]
|
||||
public void SecretEditDialog_CannotResize()
|
||||
{
|
||||
// Arrange & Act
|
||||
var dialog = new SecretEditDialog();
|
||||
dialog.Show();
|
||||
|
||||
// Assert
|
||||
dialog.CanResize.ShouldBeFalse();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user