Skip to content

Commit

Permalink
Add tests chapter05 v8 (#81)
Browse files Browse the repository at this point in the history
* Add tests for 2,8,9. Make 5.09 public

* Delete extra listing 5.33

* Copy Listing4.26 to Chapter5.28

* Move Listing04.25B to Listing04.26
  • Loading branch information
COsborn2 authored Jul 26, 2019
1 parent a7a821c commit 0432e9f
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 47 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter04.Listing04_25B.Tests
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter04.Listing04_26.Tests
{
[TestClass]
public class ProgramTests
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;

namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter04.Listing04_25B
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter04.Listing04_26
{
public class Program
{
Expand Down
20 changes: 20 additions & 0 deletions src/Chapter05.Tests/Listing05.02.SimpleMethodCall.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_02.Tests
{
[TestClass]
public class HeyYouTests
{
[TestMethod]
public void Main_MethodCalls_MethodsCalledSuccessfully()
{
const string expected =
@"Hey you!Enter your first name: <<Inigo
>>Enter your last name: <<Montoya
>>Your full name is Inigo Montoya.";

IntelliTect.TestTools.Console.ConsoleAssert.Expect(
expected, HeyYou.Main);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_08.Tests
{
[TestClass]
public class HelloWorldTests
{
[TestMethod]
public void Main_UsingToAvoidFullyQualifying_MethodCalledAsExpected()
{
const string expected =
@"Hello, my name is Inigo Montoya";

IntelliTect.TestTools.Console.ConsoleAssert.Expect(
expected, HelloWorld.Main);
}
}
}
21 changes: 21 additions & 0 deletions src/Chapter05.Tests/Listing05.09.UsingStaticDirective.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_09.Tests
{
[TestClass]
public class HeyYouTests
{
[TestMethod]
public void Main_StaticUsing_MethodsCalledNormally()
{
const string expected =
@"Hey you!
Enter your first name: <<Inigo
>>Enter your last name: <<Montoya
>>Your full name is Inigo Montoya.";

IntelliTect.TestTools.Console.ConsoleAssert.Expect(
expected, HeyYou.Main);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter04.Listing04_26.Tests
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_28.Tests
{
[TestClass]
public class LeveragingTryParseTests
Expand Down
4 changes: 2 additions & 2 deletions src/Chapter05/Listing05.09.UsingStaticDirective.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_09
{
using static System.Console;

class HeyYou
public class HeyYou
{
static void Main()
public static void Main()
{
string firstName;
string lastName;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter04.Listing04_26
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_28
{
public class LeveragingTryParse
{
Expand Down

This file was deleted.

0 comments on commit 0432e9f

Please sign in to comment.