Extract IO string constants

This commit is contained in:
Andrew Cooper
2022-02-15 21:57:21 +11:00
parent 8d04213ccd
commit d8e4e0d975
3 changed files with 11 additions and 6 deletions

View File

@@ -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()

View 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";
}
}

View File

@@ -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;