Skip to content
15 changes: 15 additions & 0 deletions src/Chapter20.Tests/Listing20.07.Tests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//using Microsoft.VisualStudio.TestTools.UnitTesting;
//using System.Threading.Tasks;

//namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter20.Listing20_07.Tests
//{
// [TestClass]
// public class ProgramTests
// {
// [TestMethod]
// public async Task MainTest()
// {
// await IntelliTect.TestTools.Console.ConsoleAssert.ExpectAsync("<filename>", async () => await AsyncEncryptionCollection.Main());
// }
// }
//}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public async IAsyncEnumerator<string> GetAsyncEnumerator(
#endregion EXCLUDE
}

public static async void Main()
public static async Task Main()
{
AsyncEncryptionCollection collection =
new AsyncEncryptionCollection();
Expand Down
17 changes: 17 additions & 0 deletions src/Chapter21.Tests/Listing21.01.Tests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter21.Listing21_01.Tests
{
[TestClass]
public class ProgramTests
{
[TestMethod]
public void MainTest()
{
const string expected = @"3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679";

IntelliTect.TestTools.Console.ConsoleAssert.Expect(
expected, Program.Main);
}
}
}
17 changes: 17 additions & 0 deletions src/Chapter21.Tests/Listing21.02.Tests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter21.Listing21_02.Tests
{
[TestClass]
public class ProgramTests
{
[TestMethod]
public void MainTest()
{
const string expected = @"3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679";

IntelliTect.TestTools.Console.ConsoleAssert.Expect(
expected, Program.Main);
}
}
}
18 changes: 18 additions & 0 deletions src/Chapter21.Tests/Listing21.04.Tests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter21.Listing21_04.Tests
{
[TestClass]
public class ProgramTests
{
[TestMethod]
public void MainTest()
{
const string expected = @"ERROR: AggregateException:
UnauthorizedAccessException - Attempted to perform an unauthorized operation.*";

IntelliTect.TestTools.Console.ConsoleAssert.ExpectLike(
expected, Program.Main);
}
}
}