修复流程图编辑器界面及初步的功能
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user