static void Main(string[] args) { var greeting = new Greeting(); Console.WriteLine(greeting.SayHello()); Console.ReadKey(); }
public void It_should_return_a_string_containtig_a_nice_greeting() { var sut = new Greeting(); var res = sut.SayHello(); Assert.IsTrue(res.Contains("Hello")); }
static void Main(string[] args) { Write("Enter user name:"); string userName = ReadLine(); Clear(); WriteLine(Greeting.SayHello(userName)); ReadKey(); }
static void Main(string[] args) { string name = Console.ReadLine(); Greeting greeting = new Greeting(); string text = greeting.SayHello(name); Console.WriteLine(text); }
private void button1_Click(object sender, EventArgs e) { string name = textBox.Text; Greeting greeting = new Greeting(); string text = greeting.SayHello(name); MessageBox.Show(name); }
public void TestMethod1() { var receiver = new Mock <IRecevier>(); var greeting = new Greeting(receiver.Object); greeting.SayHello("World"); receiver.Verify(m => m.ReceiveMessage("Hello World!")); }
public void SayHello_HelloConcatWithEmptyString_Return_HelloUnknown() { string userName = string.Empty; string expected = "Hello, unknown!"; string actual = Greeting.SayHello(userName); Assert.AreEqual(expected, actual); }
public void SayHello_HelloConcatWithJohn_ReturnHelloJohn() { string userName = "******"; string expected = "Hello, John!"; string actual = Greeting.SayHello(userName); Assert.AreEqual(expected, actual); }
public void SayHello_HelloConcatWithAlex_ReturnHelloAlex() { string userName = "******"; string expected = "Hello, Alex!"; string actual = Greeting.SayHello(userName); Assert.AreEqual(expected, actual); }
public void SayHelloSuccessfulTests(string userName, string expected) { string actual = Greeting.SayHello(userName); Assert.AreEqual(expected, actual); }
public void SayHello_HelloConcatWithConcreteUserNameOrEmpty(string userName, string expected) { string actual = Greeting.SayHello(userName); Assert.AreEqual(expected, actual); }
public void SayHello_HelloConcatWithNull_Throw_ArgumentNullException() { Assert.ThrowsException <ArgumentNullException>(() => Greeting.SayHello(null), message: "Method generates ArgumentNullException in case user name is null"); }
private void Button_Click(object sender, RoutedEventArgs e) { var greeting = new Greeting(); MessageBox.Show(greeting.SayHello()); }
public void SayHello_HelloConcatWithNull_Throw_ArgumentNullException() { string userName = null; Greeting.SayHello(userName); }