public void DefaultValues() { var sut = new CaseBlock(); Assert.AreEqual(new UnknownExpression(), sut.Label); Assert.AreEqual(Lists.NewList <IStatement>(), sut.Body); Assert.AreNotEqual(0, sut.GetHashCode()); Assert.AreNotEqual(1, sut.GetHashCode()); }
public void Equality_Default() { var a = new CaseBlock(); var b = new CaseBlock(); Assert.AreEqual(a, b); Assert.AreEqual(a.GetHashCode(), b.GetHashCode()); }
public void Equality_DifferentBody() { var a = new CaseBlock { Body = { new ReturnStatement() } }; var b = new CaseBlock(); Assert.AreNotEqual(a, b); Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode()); }
public void Equality_DifferentLabel() { var a = new CaseBlock { Label = Label("a") }; var b = new CaseBlock(); Assert.AreNotEqual(a, b); Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode()); }
public void Equality_ReallyTheSame() { var a = new CaseBlock { Label = Label("a"), Body = { new ReturnStatement() } }; var b = new CaseBlock { Label = Label("a"), Body = { new ReturnStatement() } }; Assert.AreEqual(a, b); Assert.AreEqual(a.GetHashCode(), b.GetHashCode()); }