static void Main(string[] args) { DiamondShape myDiamond = new DiamondShape(9); myDiamond.CreateDiamond(); Console.Write(myDiamond.ToString()); }
public void TestDiamondStringCreator() { MyDiamond.DiamondShape myDiamond = new MyDiamond.DiamondShape(7); string expected = "***"; string actual; actual = myDiamond.CreateDiamondsString(3); Assert.Equal(expected, actual); }
public void TestWhiteSpaceStringCreator() { MyDiamond.DiamondShape myDiamond = new MyDiamond.DiamondShape(7); string expected = " "; string actual; actual = myDiamond.CreateWhiteSpaceString(2); Assert.Equal(expected, actual); }
public void TestCreateRowNumberThreeWithSizeSeven() { MyDiamond.DiamondShape myDiamond = new MyDiamond.DiamondShape(7); string expected = " ***** "; string actual; actual = myDiamond.CreateRow(3); Assert.Equal(expected, actual); }
public void TestCreateRow() { MyDiamond.DiamondShape myDiamond = new MyDiamond.DiamondShape(3); string expected = " * "; string actual; actual = myDiamond.CreateRow(1); Assert.Equal(expected, actual); }
public void TestCreateDiamondMethod() { MyDiamond.DiamondShape myDiamond = new MyDiamond.DiamondShape(3); string[] expected = { " * ", "***", " * " }; string[] actual; myDiamond.CreateDiamond(); actual = myDiamond.DiamondRows; Assert.Equal(expected, actual); }
public void TestConstructorOnlyAcceptUneven() { bool constructThrewExcept = false; try { MyDiamond.DiamondShape myDiamond = new MyDiamond.DiamondShape(2); } catch (System.Exception) { constructThrewExcept = true; } Assert.True(constructThrewExcept); }