public void element_RequestVariableValuesEventHandlerCallsUpdateVariableDependencyValues() { var wkSpce = new WorkSpace(); var mockVarMgr = new Mock<IVarMgr>(); var mockVarA = new Mock<IVariable>(); var element = new ElementCallDummy(); string[] varNames = { "Var A"}; var ea = new RequestVariableValuesEventArgs(varNames); mockVarMgr.Setup(m => m["Var A"]).Returns(mockVarA.Object); wkSpce.VarMgr = mockVarMgr.Object; wkSpce.element_RequestVariableValues(element, ea); Assert.Equal(1, element.UpdateVariableDependencyValues_TimesCalled); }
public void element_RequestVariableValuesEventHandlerDoesNothingIfSender_Is_Null() { var wkSpce = new WorkSpace(); var mockVarMgr = new Mock<IVarMgr>(); var mockVarA = new Mock<IVariable>(); string[] varNames = { "Var A" }; var ea = new RequestVariableValuesEventArgs(varNames); mockVarMgr.Setup(m => m["Var A"]).Returns(mockVarA.Object); wkSpce.VarMgr = mockVarMgr.Object; wkSpce.element_RequestVariableValues(null, ea); mockVarMgr.Verify(m => m["Var A"], Times.Never()); }