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,93 @@
|
||||
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 NewStoreDialogTests
|
||||
{
|
||||
[AvaloniaFact]
|
||||
public void NewStoreDialog_ShowsWithCorrectTitle()
|
||||
{
|
||||
// Arrange & Act
|
||||
var dialog = new NewStoreDialog();
|
||||
dialog.Show();
|
||||
|
||||
// Assert
|
||||
dialog.Title.ShouldBe("Create New Store");
|
||||
}
|
||||
|
||||
[AvaloniaFact]
|
||||
public void NewStoreDialog_DataContextIsNewStoreDialogViewModel()
|
||||
{
|
||||
// Arrange & Act
|
||||
var dialog = new NewStoreDialog();
|
||||
dialog.Show();
|
||||
|
||||
// Assert
|
||||
dialog.DataContext.ShouldBeOfType<NewStoreDialogViewModel>();
|
||||
}
|
||||
|
||||
[AvaloniaFact]
|
||||
public void NewStoreDialog_HasStorePathTextBox()
|
||||
{
|
||||
// Arrange & Act
|
||||
var dialog = new NewStoreDialog();
|
||||
dialog.Show();
|
||||
|
||||
// Assert
|
||||
var textBoxes = dialog.GetVisualDescendants().OfType<TextBox>().ToList();
|
||||
textBoxes.Count.ShouldBeGreaterThan(0);
|
||||
}
|
||||
|
||||
[AvaloniaFact]
|
||||
public void NewStoreDialog_HasKeyFilePathTextBox()
|
||||
{
|
||||
// Arrange & Act
|
||||
var dialog = new NewStoreDialog();
|
||||
dialog.Show();
|
||||
|
||||
// Assert - Should have at least 2 text boxes: store path and key file path
|
||||
var textBoxes = dialog.GetVisualDescendants().OfType<TextBox>().ToList();
|
||||
textBoxes.Count.ShouldBeGreaterThanOrEqualTo(2);
|
||||
}
|
||||
|
||||
[AvaloniaFact]
|
||||
public void NewStoreDialog_HasCreateAndCancelButtons()
|
||||
{
|
||||
// Arrange & Act
|
||||
var dialog = new NewStoreDialog();
|
||||
dialog.Show();
|
||||
|
||||
// Assert
|
||||
var buttons = dialog.GetVisualDescendants().OfType<Button>().ToList();
|
||||
buttons.Any(b => b.Content?.ToString() == "Create").ShouldBeTrue();
|
||||
buttons.Any(b => b.Content?.ToString() == "Cancel").ShouldBeTrue();
|
||||
}
|
||||
|
||||
[AvaloniaFact]
|
||||
public void NewStoreDialog_ViewModelProperty_ReturnsDataContext()
|
||||
{
|
||||
// Arrange & Act
|
||||
var dialog = new NewStoreDialog();
|
||||
dialog.Show();
|
||||
|
||||
// Assert
|
||||
dialog.ViewModel.ShouldBe(dialog.DataContext);
|
||||
}
|
||||
|
||||
[AvaloniaFact]
|
||||
public void NewStoreDialog_CannotResize()
|
||||
{
|
||||
// Arrange & Act
|
||||
var dialog = new NewStoreDialog();
|
||||
dialog.Show();
|
||||
|
||||
// Assert
|
||||
dialog.CanResize.ShouldBeFalse();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user