예제 #1
0
        public void GetVariablesRetrievesAListWithTFStageVariableArrayAndT()
        {
            var variables = new List <Variable>
            {
                new Variable {
                    ActualValue = 0, InitialValue = 0, Name = "T"
                },
                new Variable {
                    ActualValue = 0, InitialValue = 50000, Name = "TF"
                },
                new VariableArray {
                    Name = "NS", Variables = new List <Variable> {
                        new Variable {
                            Name = "NS", InitialValue = 0, ActualValue = 0
                        }
                    }
                }
            };

            var simulation = new Mock <ISimulation>();

            simulation.Setup(x => x.GetDiagrams()).Returns(new List <Diagram>());
            simulation.Setup(x => x.GetVariables()).Returns(variables);

            var stageSimulation = new StageSimulation(simulation.Object);

            List <StageVariable> result = stageSimulation.GetVariables();

            Assert.AreEqual(3, result.Count);
            Assert.AreEqual("T", result.ElementAt(0).Name);
            Assert.AreEqual("TF", result.ElementAt(1).Name);
            Assert.AreEqual("NS", result.ElementAt(2).Name);
        }
예제 #2
0
        public void GetVariablesRetrievesAListWithVariableT()
        {
            var simulation = new Mock <ISimulation>();

            simulation.Setup(x => x.GetDiagrams()).Returns(new List <Diagram>());
            simulation.Setup(x => x.GetVariables()).Returns(new List <Variable> {
                new Variable {
                    ActualValue = 0, InitialValue = 0, Name = "T"
                }
            });

            var stageSimulation = new StageSimulation(simulation.Object);

            List <StageVariable> result = stageSimulation.GetVariables();

            Assert.AreEqual(1, result.Count);
            Assert.AreEqual("T", result.First().Name);
        }