public void TestNodeGeneratesCorrectNodeCode()
{
string expected = string.Format("half {0} = 0.2;" + Environment.NewLine
+ "o.Normal = {0};" + Environment.NewLine
, m_InputOne.GetVariableNameForSlot(Vector1Node.OutputSlotId)
, m_Abs.GetVariableNameForSlot(Function1Input.OutputSlotId));
var node = new TestNode();
var result = ShaderGenerator.AdaptNodeOutputForPreview(node, TestNode.V1Out);
Assert.AreEqual(string.Format("({0})", node.GetVariableNameForSlot(TestNode.V1Out)), result);
Assert.AreEqual(string.Format("half4({0}, {0}, {0}, 1.0)", node.GetVariableNameForSlot(TestNode.V1Out)), result);
}
[Test]
var expected = string.Format("half4({0}.x, {0}.y, 0.0, 0.0)", node.GetVariableNameForSlot(TestNode.V2Out));
var expected = string.Format("half4({0}.x, {0}.y, 0.0, 1.0)", node.GetVariableNameForSlot(TestNode.V2Out));
var result = ShaderGenerator.AdaptNodeOutputForPreview(node, TestNode.V2Out);
Assert.AreEqual(expected, result);
var expected = string.Format("half4({0}.x, {0}.y, {0}.z, 0.0)", node.GetVariableNameForSlot(TestNode.V3Out));
var expected = string.Format("half4({0}.x, {0}.y, {0}.z, 1.0)", node.GetVariableNameForSlot(TestNode.V3Out));
var result = ShaderGenerator.AdaptNodeOutputForPreview(node, TestNode.V3Out);
var expected = string.Format("half4({0}.x, {0}.y, {0}.z, 1.0)", node.GetVariableNameForSlot(TestNode.V4Out));
Assert.AreEqual(string.Format("{0}", node.GetVariableNameForSlot(TestNode.V4Out)), result);