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

Fix chapter 5 listing numbering and add in missing listing 5.11 #536

Merged
merged 2 commits into from
Sep 6, 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;

namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_10.Tests;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_08.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.Chapter05.Listing05_09.Tests;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_10.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.Chapter05.Listing05_11.Tests;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_12.Tests;

[TestClass]
public class ProgramTests
Expand All @@ -10,6 +10,6 @@ public class ProgramTests
public void Main_UsingToAvoidFullyQualifying_MethodCalledAsExpected()
{
IntelliTect.TestTools.Console.ConsoleAssert.Expect(
Listing05_10.Tests.ProgramTests.Expected, Program.Main);
Listing05_08.Tests.ProgramTests.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.Chapter05.Listing05_12.Tests;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_13.Tests;

[TestClass]
public class HeyYouTests
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.Chapter05.Listing05_15.Tests;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_16.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.Chapter05.Listing05_16.Tests;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_17.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.Chapter05.Listing05_17.Tests;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_18.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.Chapter05.Listing05_18.Tests;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_19.Tests;

[TestClass]
public class ConvertToPhoneNumberTests
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.Chapter05.Listing05_19.Tests;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_20.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.Chapter05.Listing05_20.Tests;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_21.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.Chapter05.Listing05_21.Tests;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_22.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.Chapter05.Listing05_22.Tests;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_24.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.Chapter05.Listing05_25.Tests;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_26.Tests;

[TestClass]
public class ExceptionHandlingTests
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.Chapter05.Listing05_26.Tests;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_27.Tests;

[TestClass]
public class ExceptionHandlingTests
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.Chapter05.Listing05_27.Tests;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_28.Tests;

[TestClass]
public class ExceptionHandlingTests
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.Chapter05.Listing05_28.Tests;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_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.Chapter05.Listing05_29.Tests;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_30.Tests;

[TestClass]
public class ThrowingExceptionsTests
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.Chapter05.Listing05_30.Tests;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_31.Tests;

[TestClass]
public class ThrowingExceptionsTests
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.Chapter05.Listing05_31.Tests;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_32.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.Chapter05.Listing05_32.Tests;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_33.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.Chapter05.Listing05_33.Tests;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_34.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.Chapter05.Listing05_34.Tests;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_35.Tests;

[TestClass]
public class LeveragingTryParseTests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// and the attribute is not available in .NET 6.0.
#pragma warning disable SYSLIB1045 // Convert to 'GeneratedRegexAttribute'.

namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_10;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_08;

#region INCLUDE
// The using directive imports all types from the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
global using System.Text;
#region EXCLUDE

namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_09;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_10;

#endregion EXCLUDE
public class Program
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!--#region INCLUDE-->
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Using Include="System.Net" />
</ItemGroup>
</Project>
<!--#endregion INCLUDE-->
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// and the attribute is not available in .NET 6.0.
#pragma warning disable SYSLIB1045 // Convert to 'GeneratedRegexAttribute'.

namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_11;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_12;

#region INCLUDE
// The using directive imports all types from the
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_12;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_13;

#region INCLUDE
using static System.Console;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#pragma warning disable CS0168 // Variable is declared but never used
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_13;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_14;

#region INCLUDE
#region HIGHLIGHT
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#pragma warning disable CS0168 // Variable is declared but never used
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_14;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_15;

#region INCLUDE

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_15;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_16;

#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.Chapter05.Listing05_16;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_17;

using System;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_17;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_18;

#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.Chapter05.Listing05_18;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_19;

public class ConvertToPhoneNumber
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_19;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_20;

using System;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_20;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_21;

#region INCLUDE
using System;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_21;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_22;

#region INCLUDE
using System.IO;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_22;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_23;

#region INCLUDE
public static class LineCounter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_23;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_24;

#region INCLUDE
public static class LineCounter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_24;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_25;

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

public class ExceptionHandling
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_26;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_27;

#region INCLUDE
public class ExceptionHandling
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_27;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_28;

#region INCLUDE
using System;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_28;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_29;
#pragma warning disable CS0168 // Variable is declared but never used

#region INCLUDE
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma warning disable CS1058
#pragma warning disable CS0168 // Variable is declared but never used
#pragma warning disable CS0162 // Unreachable code detected
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_29;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_30;

public class ThrowingExceptions
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma warning disable CS0162 // Unreachable code detected
#pragma warning disable CS1058 // A previous catch clause already catches all exceptions
#pragma warning disable CS0168 // Variable is declared but never used
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_30;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_31;

public class ThrowingExceptions
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#pragma warning disable IDE0059 // Unnecessary assignment of a value
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_31;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_32;

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

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

#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.Chapter05.Listing05_34;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter05.Listing05_35;

public class LeveragingTryParse
{
Expand Down
Loading