public void IfStringIsNullReturnNull() { string value = null; var result = subject.Reverse(value); Assert.IsNull(result); }
[InlineData("eye", "eye")] // This is a palindrome! public void ShouldReverseWordSuccessfully(string input, string expected) { // Arrange | Act var result = Reverser.Reverse(input); // Assert Equal(expected, result); }
public void Reverse_InvalidString_ReturnsNull() { //Arrange - initialize objects Reverser reverser = new Reverser(); //Act var result = reverser.Reverse(null); //Assert Assert.AreEqual(null, result); }
public void Reverse_ValidString_ReturnsReversedString() { //Arrange - initialize objects Reverser reverser = new Reverser(); //Act var result = reverser.Reverse("abcdef"); //Assert Assert.AreEqual("fedcba", result); }
private static void Main(string[] args) { var reverser = new Reverser(); while (true) { Console.Write("Enter a word to reverse: "); Console.WriteLine(reverser.Reverse(Console.ReadLine())); } }
public void ShouldReverseWordToExpected(string input, string expected) { // Arrange var reverser = new Reverser(input); // Act var result = reverser.Reverse(); // Assert AreEqual(expected, result); }
public void Should_reverse_one_word() { string result = _reverser.Reverse("hello"); Assert.AreEqual("olleh", result); }
public void ReverseTest(string text,string expected) { var reverse = new Reverser(); string result = reverse.Reverse(text); StringAssert.AreEqualIgnoringCase(result, expected); }
//https://msdn.microsoft.com/en-us//library/bb383977.aspx public static string ReverseSentence(this string sentence) { var reverser = new Reverser(); return(reverser.Reverse(sentence)); }
public ActionResult Test(string word) { return(Json(_reverser.Reverse(word))); }