mirror of
https://github.com/eliasstepanik/OSCADSharpDotnet7.git
synced 2026-01-11 05:28:33 +00:00
+ Added CompoundVariable as result from operations on variables + Added constructor flag for Variable to optionally add it to globals on creation
31 lines
878 B
C#
31 lines
878 B
C#
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace OSCADSharp.UnitTests.Scripting
|
|
{
|
|
[TestClass]
|
|
public class VariableTests
|
|
{
|
|
[TestMethod]
|
|
public void Variables_CreatingVariableWithTrueForGlobalAddsGlobals()
|
|
{
|
|
var myVariable = new Variable("overallWidth", Inches.ToMillimeters(3.5), true);
|
|
|
|
Assert.AreEqual(Variables.Global.Get("overallWidth"), myVariable);
|
|
}
|
|
|
|
[TestMethod]
|
|
public void Variables_ComputingAVariableValueResultsInACompoundVariable()
|
|
{
|
|
var compound = new Variable("x", 5) / 12;
|
|
|
|
string type = compound.GetType().ToString();
|
|
Assert.AreEqual("OSCADSharp.Scripting.CompoundVariable", type);
|
|
}
|
|
}
|
|
}
|