修复流程图编辑器界面及初步的功能

This commit is contained in:
zhengxuan.zhang
2026-04-20 11:07:00 +08:00
parent b16d592087
commit 1c6c2ac675
19 changed files with 363 additions and 32 deletions
@@ -1,4 +1,7 @@
using Moq;
using System;
using System.IO;
using System.Windows.Media.Imaging;
using XP.Common.Logging.Interfaces;
using XplorePlane.Models;
using XplorePlane.Services;
@@ -104,6 +107,36 @@ namespace XplorePlane.Tests.Pipeline
Assert.Equal(i, vm.PipelineNodes[i].Order);
}
[Fact]
public void LoadImageFromFile_SetsSourceImage()
{
var vm = CreateVm();
var tempPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid() + ".png");
try
{
var bitmap = TestHelpers.CreateTestBitmap(8, 8);
var encoder = new PngBitmapEncoder();
encoder.Frames.Add(BitmapFrame.Create(bitmap));
using (var stream = File.Create(tempPath))
{
encoder.Save(stream);
}
vm.LoadImageFromFile(tempPath);
Assert.NotNull(vm.SourceImage);
Assert.NotNull(vm.PreviewImage);
Assert.Contains(Path.GetFileName(tempPath), vm.StatusMessage);
}
finally
{
if (File.Exists(tempPath))
File.Delete(tempPath);
}
}
// ── 6.2 RemoveOperatorCommand ─────────────────────────────────
[Fact]