Change to file-scoped namespaces

This commit is contained in:
Andrew Cooper
2022-02-15 22:33:44 +11:00
parent fc92500074
commit 35f68dcf72
11 changed files with 642 additions and 653 deletions

View File

@@ -13,8 +13,8 @@ using FourNumbers = System.ValueTuple<float, float, float, float>;
using static System.Environment;
using static Games.Common.IO.Strings;
namespace Games.Common.IO.TextIOTests
{
namespace Games.Common.IO.TextIOTests;
public class ReadMethodTests
{
[Theory]
@@ -163,4 +163,3 @@ namespace Games.Common.IO.TextIOTests
};
}
}
}

View File

@@ -8,8 +8,8 @@ using Xunit;
using static System.Environment;
using static Games.Common.IO.Strings;
namespace Games.Common.IO
{
namespace Games.Common.IO;
public class TokenReaderTests
{
private readonly StringWriter _outputWriter;
@@ -104,4 +104,3 @@ namespace Games.Common.IO
};
}
}
}

View File

@@ -1,8 +1,8 @@
using FluentAssertions;
using Xunit;
namespace Games.Common.IO
{
namespace Games.Common.IO;
public class TokenTests
{
[Theory]
@@ -40,4 +40,3 @@ namespace Games.Common.IO
{ "12e0.5", true, 12 }
};
}
}

View File

@@ -2,8 +2,8 @@ using System.Linq;
using FluentAssertions;
using Xunit;
namespace Games.Common.IO
{
namespace Games.Common.IO;
public class TokenizerTests
{
[Theory]
@@ -31,4 +31,3 @@ namespace Games.Common.IO
{ "a\"b,\" c,d\", f ,,g", new[] { "a\"b", " c,d", "f", "", "g" } }
};
}
}

View File

@@ -1,7 +1,7 @@
using System;
namespace Games.Common.IO
{
namespace Games.Common.IO;
/// <summary>
/// An implementation of <see cref="IReadWrite" /> with input begin read for STDIN and output being written to
/// STDOUT.
@@ -13,4 +13,3 @@ namespace Games.Common.IO
{
}
}
}

View File

@@ -1,5 +1,5 @@
namespace Games.Common.IO
{
namespace Games.Common.IO;
/// <summary>
/// Provides for input and output of strings and numbers.
/// </summary>
@@ -66,4 +66,3 @@ namespace Games.Common.IO
/// <param name="message">The <see cref="string" /> to be written.</param>
void WriteLine(string message);
}
}

View File

@@ -1,8 +1,7 @@
namespace Games.Common.IO
{
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

@@ -3,8 +3,8 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace Games.Common.IO
{
namespace Games.Common.IO;
/// <inheritdoc />
/// <summary>
/// Implements <see cref="IReadWrite" /> with input read from a <see cref="TextReader" /> and output written to a
@@ -87,4 +87,3 @@ namespace Games.Common.IO
return _input.ReadLine();
}
}
}

View File

@@ -1,8 +1,8 @@
using System.Text;
using System.Text.RegularExpressions;
namespace Games.Common.IO
{
namespace Games.Common.IO;
internal class Token
{
private static readonly Regex _numberPattern = new(@"^[+\-]?\d*(\.\d*)?([eE][+\-]?\d*)?");
@@ -57,4 +57,3 @@ namespace Games.Common.IO
}
}
}
}

View File

@@ -3,8 +3,8 @@ using System.Collections.Generic;
using static Games.Common.IO.Strings;
namespace Games.Common.IO
{
namespace Games.Common.IO;
internal class TokenReader
{
private readonly TextIO _io;
@@ -78,4 +78,3 @@ namespace Games.Common.IO
}
}
}
}

View File

@@ -1,8 +1,8 @@
using System;
using System.Collections.Generic;
namespace Games.Common.IO
{
namespace Games.Common.IO;
internal class Tokenizer
{
private const char Quote = '"';
@@ -99,4 +99,3 @@ namespace Games.Common.IO
throw new InvalidOperationException();
}
}
}