public void OnlyChildWithUnivals(ISolution solution) { /* 0 \ \ 0 \ / \ \ 1 0 \ / \ 1 \ / \ \ 1 1 */ Node root = new Node(false , null , new Node(false , new Node(true , new Node(true , new Node(true) , new Node(true) ) , null ) , new Node(false) ) ); Assert.Equal(4, solution.Execute(root)); }
public void GivenTest(ISolution solution) { /* 0 * / \ * 1 0 * / \ * 1 0 * / \ * 1 1 */ Node root = new Node(false , new Node(true) , new Node(false , new Node(true , new Node(true) , new Node(true) ) , new Node(false) )); Assert.Equal(5, solution.Execute(root)); }
public void GivenTestB(ISolution solution) => Assert.Equal(10, solution.Execute(new int[] { 5, 1, 1, 5 }));
public int SumPass() => sumPass.Execute(input);
public void GivenTestB(ISolution solution) => Assert.Equal( new ulong[] { 2, 3, 6 }, solution.Execute(new ushort[] { 3, 2, 1 }));
public void Duplicates(ISolution solution) => Assert.Equal(1, solution.Execute(new int[] { 5, 5, 5, 5, 5 }));
public void NoValidCandidates(ISolution solution) => Assert.Equal(1, solution.Execute(new int[] { -1, 5, 0 }));
public void GivenTestA(ISolution solution) => Assert.Equal(13, solution.Execute(new int[] { 2, 4, 6, 2, 5 }));
public void SingleElement(ISolution solution) => Assert.Equal(3, solution.Execute(new int[] { 3 }));
public void AllValid(ISolution solution) => Assert.Equal(8, solution.Execute("12211"));
public void Empty(ISolution solution) => Assert.Equal(0, solution.Execute(""));
public void OnlyRoot(ISolution solution) => Assert.Equal(1, solution.Execute(new Node(true)));
public void NearFar() => nearFar.Execute(input);
public int SumPassNoCast() => sumPassNoCast.Execute(input);
public void Null(ISolution solution) => Assert.Equal(0, solution.Execute(null));
public void HighDigits(ISolution solution) => Assert.Equal(2, solution.Execute("91281"));
public void Empty(ISolution solution) => Assert.Equal(0, solution.Execute(new int[] { }));
public void Zeroes(ISolution solution) => Assert.Equal(1, solution.Execute("110201010"));
public void TwoElements(ISolution solution) => Assert.Equal(5, solution.Execute(new int[] { 3, 5 }));
public void GivenTest(ISolution solution) => Assert.Equal(3, solution.Execute("111"));
public void GivenTestB(ISolution solution) => Assert.Equal(3, solution.Execute(new int[] { 1, 2, 0 }));
public void CantUseSameIndexTwice(ISolution solution) => Assert.False(solution.Execute(new byte[] { 3, 5, 6 }, 10));
public void NoFirstStep(ISolution solution) => Assert.Equal(1, solution.Execute(new int[] { 7, 6, -1, 3, 5, 4 }));
public void CanUseSameValueTwice(ISolution solution) => Assert.True(solution.Execute(new byte[] { 3, 5, 5, 6 }, 10));
public void GivenTestA(ISolution solution) => Assert.Equal(2, solution.Execute(new int[] { 3, 4, -1, 1 }));
public void GivenTest(ISolution solution) => Assert.True(solution.Execute(new byte[] { 10, 15, 3, 7 }, 17));
public void GivenTestA(ISolution solution) => Assert.Equal( new ulong[] { 120, 60, 40, 30, 24 }, solution.Execute(new ushort[] { 1, 2, 3, 4, 5 }));
public int Recursion() => recursion.Execute(input);