Files
jdescopingtool/NEW/tests/JdeScoping.ConfigManager.Tests/ViewModels/Forms/DataAccessFormViewModelTests.cs
T
Joseph Doherty 7c4781dfe3 refactor(configmanager): split into Core, CLI, and UI projects
Extract shared models, services, and application logic into
JdeScoping.ConfigManager.Core library. Add JdeScoping.ConfigManager.Cli
console app with validate, test-connection, and secret commands using
System.CommandLine. UI project now references Core for platform-agnostic
functionality while retaining Avalonia-specific dialog and clipboard services.
2026-01-28 10:01:48 -05:00

44 lines
1.2 KiB
C#

using JdeScoping.ConfigManager.Core.Models;
using JdeScoping.ConfigManager.ViewModels.Forms;
namespace JdeScoping.ConfigManager.Tests.ViewModels.Forms;
public class DataAccessFormViewModelTests
{
[Fact]
public void Constructor_InitializesFromModel()
{
// Arrange
var model = new DataAccessSection
{
DefaultTimeoutSeconds = 60,
ProductionSchema = "dbo",
EnableDetailedLogging = true
};
// Act
var sut = new DataAccessFormViewModel(model, () => { });
// Assert
sut.DefaultTimeoutSeconds.ShouldBe(60);
sut.ProductionSchema.ShouldBe("dbo");
sut.EnableDetailedLogging.ShouldBeTrue();
}
[Fact]
public void PropertyChange_UpdatesModelAndInvokesOnChanged()
{
// Arrange
var model = new DataAccessSection();
var changedInvoked = false;
var sut = new DataAccessFormViewModel(model, () => changedInvoked = true);
// Act
sut.ArchiveSchema = "hist";
// Assert
model.ArchiveSchema.ShouldBe("hist");
changedInvoked.ShouldBeTrue();
}
}