-
Notifications
You must be signed in to change notification settings - Fork 170
Chapter 5 Code updates #404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
36d2a91
Removed System namespace qualifier
MarkMichaelis da666d6
Removed unnecessary using System declaratives
MarkMichaelis f2c844f
Updated for Chapter 4 Review
MarkMichaelis 2a584af
Minor adjustments to bad sample
MarkMichaelis 25ffad9
Minor adjustments to bad sample
MarkMichaelis f67f176
Merge branch 'Chapter4Edits' of github.com:IntelliTect/EssentialCShar…
MarkMichaelis 5a7b632
Renumbered listings to adjust from Listing 19A
MarkMichaelis b5157af
Reset and update just chapter 1 submodule
BenjaminMichaelis 7d64152
Merge remote-tracking branch 'origin/STATIC-chapter1' into Chapter4Edits
MarkMichaelis 318394d
Minor indenting updates
MarkMichaelis d35bf90
Provided Table4.4 with unit tests
MarkMichaelis d80d4d4
Added comment labels to the code.
MarkMichaelis 482ade8
Updated for Chapter 4 manuscript changes.
MarkMichaelis bc6dece
Removed System namespace qualifier
MarkMichaelis 4cc5897
Switching to file based namespaces
MarkMichaelis 9488f88
Updated with Chapter 5 manuscript changes.
MarkMichaelis 2550866
Additional Chapter 5 Changes
MarkMichaelis 228ffcf
Merge remote-tracking branch 'origin/v9.0' into Chapter5Updates
MarkMichaelis f04af76
Renumber Chapter 5
MarkMichaelis adafa8e
Update src/Chapter05.Tests/Listing05.15.Tests.cs
MarkMichaelis ceb97fd
Update src/Chapter05.Tests/Listing05.15.Tests.cs
MarkMichaelis bfee112
Update src/Chapter05.Tests/Listing05.15.Tests.cs
MarkMichaelis aa214e8
Update src/Chapter05.Tests/Listing05.21.Tests.cs
MarkMichaelis 8282563
Update src/Chapter05/Listing05.29.ThrowingAnException.cs
MarkMichaelis 901a77f
Update src/Chapter05/Chapter05.csproj
MarkMichaelis 4c2989e
Remove unnecessary using directives.
MarkMichaelis 48ad53f
Remove 404
MarkMichaelis 1edd927
Remove Windows pathing
MarkMichaelis 383d058
White space adjustments
MarkMichaelis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,7 @@ | ||
| namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Tests; | ||
|
|
||
| public class Constants | ||
| { | ||
| public const string Inigo = "Inigo"; | ||
| public const string Montoya = "Montoya"; | ||
| } | ||
This file contains hidden or 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 @@ | ||
| global using static AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Tests.Constants; |
19 changes: 9 additions & 10 deletions
19
src/Chapter05.Tests/Listing05.02.SimpleMethodCall.Tests.cs
This file contains hidden or 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 |
|---|---|---|
| @@ -1,21 +1,20 @@ | ||
| using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
|
||
| namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_02.Tests | ||
| namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_02.Tests; | ||
|
|
||
| [TestClass] | ||
| public class HeyYouTests | ||
| { | ||
| [TestClass] | ||
| public class HeyYouTests | ||
| [TestMethod] | ||
| public void Main_MethodCalls_MethodsCalledSuccessfully() | ||
| { | ||
| [TestMethod] | ||
| public void Main_MethodCalls_MethodsCalledSuccessfully() | ||
| { | ||
| const string expected = | ||
| 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); | ||
| } | ||
| IntelliTect.TestTools.Console.ConsoleAssert.Expect( | ||
| expected, HeyYou.Main); | ||
| } | ||
| } |
21 changes: 10 additions & 11 deletions
21
...Chapter05.Tests/Listing05.03.PassingAMethodReturnAsAParameterToAnotherMethodCall.Tests.cs
This file contains hidden or 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 |
|---|---|---|
| @@ -1,19 +1,18 @@ | ||
| using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
|
||
| namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_03.Tests | ||
| namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_03.Tests; | ||
|
|
||
| [TestClass] | ||
| public class ProgramTests | ||
| { | ||
| [TestClass] | ||
| public class ProgramTests | ||
| [TestMethod] | ||
| public void Main_InputInigo_WriteHelloInigo() | ||
| { | ||
| [TestMethod] | ||
| public void Main_InputInigo_WriteHelloInigo() | ||
| { | ||
| const string expected = | ||
| @"Enter your first name: <<Inigo | ||
| const string expected = | ||
| @"Enter your first name: <<Inigo | ||
| >>Hello Inigo!"; | ||
|
|
||
| IntelliTect.TestTools.Console.ConsoleAssert.Expect( | ||
| expected, Program.Main); | ||
| } | ||
| IntelliTect.TestTools.Console.ConsoleAssert.Expect( | ||
| expected, Program.Main); | ||
| } | ||
| } |
25 changes: 12 additions & 13 deletions
25
src/Chapter05.Tests/Listing05.04.DeclaringAMethod.Tests.cs
This file contains hidden or 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 |
|---|---|---|
| @@ -1,24 +1,23 @@ | ||
| using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
|
||
| namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_04.Tests | ||
| namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_04.Tests; | ||
|
|
||
| [TestClass] | ||
| public class ProgramTests | ||
| { | ||
| [TestClass] | ||
| public class ProgramTests | ||
| [TestMethod] | ||
| public void Main_InputInigoMontoya_WriteFullName() | ||
| { | ||
| [TestMethod] | ||
| public void Main_InputInigoMontoya_WriteFullName() | ||
| { | ||
| string view = | ||
| string view = | ||
| @"Hey you! | ||
| Enter your first name: <<Inigo | ||
| >>Enter your last name: <<Montoya | ||
| >>Hello Inigo Montoya! Your initials are I. M."; | ||
|
|
||
| IntelliTect.TestTools.Console.ConsoleAssert.Expect(view, | ||
| () => | ||
| { | ||
| IntroducingMethods.Main(); | ||
| }); | ||
| } | ||
| IntelliTect.TestTools.Console.ConsoleAssert.Expect(view, | ||
| () => | ||
| { | ||
| IntroducingMethods.Main(); | ||
| }); | ||
| } | ||
| } |
25 changes: 12 additions & 13 deletions
25
src/Chapter05.Tests/Listing05.06.ReturningMultipleValuesViaTuple.Tests.cs
This file contains hidden or 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 |
|---|---|---|
| @@ -1,23 +1,22 @@ | ||
| using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
|
||
| namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_06.Tests | ||
| namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_06.Tests; | ||
|
|
||
| [TestClass] | ||
| public class ProgramTests | ||
| { | ||
| [TestClass] | ||
| public class ProgramTests | ||
| [TestMethod] | ||
| public void Main_InputInigoMontoya_WriteFullName() | ||
| { | ||
| [TestMethod] | ||
| public void Main_InputInigoMontoya_WriteFullName() | ||
| { | ||
| string view = | ||
| string view = | ||
| @"Enter your first name: <<Inigo | ||
| >>Enter your last name: <<Montoya | ||
| >>Hello Inigo Montoya!"; | ||
|
|
||
| IntelliTect.TestTools.Console.ConsoleAssert.Expect(view, | ||
| () => | ||
| { | ||
| Program.Main(); | ||
| }); | ||
| } | ||
| IntelliTect.TestTools.Console.ConsoleAssert.Expect(view, | ||
| () => | ||
| { | ||
| Program.Main(); | ||
| }); | ||
| } | ||
| } |
20 changes: 0 additions & 20 deletions
20
src/Chapter05.Tests/Listing05.07.UsingDirectiveExample.Tests.cs
This file was deleted.
Oops, something went wrong.
18 changes: 0 additions & 18 deletions
18
...pter05.Tests/Listing05.08.SpecifyingTheUsingDirectiveInsideANamespaceDeclaration.Tests.cs
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,24 @@ | ||
| using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
|
||
| namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_08.Tests; | ||
|
|
||
| [TestClass] | ||
| public class ProgramTests | ||
| { | ||
| [TestMethod] | ||
| public void Main_InputInigoMontoya_WriteFullName() | ||
| { | ||
| string view = """ | ||
| Enter your first name: <<Inigo | ||
| >> | ||
| Enter your middle initial: <<T. | ||
| >> | ||
| Enter your last name: <<Montoya | ||
| >> | ||
| Hello Inigo T. Montoya! | ||
| """; | ||
|
|
||
| IntelliTect.TestTools.Console.ConsoleAssert.Expect(view, | ||
| Program.Main); | ||
| } | ||
| } |
21 changes: 0 additions & 21 deletions
21
src/Chapter05.Tests/Listing05.09.UsingStaticDirective.Tests.cs
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,23 @@ | ||
| using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
|
||
| namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_10.Tests; | ||
|
|
||
| [TestClass] | ||
| public class ProgramTests | ||
| { | ||
| public const string Initial = "T"; | ||
| public static string Expected = $""" | ||
| Enter your full name (e.g. Inigo T. Montoya): <<{Inigo} {Initial}. {Montoya} | ||
| >> | ||
| FirstName: {Inigo} | ||
| Initial: {Initial} | ||
| LastName: {Montoya} | ||
| """; | ||
|
|
||
| [TestMethod] | ||
| public void Main_WriteMyName() | ||
| { | ||
| IntelliTect.TestTools.Console.ConsoleAssert.Expect(Expected, | ||
| Program.Main); | ||
| } | ||
| } |
This file contains hidden or 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.Chapter05.Listing05_11.Tests; | ||
|
|
||
| [TestClass] | ||
| public class ProgramTests | ||
| { | ||
|
|
||
| [TestMethod] | ||
| public void Main_UsingToAvoidFullyQualifying_MethodCalledAsExpected() | ||
| { | ||
| IntelliTect.TestTools.Console.ConsoleAssert.Expect( | ||
| Listing05_10.Tests.ProgramTests.Expected, Program.Main); | ||
| } | ||
| } |
40 changes: 0 additions & 40 deletions
40
src/Chapter05.Tests/Listing05.12.PassingCommandLineArgumentsToMain.Tests.cs
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,20 @@ | ||
| using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
|
||
| namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_12.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); | ||
| } | ||
| } |
21 changes: 0 additions & 21 deletions
21
src/Chapter05.Tests/Listing05.13.PassingVariablesByValue.Tests.cs
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
src/Chapter05.Tests/Listing05.14.PassingVariablesByReference.Tests.cs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.