-
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.
Renumbered Chapter 18 and added missing listing (#557)
- Loading branch information
1 parent
3c1817c
commit 77f4edd
Showing
22 changed files
with
64 additions
and
50 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
...buteAndCheckingItsInitialization.Tests.cs → ...buteAndCheckingItsInitialization.Tests.cs
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
2 changes: 1 addition & 1 deletion
2
...itionalAttributeToEliminateACall.Tests.cs → ...itionalAttributeToEliminateACall.Tests.cs
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
2 changes: 1 addition & 1 deletion
2
...ts/Listing18.27.GenericException.Tests.cs → ...ts/Listing18.26.GenericException.Tests.cs
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
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
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,27 @@ | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
||
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_28.Tests; | ||
|
||
#if NET7_0_OR_GREATER | ||
[TestClass] | ||
public class GenericExceptionTests | ||
{ | ||
[TestMethod] | ||
public void Method() | ||
{ | ||
try | ||
{ | ||
Program.Main(); | ||
} | ||
catch (InvalidOperationException exception) | ||
{ | ||
Assert.IsTrue( | ||
exception.Message.Contains("'() => { }'") && | ||
exception.Message.Contains("'Method'") && | ||
exception.Message.Contains("'./FileName.cs'")); | ||
// The expected exception, System.DivideByZeroException, | ||
// was not thrown by the expression, 'Method' in the method, './FileName.cs', and file 'C:\Git\EssentialCSharp\src\Chapter18\Listing18.25b.CallerArgumentExpression.cs'. | ||
} | ||
} | ||
} | ||
#endif // NET7_0_OR_GREATER |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
.../Listing18.14.DefiningACustomAttribute.cs → .../Listing18.13.DefiningACustomAttribute.cs
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
2 changes: 1 addition & 1 deletion
2
...isting18.15.RetrievingACustomAttribute.cs → ...isting18.14.RetrievingACustomAttribute.cs
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
2 changes: 1 addition & 1 deletion
2
...g18.16.ProvidingAnAttributeConstructor.cs → ...g18.15.ProvidingAnAttributeConstructor.cs
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
4 changes: 2 additions & 2 deletions
4
...cAttributeAndCheckingItsInitialization.cs → ...cAttributeAndCheckingItsInitialization.cs
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
2 changes: 1 addition & 1 deletion
2
....18.RetrievingCustomAttributeInstances.cs → ....17.RetrievingCustomAttributeInstances.cs
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
4 changes: 2 additions & 2 deletions
4
...andLineHandler.TryParseToHandleAliases.cs → ...andLineHandler.TryParseToHandleAliases.cs
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
2 changes: 1 addition & 1 deletion
2
...ingTheConstructsAnAttributeCanDecorate.cs → ...ingTheConstructsAnAttributeCanDecorate.cs
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
2 changes: 1 addition & 1 deletion
2
...buteRestrictingWhereToApplyAnAttribute.cs → ...buteRestrictingWhereToApplyAnAttribute.cs
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
2 changes: 1 addition & 1 deletion
2
...ibutesUsageWithAttributeUsageAttribute.cs → ...ibutesUsageWithAttributeUsageAttribute.cs
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
2 changes: 1 addition & 1 deletion
2
...er18/Listing18.23.UsingANamedParameter.cs → ...er18/Listing18.22.UsingANamedParameter.cs
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
2 changes: 1 addition & 1 deletion
2
...ter18/Listing18.24.UsingFlagsAttribute.cs → ...ter18/Listing18.23.UsingFlagsAttribute.cs
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
2 changes: 1 addition & 1 deletion
2
...ngConditionalAttributeToEliminateACall.cs → ...ngConditionalAttributeToEliminateACall.cs
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
2 changes: 1 addition & 1 deletion
2
...18/Listing18.26.UsingObsoleteAttribute.cs → ...18/Listing18.25.UsingObsoleteAttribute.cs
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
2 changes: 1 addition & 1 deletion
2
...hapter18/Listing18.27.GenericException.cs → ...hapter18/Listing18.26.GenericException.cs
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
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
16 changes: 16 additions & 0 deletions
16
src/Chapter18/Listing18.28.InvokingCallerAttributesMethod.cs
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,16 @@ | ||
using AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_27; | ||
|
||
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_28; | ||
|
||
#if NET7_0_OR_GREATER | ||
public class Program | ||
{ | ||
public static void Main() | ||
{ | ||
#region INCLUDE | ||
ExpectedException<DivideByZeroException>.AssertExceptionThrown( | ||
() => throw new DivideByZeroException()); | ||
#endregion INCLUDE | ||
} | ||
} | ||
#endif // NET7_0_OR_GREATER |