Skip to content
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

Resubmit Chapter 18 after Renumber #553

Merged
merged 5 commits into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_16.Tests;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_17.Tests;

[TestClass]
public class ProgramTests
Expand All @@ -13,4 +13,4 @@ public void MainTest()
IntelliTect.TestTools.Console.ConsoleAssert.Expect(
expected, Program.Main);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_24.Tests;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_25.Tests;

[TestClass]
public class ProgramTests
Expand All @@ -15,4 +15,4 @@ public void MainTest()
IntelliTect.TestTools.Console.ConsoleAssert.Expect(
expected, Program.Main);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_26.Tests;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_27.Tests;

#if NET7_0_OR_GREATER
[TestClass]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_27.Tests;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_28.Tests;

#if NET7_0_OR_GREATER
[TestClass]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_28.Tests;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_29.Tests;

[TestClass]
public class ProgramTests
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_29.Tests;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_30.Tests;

[TestClass]
public class ProgramTests
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_30.Tests;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_31.Tests;

[TestClass]
public class ProgramTests
Expand Down
8 changes: 4 additions & 4 deletions src/Chapter18/Chapter18.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ChapterNumber>18</ChapterNumber>
</PropertyGroup>
Expand All @@ -14,8 +14,8 @@
<EmbeddedResource Remove="4.0\**" />
<None Remove="4.0\**" />
<Compile Remove="Listing18.10.AssemblyAttributesWithinAssemblyInfo.cs" />
<Compile Remove="Listing18.12.csprojMockFileForResequencingListings.cs" />
<Compile Remove="Listing18.32.OverridableMembersOnSystem.Dynamic.DynamicObject.cs" />
<Compile Remove="Listing18.13.csprojMockFileForResequencingListings.cs" />
<Compile Remove="Listing18.33.OverridableMembersOnSystem.Dynamic.DynamicObject.cs" />
<Compile Include="..\Shared\Program.cs">
<Link>Program.cs</Link>
</Compile>
Expand All @@ -29,6 +29,6 @@
<Link>DoWorkEventArgs.cs</Link>
</Compile>
<None Include="Listing18.10.AssemblyAttributesWithinAssemblyInfo.cs" />
<None Include="Listing18.32.OverridableMembersOnSystem.Dynamic.DynamicObject.cs" />
<None Include="Listing18.33.OverridableMembersOnSystem.Dynamic.DynamicObject.cs" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_12;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_13;


//Allows for the csproj file listing example to be accounted for when resequencing listings. just rename this
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_13;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_14;

#region INCLUDE
public class CommandLineSwitchRequiredAttribute : Attribute
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_14;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_15;

#region INCLUDE
using System.Reflection;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_15;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_16;

#region INCLUDE
public class CommandLineSwitchAliasAttribute : Attribute
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_16;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_17;

using AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_15;
using AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_16;
using System.Reflection;

public class Program
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_17;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_18;

#region INCLUDE
using System.Reflection;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_18;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_19;

using Listing18_17;
using Listing18_18;
#region INCLUDE
using System.Reflection;
using System.Collections.Generic;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_19;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_20;

#region INCLUDE
[AttributeUsage(AttributeTargets.Property)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_20;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_21;

// Will not compile if uncommented
/*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_21;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_22;

#region INCLUDE
// Restrict the attribute to properties and methods
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_22;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_23;

#region INCLUDE
[AttributeUsage(AttributeTargets.Property, AllowMultiple = true)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_23;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_24;

#region INCLUDE
/*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#region INCLUDE
#define CONDITION_A
#region EXCLUDE
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_24;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_25;

#endregion EXCLUDE
using System.Diagnostics;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_25;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_26;

#region INCLUDE
public class Program
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_26;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_27;

#if NET7_0_OR_GREATER
#region INCLUDE
Expand All @@ -19,7 +19,6 @@ public class ExpectedException<TException> :
Attribute where TException : Exception
#endregion HIGHLIGHT
{
#region EXCLUDE
public static TException AssertExceptionThrown(Action testMethod)
{
try
Expand All @@ -34,10 +33,8 @@ public static TException AssertExceptionThrown(Action testMethod)
return exception;
}
}

// Attribute detection
#endregion EXCLUDE

// Attribute detection
// ...
}
#endregion INCLUDE
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Runtime.CompilerServices;

namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_27;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_28;

#if NET7_0_OR_GREATER
#region INCLUDE
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_28;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_29;

public class Program
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_29;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_30;

#region INCLUDE
using System.Xml.Linq;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_30;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_31;

using Listing18_31;
using Listing18_32;
public class Program
{
public static void Main()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_31;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_32;

#region INCLUDE
using System.Dynamic;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_32
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_33
{
#region INCLUDE
using System.Collections.Generic;
Expand Down