From a2da2baf9b84fad840c85f320de6163989366250 Mon Sep 17 00:00:00 2001 From: Mark Michaelis Date: Thu, 21 Sep 2023 10:35:38 +0100 Subject: [PATCH 1/2] Added missing listing --- ...ing18.28.CallerArgumentExpression.Tests.cs | 23 ---------------- src/Chapter18.Tests/Listing18.28a.Tests.cs | 27 +++++++++++++++++++ ...ileForResequencingListings.Placeholder.cs} | 0 .../Listing18.28.CallerArgumentExpression.cs | 6 ----- ...ng18.28a.InvokingCallerAttributesMethod.cs | 17 ++++++++++++ 5 files changed, 44 insertions(+), 29 deletions(-) create mode 100644 src/Chapter18.Tests/Listing18.28a.Tests.cs rename src/Chapter18/{Listing18.13.csprojMockFileForResequencingListings.Placeholder.cs => Listing18.12.csprojMockFileForResequencingListings.Placeholder.cs} (100%) create mode 100644 src/Chapter18/Listing18.28a.InvokingCallerAttributesMethod.cs diff --git a/src/Chapter18.Tests/Listing18.28.CallerArgumentExpression.Tests.cs b/src/Chapter18.Tests/Listing18.28.CallerArgumentExpression.Tests.cs index 9eb8b2c55..c4ff2c651 100644 --- a/src/Chapter18.Tests/Listing18.28.CallerArgumentExpression.Tests.cs +++ b/src/Chapter18.Tests/Listing18.28.CallerArgumentExpression.Tests.cs @@ -27,29 +27,6 @@ public void VerifyExpectedExceptionMessage() } } - [TestMethod] - public void Method() - { - try - { - SampleTests.Method(); - } - 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'. - } - } - - private object PassingMethodNameAndFileName() - { - throw new NotImplementedException(); - } - [TestMethod] [ExpectedException(typeof(InvalidOperationException))] public void ExpectedExceptionIsNotThrown() diff --git a/src/Chapter18.Tests/Listing18.28a.Tests.cs b/src/Chapter18.Tests/Listing18.28a.Tests.cs new file mode 100644 index 000000000..1d70f9d72 --- /dev/null +++ b/src/Chapter18.Tests/Listing18.28a.Tests.cs @@ -0,0 +1,27 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_28a.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 diff --git a/src/Chapter18/Listing18.13.csprojMockFileForResequencingListings.Placeholder.cs b/src/Chapter18/Listing18.12.csprojMockFileForResequencingListings.Placeholder.cs similarity index 100% rename from src/Chapter18/Listing18.13.csprojMockFileForResequencingListings.Placeholder.cs rename to src/Chapter18/Listing18.12.csprojMockFileForResequencingListings.Placeholder.cs diff --git a/src/Chapter18/Listing18.28.CallerArgumentExpression.cs b/src/Chapter18/Listing18.28.CallerArgumentExpression.cs index 8391d837f..1191d743e 100644 --- a/src/Chapter18/Listing18.28.CallerArgumentExpression.cs +++ b/src/Chapter18/Listing18.28.CallerArgumentExpression.cs @@ -13,12 +13,6 @@ public static void ThrowArgumentNullExceptionTest() { var result = 1/"".Length; } - -public static void Method() -{ - ExpectedException.AssertExceptionThrown( - () => throw new DivideByZeroException()); -} } [AttributeUsage(AttributeTargets.Method)] diff --git a/src/Chapter18/Listing18.28a.InvokingCallerAttributesMethod.cs b/src/Chapter18/Listing18.28a.InvokingCallerAttributesMethod.cs new file mode 100644 index 000000000..b00d36096 --- /dev/null +++ b/src/Chapter18/Listing18.28a.InvokingCallerAttributesMethod.cs @@ -0,0 +1,17 @@ +using System.Runtime.CompilerServices; +using AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_28; + +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_28a; + +#if NET7_0_OR_GREATER +public class Program +{ + public static void Main() + { + #region INCLUDE + ExpectedException.AssertExceptionThrown( + () => throw new DivideByZeroException()); + #endregion INCLUDE + } +} +#endif // NET7_0_OR_GREATER From 8d8891a34d315bd09ac7af46dfd9a4ee53a1a002 Mon Sep 17 00:00:00 2001 From: Mark Michaelis Date: Thu, 21 Sep 2023 10:40:47 +0100 Subject: [PATCH 2/2] Renumber --- ...gASpecificAttributeAndCheckingItsInitialization.Tests.cs} | 2 +- ...18.24.UsingConditionalAttributeToEliminateACall.Tests.cs} | 2 +- ...ption.Tests.cs => Listing18.26.GenericException.Tests.cs} | 2 +- ...sts.cs => Listing18.27.CallerArgumentExpression.Tests.cs} | 2 +- src/Chapter18.Tests/Listing18.28a.Tests.cs | 2 +- ...Attribute.cs => Listing18.13.DefiningACustomAttribute.cs} | 2 +- ...tribute.cs => Listing18.14.RetrievingACustomAttribute.cs} | 2 +- ...or.cs => Listing18.15.ProvidingAnAttributeConstructor.cs} | 2 +- ...rievingASpecificAttributeAndCheckingItsInitialization.cs} | 4 ++-- ...cs => Listing18.17.RetrievingCustomAttributeInstances.cs} | 2 +- ...18.UpdatingCommandLineHandler.TryParseToHandleAliases.cs} | 4 ++-- ...g18.19.RestrictingTheConstructsAnAttributeCanDecorate.cs} | 2 +- ...ibuteUsageAttributeRestrictingWhereToApplyAnAttribute.cs} | 2 +- ....LimitingAnAttributesUsageWithAttributeUsageAttribute.cs} | 2 +- ...amedParameter.cs => Listing18.22.UsingANamedParameter.cs} | 2 +- ...FlagsAttribute.cs => Listing18.23.UsingFlagsAttribute.cs} | 2 +- ...isting18.24.UsingConditionalAttributeToEliminateACall.cs} | 2 +- ...teAttribute.cs => Listing18.25.UsingObsoleteAttribute.cs} | 2 +- ....GenericException.cs => Listing18.26.GenericException.cs} | 2 +- ...xpression.cs => Listing18.27.CallerArgumentExpression.cs} | 2 +- ...hod.cs => Listing18.28.InvokingCallerAttributesMethod.cs} | 5 ++--- 21 files changed, 24 insertions(+), 25 deletions(-) rename src/Chapter18.Tests/{Listing18.17.RetrievingASpecificAttributeAndCheckingItsInitialization.Tests.cs => Listing18.16.RetrievingASpecificAttributeAndCheckingItsInitialization.Tests.cs} (95%) rename src/Chapter18.Tests/{Listing18.25.UsingConditionalAttributeToEliminateACall.Tests.cs => Listing18.24.UsingConditionalAttributeToEliminateACall.Tests.cs} (96%) rename src/Chapter18.Tests/{Listing18.27.GenericException.Tests.cs => Listing18.26.GenericException.Tests.cs} (97%) rename src/Chapter18.Tests/{Listing18.28.CallerArgumentExpression.Tests.cs => Listing18.27.CallerArgumentExpression.Tests.cs} (98%) rename src/Chapter18/{Listing18.14.DefiningACustomAttribute.cs => Listing18.13.DefiningACustomAttribute.cs} (94%) rename src/Chapter18/{Listing18.15.RetrievingACustomAttribute.cs => Listing18.14.RetrievingACustomAttribute.cs} (98%) rename src/Chapter18/{Listing18.16.ProvidingAnAttributeConstructor.cs => Listing18.15.ProvidingAnAttributeConstructor.cs} (98%) rename src/Chapter18/{Listing18.17.RetrievingASpecificAttributeAndCheckingItsInitialization.cs => Listing18.16.RetrievingASpecificAttributeAndCheckingItsInitialization.cs} (97%) rename src/Chapter18/{Listing18.18.RetrievingCustomAttributeInstances.cs => Listing18.17.RetrievingCustomAttributeInstances.cs} (99%) rename src/Chapter18/{Listing18.19.UpdatingCommandLineHandler.TryParseToHandleAliases.cs => Listing18.18.UpdatingCommandLineHandler.TryParseToHandleAliases.cs} (99%) rename src/Chapter18/{Listing18.20.RestrictingTheConstructsAnAttributeCanDecorate.cs => Listing18.19.RestrictingTheConstructsAnAttributeCanDecorate.cs} (95%) rename src/Chapter18/{Listing18.21.AttributeUsageAttributeRestrictingWhereToApplyAnAttribute.cs => Listing18.20.AttributeUsageAttributeRestrictingWhereToApplyAnAttribute.cs} (96%) rename src/Chapter18/{Listing18.22.LimitingAnAttributesUsageWithAttributeUsageAttribute.cs => Listing18.21.LimitingAnAttributesUsageWithAttributeUsageAttribute.cs} (97%) rename src/Chapter18/{Listing18.23.UsingANamedParameter.cs => Listing18.22.UsingANamedParameter.cs} (95%) rename src/Chapter18/{Listing18.24.UsingFlagsAttribute.cs => Listing18.23.UsingFlagsAttribute.cs} (98%) rename src/Chapter18/{Listing18.25.UsingConditionalAttributeToEliminateACall.cs => Listing18.24.UsingConditionalAttributeToEliminateACall.cs} (98%) rename src/Chapter18/{Listing18.26.UsingObsoleteAttribute.cs => Listing18.25.UsingObsoleteAttribute.cs} (96%) rename src/Chapter18/{Listing18.27.GenericException.cs => Listing18.26.GenericException.cs} (98%) rename src/Chapter18/{Listing18.28.CallerArgumentExpression.cs => Listing18.27.CallerArgumentExpression.cs} (99%) rename src/Chapter18/{Listing18.28a.InvokingCallerAttributesMethod.cs => Listing18.28.InvokingCallerAttributesMethod.cs} (88%) diff --git a/src/Chapter18.Tests/Listing18.17.RetrievingASpecificAttributeAndCheckingItsInitialization.Tests.cs b/src/Chapter18.Tests/Listing18.16.RetrievingASpecificAttributeAndCheckingItsInitialization.Tests.cs similarity index 95% rename from src/Chapter18.Tests/Listing18.17.RetrievingASpecificAttributeAndCheckingItsInitialization.Tests.cs rename to src/Chapter18.Tests/Listing18.16.RetrievingASpecificAttributeAndCheckingItsInitialization.Tests.cs index 385d14948..8b36398f2 100644 --- a/src/Chapter18.Tests/Listing18.17.RetrievingASpecificAttributeAndCheckingItsInitialization.Tests.cs +++ b/src/Chapter18.Tests/Listing18.16.RetrievingASpecificAttributeAndCheckingItsInitialization.Tests.cs @@ -1,6 +1,6 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_17.Tests; +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_16.Tests; [TestClass] public class ProgramTests diff --git a/src/Chapter18.Tests/Listing18.25.UsingConditionalAttributeToEliminateACall.Tests.cs b/src/Chapter18.Tests/Listing18.24.UsingConditionalAttributeToEliminateACall.Tests.cs similarity index 96% rename from src/Chapter18.Tests/Listing18.25.UsingConditionalAttributeToEliminateACall.Tests.cs rename to src/Chapter18.Tests/Listing18.24.UsingConditionalAttributeToEliminateACall.Tests.cs index 1fe007a7f..433efe51c 100644 --- a/src/Chapter18.Tests/Listing18.25.UsingConditionalAttributeToEliminateACall.Tests.cs +++ b/src/Chapter18.Tests/Listing18.24.UsingConditionalAttributeToEliminateACall.Tests.cs @@ -1,6 +1,6 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_25.Tests; +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_24.Tests; [TestClass] public class ProgramTests diff --git a/src/Chapter18.Tests/Listing18.27.GenericException.Tests.cs b/src/Chapter18.Tests/Listing18.26.GenericException.Tests.cs similarity index 97% rename from src/Chapter18.Tests/Listing18.27.GenericException.Tests.cs rename to src/Chapter18.Tests/Listing18.26.GenericException.Tests.cs index b4f07bb66..902709e4c 100644 --- a/src/Chapter18.Tests/Listing18.27.GenericException.Tests.cs +++ b/src/Chapter18.Tests/Listing18.26.GenericException.Tests.cs @@ -1,6 +1,6 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_27.Tests; +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_26.Tests; #if NET7_0_OR_GREATER [TestClass] diff --git a/src/Chapter18.Tests/Listing18.28.CallerArgumentExpression.Tests.cs b/src/Chapter18.Tests/Listing18.27.CallerArgumentExpression.Tests.cs similarity index 98% rename from src/Chapter18.Tests/Listing18.28.CallerArgumentExpression.Tests.cs rename to src/Chapter18.Tests/Listing18.27.CallerArgumentExpression.Tests.cs index c4ff2c651..6901536f3 100644 --- a/src/Chapter18.Tests/Listing18.28.CallerArgumentExpression.Tests.cs +++ b/src/Chapter18.Tests/Listing18.27.CallerArgumentExpression.Tests.cs @@ -1,6 +1,6 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_28.Tests; +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_27.Tests; #if NET7_0_OR_GREATER [TestClass] diff --git a/src/Chapter18.Tests/Listing18.28a.Tests.cs b/src/Chapter18.Tests/Listing18.28a.Tests.cs index 1d70f9d72..f78c728e8 100644 --- a/src/Chapter18.Tests/Listing18.28a.Tests.cs +++ b/src/Chapter18.Tests/Listing18.28a.Tests.cs @@ -1,6 +1,6 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_28a.Tests; +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_28.Tests; #if NET7_0_OR_GREATER [TestClass] diff --git a/src/Chapter18/Listing18.14.DefiningACustomAttribute.cs b/src/Chapter18/Listing18.13.DefiningACustomAttribute.cs similarity index 94% rename from src/Chapter18/Listing18.14.DefiningACustomAttribute.cs rename to src/Chapter18/Listing18.13.DefiningACustomAttribute.cs index b2054f8f6..1c8874a4a 100644 --- a/src/Chapter18/Listing18.14.DefiningACustomAttribute.cs +++ b/src/Chapter18/Listing18.13.DefiningACustomAttribute.cs @@ -1,4 +1,4 @@ -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_14; +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_13; #region INCLUDE public class CommandLineSwitchRequiredAttribute : Attribute diff --git a/src/Chapter18/Listing18.15.RetrievingACustomAttribute.cs b/src/Chapter18/Listing18.14.RetrievingACustomAttribute.cs similarity index 98% rename from src/Chapter18/Listing18.15.RetrievingACustomAttribute.cs rename to src/Chapter18/Listing18.14.RetrievingACustomAttribute.cs index cb75dec97..de95efd07 100644 --- a/src/Chapter18/Listing18.15.RetrievingACustomAttribute.cs +++ b/src/Chapter18/Listing18.14.RetrievingACustomAttribute.cs @@ -1,4 +1,4 @@ -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_15; +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_14; #region INCLUDE using System.Reflection; diff --git a/src/Chapter18/Listing18.16.ProvidingAnAttributeConstructor.cs b/src/Chapter18/Listing18.15.ProvidingAnAttributeConstructor.cs similarity index 98% rename from src/Chapter18/Listing18.16.ProvidingAnAttributeConstructor.cs rename to src/Chapter18/Listing18.15.ProvidingAnAttributeConstructor.cs index 6999f2219..4e47f2541 100644 --- a/src/Chapter18/Listing18.16.ProvidingAnAttributeConstructor.cs +++ b/src/Chapter18/Listing18.15.ProvidingAnAttributeConstructor.cs @@ -1,4 +1,4 @@ -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_16; +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_15; #region INCLUDE public class CommandLineSwitchAliasAttribute : Attribute diff --git a/src/Chapter18/Listing18.17.RetrievingASpecificAttributeAndCheckingItsInitialization.cs b/src/Chapter18/Listing18.16.RetrievingASpecificAttributeAndCheckingItsInitialization.cs similarity index 97% rename from src/Chapter18/Listing18.17.RetrievingASpecificAttributeAndCheckingItsInitialization.cs rename to src/Chapter18/Listing18.16.RetrievingASpecificAttributeAndCheckingItsInitialization.cs index 350d0d664..7f2cfcd58 100644 --- a/src/Chapter18/Listing18.17.RetrievingASpecificAttributeAndCheckingItsInitialization.cs +++ b/src/Chapter18/Listing18.16.RetrievingASpecificAttributeAndCheckingItsInitialization.cs @@ -1,6 +1,6 @@ -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_17; +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_16; -using AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_16; +using AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_15; using System.Reflection; public class Program diff --git a/src/Chapter18/Listing18.18.RetrievingCustomAttributeInstances.cs b/src/Chapter18/Listing18.17.RetrievingCustomAttributeInstances.cs similarity index 99% rename from src/Chapter18/Listing18.18.RetrievingCustomAttributeInstances.cs rename to src/Chapter18/Listing18.17.RetrievingCustomAttributeInstances.cs index 517748baf..1d6d80569 100644 --- a/src/Chapter18/Listing18.18.RetrievingCustomAttributeInstances.cs +++ b/src/Chapter18/Listing18.17.RetrievingCustomAttributeInstances.cs @@ -1,4 +1,4 @@ -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_18; +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_17; #region INCLUDE using System.Reflection; diff --git a/src/Chapter18/Listing18.19.UpdatingCommandLineHandler.TryParseToHandleAliases.cs b/src/Chapter18/Listing18.18.UpdatingCommandLineHandler.TryParseToHandleAliases.cs similarity index 99% rename from src/Chapter18/Listing18.19.UpdatingCommandLineHandler.TryParseToHandleAliases.cs rename to src/Chapter18/Listing18.18.UpdatingCommandLineHandler.TryParseToHandleAliases.cs index 1a3f1c47c..9f345bcd8 100644 --- a/src/Chapter18/Listing18.19.UpdatingCommandLineHandler.TryParseToHandleAliases.cs +++ b/src/Chapter18/Listing18.18.UpdatingCommandLineHandler.TryParseToHandleAliases.cs @@ -1,6 +1,6 @@ -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_19; +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_18; -using Listing18_18; +using Listing18_17; #region INCLUDE using System.Reflection; using System.Collections.Generic; diff --git a/src/Chapter18/Listing18.20.RestrictingTheConstructsAnAttributeCanDecorate.cs b/src/Chapter18/Listing18.19.RestrictingTheConstructsAnAttributeCanDecorate.cs similarity index 95% rename from src/Chapter18/Listing18.20.RestrictingTheConstructsAnAttributeCanDecorate.cs rename to src/Chapter18/Listing18.19.RestrictingTheConstructsAnAttributeCanDecorate.cs index a5d6d6c30..d43846bf5 100644 --- a/src/Chapter18/Listing18.20.RestrictingTheConstructsAnAttributeCanDecorate.cs +++ b/src/Chapter18/Listing18.19.RestrictingTheConstructsAnAttributeCanDecorate.cs @@ -1,4 +1,4 @@ -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_20; +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_19; #region INCLUDE [AttributeUsage(AttributeTargets.Property)] diff --git a/src/Chapter18/Listing18.21.AttributeUsageAttributeRestrictingWhereToApplyAnAttribute.cs b/src/Chapter18/Listing18.20.AttributeUsageAttributeRestrictingWhereToApplyAnAttribute.cs similarity index 96% rename from src/Chapter18/Listing18.21.AttributeUsageAttributeRestrictingWhereToApplyAnAttribute.cs rename to src/Chapter18/Listing18.20.AttributeUsageAttributeRestrictingWhereToApplyAnAttribute.cs index dd6978287..606196aa4 100644 --- a/src/Chapter18/Listing18.21.AttributeUsageAttributeRestrictingWhereToApplyAnAttribute.cs +++ b/src/Chapter18/Listing18.20.AttributeUsageAttributeRestrictingWhereToApplyAnAttribute.cs @@ -1,4 +1,4 @@ -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_21; +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_20; // Will not compile if uncommented /* diff --git a/src/Chapter18/Listing18.22.LimitingAnAttributesUsageWithAttributeUsageAttribute.cs b/src/Chapter18/Listing18.21.LimitingAnAttributesUsageWithAttributeUsageAttribute.cs similarity index 97% rename from src/Chapter18/Listing18.22.LimitingAnAttributesUsageWithAttributeUsageAttribute.cs rename to src/Chapter18/Listing18.21.LimitingAnAttributesUsageWithAttributeUsageAttribute.cs index 3676b0826..e050de1f8 100644 --- a/src/Chapter18/Listing18.22.LimitingAnAttributesUsageWithAttributeUsageAttribute.cs +++ b/src/Chapter18/Listing18.21.LimitingAnAttributesUsageWithAttributeUsageAttribute.cs @@ -1,4 +1,4 @@ -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_22; +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_21; #region INCLUDE // Restrict the attribute to properties and methods diff --git a/src/Chapter18/Listing18.23.UsingANamedParameter.cs b/src/Chapter18/Listing18.22.UsingANamedParameter.cs similarity index 95% rename from src/Chapter18/Listing18.23.UsingANamedParameter.cs rename to src/Chapter18/Listing18.22.UsingANamedParameter.cs index c035f7ee0..4e6997b34 100644 --- a/src/Chapter18/Listing18.23.UsingANamedParameter.cs +++ b/src/Chapter18/Listing18.22.UsingANamedParameter.cs @@ -1,4 +1,4 @@ -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_23; +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_22; #region INCLUDE [AttributeUsage(AttributeTargets.Property, AllowMultiple = true)] diff --git a/src/Chapter18/Listing18.24.UsingFlagsAttribute.cs b/src/Chapter18/Listing18.23.UsingFlagsAttribute.cs similarity index 98% rename from src/Chapter18/Listing18.24.UsingFlagsAttribute.cs rename to src/Chapter18/Listing18.23.UsingFlagsAttribute.cs index 137200e80..15afe8c2d 100644 --- a/src/Chapter18/Listing18.24.UsingFlagsAttribute.cs +++ b/src/Chapter18/Listing18.23.UsingFlagsAttribute.cs @@ -1,4 +1,4 @@ -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_24; +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_23; #region INCLUDE /* diff --git a/src/Chapter18/Listing18.25.UsingConditionalAttributeToEliminateACall.cs b/src/Chapter18/Listing18.24.UsingConditionalAttributeToEliminateACall.cs similarity index 98% rename from src/Chapter18/Listing18.25.UsingConditionalAttributeToEliminateACall.cs rename to src/Chapter18/Listing18.24.UsingConditionalAttributeToEliminateACall.cs index daba8cc60..0cf0353d8 100644 --- a/src/Chapter18/Listing18.25.UsingConditionalAttributeToEliminateACall.cs +++ b/src/Chapter18/Listing18.24.UsingConditionalAttributeToEliminateACall.cs @@ -1,7 +1,7 @@ #region INCLUDE #define CONDITION_A #region EXCLUDE -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_25; +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_24; #endregion EXCLUDE using System.Diagnostics; diff --git a/src/Chapter18/Listing18.26.UsingObsoleteAttribute.cs b/src/Chapter18/Listing18.25.UsingObsoleteAttribute.cs similarity index 96% rename from src/Chapter18/Listing18.26.UsingObsoleteAttribute.cs rename to src/Chapter18/Listing18.25.UsingObsoleteAttribute.cs index 2f8ca5414..8eecc5962 100644 --- a/src/Chapter18/Listing18.26.UsingObsoleteAttribute.cs +++ b/src/Chapter18/Listing18.25.UsingObsoleteAttribute.cs @@ -1,4 +1,4 @@ -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_26; +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_25; #region INCLUDE public class Program diff --git a/src/Chapter18/Listing18.27.GenericException.cs b/src/Chapter18/Listing18.26.GenericException.cs similarity index 98% rename from src/Chapter18/Listing18.27.GenericException.cs rename to src/Chapter18/Listing18.26.GenericException.cs index 0eafbe330..7d29d06c8 100644 --- a/src/Chapter18/Listing18.27.GenericException.cs +++ b/src/Chapter18/Listing18.26.GenericException.cs @@ -1,4 +1,4 @@ -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_27; +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_26; #if NET7_0_OR_GREATER #region INCLUDE diff --git a/src/Chapter18/Listing18.28.CallerArgumentExpression.cs b/src/Chapter18/Listing18.27.CallerArgumentExpression.cs similarity index 99% rename from src/Chapter18/Listing18.28.CallerArgumentExpression.cs rename to src/Chapter18/Listing18.27.CallerArgumentExpression.cs index 1191d743e..86ce31dde 100644 --- a/src/Chapter18/Listing18.28.CallerArgumentExpression.cs +++ b/src/Chapter18/Listing18.27.CallerArgumentExpression.cs @@ -1,6 +1,6 @@ using System.Runtime.CompilerServices; -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_28; +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_27; #if NET7_0_OR_GREATER #region INCLUDE diff --git a/src/Chapter18/Listing18.28a.InvokingCallerAttributesMethod.cs b/src/Chapter18/Listing18.28.InvokingCallerAttributesMethod.cs similarity index 88% rename from src/Chapter18/Listing18.28a.InvokingCallerAttributesMethod.cs rename to src/Chapter18/Listing18.28.InvokingCallerAttributesMethod.cs index b00d36096..3e2c627ac 100644 --- a/src/Chapter18/Listing18.28a.InvokingCallerAttributesMethod.cs +++ b/src/Chapter18/Listing18.28.InvokingCallerAttributesMethod.cs @@ -1,7 +1,6 @@ -using System.Runtime.CompilerServices; -using AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_28; +using AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_27; -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_28a; +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_28; #if NET7_0_OR_GREATER public class Program