Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Foreman/Models/Nodes/PassthroughNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public enum Errors {
public bool SimpleDraw { get; set; }
public PassthroughNode(ProductionGraph graph, int nodeID, ItemQualityPair item) : base(graph, nodeID) {
PassthroughItem = item;
SimpleDraw = true;
SimpleDraw = graph.DefaultToSimplePassthroughNodes;
controller = new PassthroughNodeController(this);
}

Expand Down
15 changes: 15 additions & 0 deletions ForemanTest/ItemQualityNodeDiagnosticsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using ForemanTest.support;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Drawing;
using System.Linq;

namespace ForemanTest {
Expand Down Expand Up @@ -77,6 +78,20 @@ public void Passthrough_ToString_DescribesPassthroughNode() {
Assert.IsFalse(node.ToString().StartsWith("Supply node", StringComparison.Ordinal));
}

[TestMethod]
public void Passthrough_NewNode_UsesGraphDefaultSimpleDraw() {
var ctx = GraphSessionTestHelper.CreateContext();
var graph = ctx.NewGraph();

graph.DefaultToSimplePassthroughNodes = false;
PassthroughNode plain = graph.CreatePassthroughNode(ctx.Item("belt"), Point.Empty);
Assert.IsFalse(plain.SimpleDraw);

graph.DefaultToSimplePassthroughNodes = true;
PassthroughNode simplified = graph.CreatePassthroughNode(ctx.Item("iron"), Point.Empty);
Assert.IsTrue(simplified.SimpleDraw);
}

[TestMethod]
public void Spoil_ToString_IncludesInputOutputAndQualities() {
var ctx = GraphSessionTestHelper.CreateContext();
Expand Down
Loading