public void DefaultValues() { var sut = new ForLoop(); Assert.AreEqual(Lists.NewList <IStatement>(), sut.Init); Assert.AreEqual(new UnknownExpression(), sut.Condition); Assert.AreEqual(Lists.NewList <IStatement>(), sut.Step); Assert.AreEqual(Lists.NewList <IStatement>(), sut.Body); Assert.AreNotEqual(0, sut.GetHashCode()); Assert.AreNotEqual(1, sut.GetHashCode()); }
public void Equality_Default() { var a = new ForLoop(); var b = new ForLoop(); Assert.AreEqual(a, b); Assert.AreEqual(a.GetHashCode(), b.GetHashCode()); }
public void Equality_DifferentBody() { var a = new ForLoop(); a.Body.Add(new ContinueStatement()); var b = new ForLoop(); Assert.AreNotEqual(a, b); Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode()); }
public void Equality_DifferentStep() { var a = new ForLoop(); a.Step.Add(new BreakStatement()); var b = new ForLoop(); Assert.AreNotEqual(a, b); Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode()); }
public void Equality_DifferentInit() { var a = new ForLoop(); a.Init.Add(new GotoStatement()); var b = new ForLoop(); Assert.AreNotEqual(a, b); Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode()); }
public void Equality_DifferentCondition() { var a = new ForLoop { Condition = new ConstantValueExpression() }; var b = new ForLoop(); Assert.AreNotEqual(a, b); Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode()); }
public void Equality_ReallyTheSame() { var a = new ForLoop { Condition = new ConstantValueExpression(), Init = { new GotoStatement() }, Step = { new BreakStatement() }, Body = { new ContinueStatement() } }; var b = new ForLoop { Condition = new ConstantValueExpression(), Init = { new GotoStatement() }, Step = { new BreakStatement() }, Body = { new ContinueStatement() } }; Assert.AreEqual(a, b); Assert.AreEqual(a.GetHashCode(), b.GetHashCode()); }