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