Skip to content

Commit

Permalink
Remove unecessary test, run compile test
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminMichaelis committed Nov 5, 2023
1 parent f226390 commit cc24176
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/Chapter04.Tests/Listing04.28.Tests.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
using AddisonWesley.Michaelis.EssentialCSharp.Shared.Tests;

namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter04.Listing04_28.Tests;

[TestClass]
public class ProgramTests
{
private static readonly string[] ExpectedErrorIds = new string[] { "CS0103" };

[TestMethod]
public void MainTest()
public async Task CompileError_OutOfScope()
{
const string expected = @"Enter the number of players (1 or 2):";

IntelliTect.TestTools.Console.ConsoleAssert.Expect(
expected, Program.Main);
await CompilerAssert.CompileAsync($"Listing04.28.OutOfScope.cs", ExpectedErrorIds);
}
}
4 changes: 2 additions & 2 deletions src/Chapter04/Listing04.28.OutOfScope.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ public static void Main(string[] args)
{
// ...
}
#if COMPILE_ERRR //EXCLUDE
#if COMPILEERROR //EXCLUDE
#region HIGHLIGHT
// ERROR: message is not in scope:
Console.WriteLine(message);
#endregion HIGHLIGHT
#endif // COMPILE_ERRR //EXCLUDE
#endif // COMPILEERROR //EXCLUDE
#endregion INCLUDE
}
}

0 comments on commit cc24176

Please sign in to comment.