public void FormTree_ReturnsIncorrectGateStatusError() { TreeService service = new TreeService(); var sGates = "L,R,R,L,L,L,L,R,L,R,R,L,"; var tree = service.FormTree("4", sGates); Assert.IsTrue(tree.Error); Assert.AreEqual(tree.ErrorMessage, "Gate status value/s not set correctly."); }
public void FormTree_ReturnsNotANumberError() { TreeService service = new TreeService(); var sGates = "L,R,R,L,L,L,L,R,L,R,R,L,L,R,L"; var tree = service.FormTree("Four", sGates); Assert.IsTrue(tree.Error); Assert.AreEqual(tree.ErrorMessage, "The depth is not a number."); }
public void FormTree_ReturnsGatesNotMatchError() { TreeService service = new TreeService(); var sGates = "L,R,R,L,L,L,L,R,L,R,R,L,L"; var tree = service.FormTree("4", sGates); Assert.IsTrue(tree.Error); Assert.AreEqual(tree.ErrorMessage, "Gates do not match depth."); }
public void FormTree_ReturnsCorrectResults() { TreeService service = new TreeService(); var sGates = "L,R,R,L,L,L,L,R,L,R,R,L,L,R,L"; var tree = service.FormTree("4", sGates); Assert.AreEqual(tree.Depth, 4); Assert.AreEqual(tree.Gates.Length, 15); Assert.IsFalse(tree.Error); Assert.IsNull(tree.ErrorMessage); }