Click here to Skip to main content
13,143,774 members (33,086 online)
Rate this:
Please Sign up or sign in to vote.
See more:
What will be the test case for this:

Give a Sentence, count the palindrome inside a sentence.Donot consider the palindrome inside a palindrome.Write test case.
Posted 16-Jan-13 2:16am
Sandeep Mewara 16-Jan-13 9:59am
It does not work like this here.

Here is what is expected of enquirers:
1. TRY first what you want to do! You may find that it's not that hard.
2. Formulate what was done by you that looks like an issue/not working.

Try them and tell if you face issues.
Members will be more than happy to help like this.
vjanand8 23-Mar-16 3:43am
using System;

public class Palindrome
public static bool IsPalindrome(string str)
string rev = "";
//string [] words

for(int i = input1.Length-1; i >= 0; i--)
rev += input1[i];

if(str.ToLower() == rev.ToLower())
return true;

return false;

public static void Main(string[] args)
Console.WriteLine(IsPalindrome("Noel sees Leon."));

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

How about a lot of tests of the form:
TestAssert(CountPalindromes("abc") == 0, "Should not find any palindrome");

You had to define a TestAssert function that reports an error if the condition evaluates to false and issues the error message.
Pack the calls into one or several test functions, call them in a main function of a test program.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.170915.1 | Last Updated 16 Jan 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100