-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Remove Listing 02.01-02.06 * Add tests for Listing02.11, 22, 28, 29
- Loading branch information
Showing
5 changed files
with
79 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
||
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter02.Listing02_11.Tests | ||
{ | ||
[TestClass] | ||
public class SingleQuoteTests | ||
{ | ||
[TestMethod] | ||
public void Main_WriteSingleQuote() | ||
{ | ||
const string expected = | ||
@"'"; | ||
|
||
IntelliTect.TestTools.Console.ConsoleAssert.Expect( | ||
expected, SingleQuote.Main); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
||
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter02.Listing02_22.Tests | ||
{ | ||
[TestClass] | ||
public class ProgramTests | ||
{ | ||
[TestMethod] | ||
[ExpectedException(typeof(System.OverflowException))] | ||
public void Main_IntegerOverFlow_ExceptionThrown() | ||
{ | ||
IntelliTect.TestTools.Console.ConsoleAssert.Execute("", Program.Main); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
||
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter02.Listing02_28.Tests | ||
{ | ||
[TestClass] | ||
public class ProgramTests | ||
{ | ||
[TestMethod] | ||
public void Main_PrintBoolConvertedToString() | ||
{ | ||
const string expected = "True"; | ||
|
||
IntelliTect.TestTools.Console.ConsoleAssert.Expect( | ||
expected, Program.Main); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
||
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter02.Listing02_29.Tests | ||
{ | ||
[TestClass] | ||
public class ProgramTests | ||
{ | ||
[TestMethod] | ||
public void Main_TryParseStringValidNumber_CorrectlyParsed() | ||
{ | ||
const string expected = | ||
@"Enter a number: <<42>>"; | ||
|
||
IntelliTect.TestTools.Console.ConsoleAssert.Expect( | ||
expected, Program.Main); | ||
} | ||
|
||
[TestMethod] | ||
public void Main_TryParseStringNonNumber_IncorrectInput() | ||
{ | ||
const string expected = | ||
@"Enter a number: <<forty-two | ||
>>The text entered was not a valid number."; | ||
|
||
IntelliTect.TestTools.Console.ConsoleAssert.Expect( | ||
expected, Program.Main); | ||
} | ||
} | ||
} |
35 changes: 0 additions & 35 deletions
35
src/Chapter02/Listing02.01-2.06.SpecifyingLiteralValues.cs
This file was deleted.
Oops, something went wrong.