public void TestMethod1(int num, bool expected) { // Arrange ValidPerfectSquare question = new ValidPerfectSquare(); // Act bool actual = question.IsPerfectSquare(num); // Assert Assert.AreEqual(expected, actual); }
public void validPerfectSquareTest() { foreach (ValidPerfectSquareTestData testData in TestDataList) { Console.WriteLine("Test input: " + testData.InputInt); bool result = ValidPerfectSquare.IsPerfectSquare(testData.InputInt); Console.WriteLine("Expected output: " + testData.OutputBool); Console.WriteLine("Actual output: " + result); Assert.AreEqual(testData.OutputBool, result); } }
public void BeforeEach() { validPerfectSquare = new ValidPerfectSquare(); }