mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2026-01-10 04:07:28 -08:00
Extract IO string constants
This commit is contained in:
@@ -6,14 +6,12 @@ using FluentAssertions.Execution;
|
||||
using Xunit;
|
||||
|
||||
using static System.Environment;
|
||||
using static Games.Common.IO.Strings;
|
||||
|
||||
namespace Games.Common.IO
|
||||
{
|
||||
public class TokenReaderTests
|
||||
{
|
||||
const string NumberExpected = "!Number expected - retry input line";
|
||||
const string ExtraInput = "!Extra input ignored";
|
||||
|
||||
private readonly StringWriter _outputWriter;
|
||||
|
||||
public TokenReaderTests()
|
||||
|
||||
8
00_Common/dotnet/Games.Common/IO/Strings.cs
Normal file
8
00_Common/dotnet/Games.Common/IO/Strings.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace Games.Common.IO
|
||||
{
|
||||
internal static class Strings
|
||||
{
|
||||
internal const string NumberExpected = "!Number expected - retry input line";
|
||||
internal const string ExtraInput = "!Extra input ignored";
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using static Games.Common.IO.Strings;
|
||||
|
||||
namespace Games.Common.IO
|
||||
{
|
||||
internal class TokenReader
|
||||
{
|
||||
private const string NumberExpected = "!Number expected - retry input line";
|
||||
private const string ExtraInput = "!Extra input ignored";
|
||||
|
||||
private readonly TextIO _io;
|
||||
private readonly Predicate<Token> _isTokenValid;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user