feat: add IConfigurablePostProcessor interface and implement in Cincinnati post
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
9
OpenNest.Core/IConfigurablePostProcessor.cs
Normal file
9
OpenNest.Core/IConfigurablePostProcessor.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace OpenNest
|
||||
{
|
||||
public interface IConfigurablePostProcessor : IPostProcessor
|
||||
{
|
||||
object Config { get; }
|
||||
|
||||
void SaveConfig();
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ using OpenNest.CNC;
|
||||
|
||||
namespace OpenNest.Posts.Cincinnati
|
||||
{
|
||||
public sealed class CincinnatiPostProcessor : IPostProcessor
|
||||
public sealed class CincinnatiPostProcessor : IConfigurablePostProcessor
|
||||
{
|
||||
private static readonly JsonSerializerOptions JsonOptions = new()
|
||||
{
|
||||
@@ -23,6 +23,8 @@ namespace OpenNest.Posts.Cincinnati
|
||||
|
||||
public CincinnatiPostConfig Config { get; }
|
||||
|
||||
object IConfigurablePostProcessor.Config => Config;
|
||||
|
||||
public CincinnatiPostProcessor()
|
||||
{
|
||||
var configPath = GetConfigPath();
|
||||
|
||||
@@ -121,6 +121,17 @@ public class CincinnatiPostProcessorTests
|
||||
Assert.Equal("OpenNest", pp.Author);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Post_ImplementsIConfigurablePostProcessor()
|
||||
{
|
||||
var post = new CincinnatiPostProcessor(new CincinnatiPostConfig());
|
||||
var configurable = post as IConfigurablePostProcessor;
|
||||
|
||||
Assert.NotNull(configurable);
|
||||
Assert.NotNull(configurable.Config);
|
||||
Assert.IsType<CincinnatiPostConfig>(configurable.Config);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Post_SkipsEmptyPlates()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user