public bool Equals(SelectionIncludeCondition visibility) { if (Equals(visibility.Skip, visibility.Include)) { if (Parent is null) { return(visibility.Parent is null); } else { return(visibility.Parent is { } && Parent.Equals(visibility.Parent));
public void Include_True_Is_Visible_True() { // arrange var variableValues = new Mock <IVariableValueCollection>(); var visibility = new SelectionIncludeCondition(include: new BooleanValueNode(true)); // act var visible = visibility.IsTrue(variableValues.Object); // assert Assert.True(visible); }
public void Include_Var_True_Is_Visible_True() { // arrange var variableValues = new Mock <IVariableValueCollection>(); variableValues.Setup(t => t.GetVariable <bool>("b")).Returns(true); var visibility = new SelectionIncludeCondition(include: new VariableNode("b")); // act var visible = visibility.IsTrue(variableValues.Object); // assert Assert.True(visible); }
public void Equals_Include_Variable_A_vs_Variable_A() { // arrange var a = new SelectionIncludeCondition( include: new VariableNode("a")); var b = new SelectionIncludeCondition( include: new VariableNode("a")); // act var equals = a.Equals(b); // assert Assert.True(equals); }
public void Equals_Include_True_vs_Variable() { // arrange var a = new SelectionIncludeCondition( include: new BooleanValueNode(true)); var b = new SelectionIncludeCondition( include: new VariableNode("b")); // act var equals = a.Equals(b); // assert Assert.False(equals); }
public void Parent_Visible_False() { // arrange var variableValues = new Mock <IVariableValueCollection>(); var parent = new SelectionIncludeCondition( include: new BooleanValueNode(false)); var visibility = new SelectionIncludeCondition( include: new BooleanValueNode(true), parent: parent); // act var visible = visibility.IsTrue(variableValues.Object); // assert Assert.False(visible); }