Skip to content

Commit

Permalink
Refactor : Moved code base to the correct namepsace `BlueDotBrigade.D…
Browse files Browse the repository at this point in the history
…atenLokator.TestTools` #14
  • Loading branch information
BlueDotBrigadeFounder committed Nov 22, 2024
1 parent 603bbdc commit e1f050a
Show file tree
Hide file tree
Showing 30 changed files with 103 additions and 58 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
namespace BlueDotBrigade.DatenLokator.TestsTools.Configuration
namespace BlueDotBrigade.DatenLokator.TestTools.Configuration
{
using System;
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using System.IO;
using BlueDotBrigade.DatenLokator.TestsTools.IO;
using BlueDotBrigade.DatenLokator.TestsTools.NamingConventions;
using BlueDotBrigade.DatenLokator.TestsTools.Reflection;
using BlueDotBrigade.DatenLokator.TestTools.IO;
using BlueDotBrigade.DatenLokator.TestTools.NamingConventions;
using BlueDotBrigade.DatenLokator.TestTools.Reflection;

public sealed class Lokator
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
namespace BlueDotBrigade.DatenLokator.TestsTools.Configuration
namespace BlueDotBrigade.DatenLokator.TestTools.Configuration
{
using System;
using System.Collections.Generic;
using BlueDotBrigade.DatenLokator.TestsTools.IO;
using BlueDotBrigade.DatenLokator.TestsTools.NamingConventions;
using BlueDotBrigade.DatenLokator.TestTools.IO;
using BlueDotBrigade.DatenLokator.TestTools.NamingConventions;
using Microsoft.VisualStudio.TestTools.UnitTesting;

internal class LokatorConfiguration
Expand Down
8 changes: 4 additions & 4 deletions Src/BlueDotBrigade.DatenLokator.TestTools/Coordinator.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
namespace BlueDotBrigade.DatenLokator.TestsTools
namespace BlueDotBrigade.DatenLokator.TestTools
{
using System;
using System.Collections.Generic;
using BlueDotBrigade.DatenLokator.TestsTools.IO;
using BlueDotBrigade.DatenLokator.TestsTools.NamingConventions;
using BlueDotBrigade.DatenLokator.TestsTools.Reflection;
using BlueDotBrigade.DatenLokator.TestTools.IO;
using BlueDotBrigade.DatenLokator.TestTools.NamingConventions;
using BlueDotBrigade.DatenLokator.TestTools.Reflection;

internal class Coordinator
{
Expand Down
63 changes: 61 additions & 2 deletions Src/BlueDotBrigade.DatenLokator.TestTools/Daten.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
namespace BlueDotBrigade.DatenLokator.TestsTools
namespace BlueDotBrigade.DatenLokator.TestTools
{
using System;
using System.Runtime.CompilerServices;
using BlueDotBrigade.DatenLokator.TestsTools.Configuration;
using BlueDotBrigade.DatenLokator.TestTools.Configuration;

public class Daten
{
Expand Down Expand Up @@ -372,5 +372,64 @@ public System.IO.StreamReader AsStreamReader(From fromSource)

return new System.IO.StreamReader(_coordinator.OsFile.OpenRead(sourceFilePath));
}

/// <summary>
/// Retrieves the data that is appropriate for the test that is currently executing.
/// </summary>
/// <returns>
/// Returns a <see cref="System.IO.StreamReader"/> which encapsulates source file as a sequence of bytes.
/// </returns>
/// <remarks>
/// Directory search order:
/// 1. the given directory
/// 2. a compressed file that is similar to the given directory
/// 3. the global directory for shared files
/// </remarks>
public System.IO.StreamReader AsBmp()
{
var sourceFilePath = _coordinator.GetFilePath(_callingMethodName, _callingClassPath);

ThrowIfFileMissing(sourceFilePath);

return new System.IO.StreamReader(_coordinator.OsFile.OpenRead(sourceFilePath));
}

/// <summary>
/// Retrieves the data that is stored within the given <paramref name="fileName"/>.
/// </summary>
/// <returns>
/// Returns a <see cref="System.IO.StreamReader"/> which encapsulates source file as a sequence of bytes.
/// </returns>
/// <remarks>
/// Directory search order:
/// 1. the given directory
/// 2. a compressed file that is similar to the given directory
/// 3. the global directory for shared files
/// </remarks>
public System.IO.StreamReader AsBmp(string fileName)
{
var sourceFilePath = _coordinator.GetFilePath(fileName, _callingClassPath);

ThrowIfFileMissing(sourceFilePath);

return new System.IO.StreamReader(_coordinator.OsFile.OpenRead(sourceFilePath));
}

/// <summary>
/// Retrieves the data that was registered with <see cref="Lokator"/>.
/// </summary>
/// <param name="fromSource">Determines which registered file to retrieve.</param>
/// <returns>
/// Returns a <see cref="System.IO.StreamReader"/> which encapsulates source file as a sequence of bytes.
/// </returns>
/// <exception cref="ArgumentOutOfRangeException"/>
public System.IO.StreamReader AsBmp(From fromSource)
{
var sourceFilePath = GetGlobalDefaultPath(fromSource);

ThrowIfFileMissing(sourceFilePath);

return new System.IO.StreamReader(_coordinator.OsFile.OpenRead(sourceFilePath));
}
}
}
2 changes: 1 addition & 1 deletion Src/BlueDotBrigade.DatenLokator.TestTools/From.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace BlueDotBrigade.DatenLokator.TestsTools
namespace BlueDotBrigade.DatenLokator.TestTools
{
public enum From
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace BlueDotBrigade.DatenLokator.TestsTools.IO
namespace BlueDotBrigade.DatenLokator.TestTools.IO
{
using System.Collections.Generic;
using BlueDotBrigade.DatenLokator.TestsTools.NamingConventions;
using BlueDotBrigade.DatenLokator.TestTools.NamingConventions;

/// <summary>
/// Responsible for locating a file on disk.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace BlueDotBrigade.DatenLokator.TestsTools.IO
namespace BlueDotBrigade.DatenLokator.TestTools.IO
{
using System.IO;

Expand Down
2 changes: 1 addition & 1 deletion Src/BlueDotBrigade.DatenLokator.TestTools/IO/IOsFile.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace BlueDotBrigade.DatenLokator.TestsTools.IO
namespace BlueDotBrigade.DatenLokator.TestTools.IO
{
/// <summary>
/// Provides access to file system files.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace BlueDotBrigade.DatenLokator.TestsTools.IO
namespace BlueDotBrigade.DatenLokator.TestTools.IO
{
using System.IO;

Expand Down
2 changes: 1 addition & 1 deletion Src/BlueDotBrigade.DatenLokator.TestTools/IO/OsFile.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace BlueDotBrigade.DatenLokator.TestsTools.IO
namespace BlueDotBrigade.DatenLokator.TestTools.IO
{
using System.IO;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
namespace BlueDotBrigade.DatenLokator.TestsTools.IO
namespace BlueDotBrigade.DatenLokator.TestTools.IO
{
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.IO.Compression;
using System.Linq;
using BlueDotBrigade.DatenLokator.TestsTools.NamingConventions;
using BlueDotBrigade.DatenLokator.TestsTools.Reflection;
using BlueDotBrigade.DatenLokator.TestTools.NamingConventions;
using BlueDotBrigade.DatenLokator.TestTools.Reflection;

internal class SubFolderThenGlobal : IFileManagementStrategy
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace BlueDotBrigade.DatenLokator.TestsTools.NamingConventions
namespace BlueDotBrigade.DatenLokator.TestTools.NamingConventions
{
internal class AssertActArrange : ITestNamingStrategy
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace BlueDotBrigade.DatenLokator.TestsTools.NamingConventions
namespace BlueDotBrigade.DatenLokator.TestTools.NamingConventions
{
/// <summary>
/// In order to automatically retrieve the source data, it is assumed
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace BlueDotBrigade.DatenLokator.TestsTools.NamingConventions
namespace BlueDotBrigade.DatenLokator.TestTools.NamingConventions
{
public class GenericNamingStrategy : ITestNamingStrategy
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace BlueDotBrigade.DatenLokator.TestsTools.NamingConventions
namespace BlueDotBrigade.DatenLokator.TestTools.NamingConventions
{
/// <summary>
/// Uses the method name to determine what the input file is expected to be called.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace BlueDotBrigade.DatenLokator.TestsTools.Reflection
namespace BlueDotBrigade.DatenLokator.TestTools.Reflection
{
using System;
using BlueDotBrigade.DatenLokator.TestsTools.Configuration;
using BlueDotBrigade.DatenLokator.TestTools.Configuration;
using System.IO;

internal static class AssemblyHelper
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace BlueDotBrigade.DatenLokator.TestsTools
namespace BlueDotBrigade.DatenLokator.TestTools
{
public static class StringExtensions
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\Src\BlueDotBrigade.DatenLokator.TestTools\BlueDotBrigade.DatenLokator.TestsTools.csproj" />
<Folder Include="NamingConventions\" />
</ItemGroup>

<ItemGroup>
<Folder Include="NamingConventions\" />
<ProjectReference Include="..\..\Src\BlueDotBrigade.DatenLokator.TestTools\BlueDotBrigade.DatenLokator.TestsTools.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
namespace BlueDotBrigade.DatenLokator.TestTools.Configuration
{
using BlueDotBrigade.DatenLokator.TestsTools.Configuration;
using BlueDotBrigade.DatenLokator.TestsTools.IO;
using BlueDotBrigade.DatenLokator.TestsTools.NamingConventions;
using BlueDotBrigade.DatenLokator.TestTools.IO;
using BlueDotBrigade.DatenLokator.TestTools.NamingConventions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
namespace BlueDotBrigade.DatenLokator.TestTools.Configuration
{
using BlueDotBrigade.DatenLokator.TestsTools;
using BlueDotBrigade.DatenLokator.TestsTools.Configuration;
using BlueDotBrigade.DatenLokator.TestsTools.IO;
using BlueDotBrigade.DatenLokator.TestsTools.NamingConventions;
using BlueDotBrigade.DatenLokator.TestTools.IO;
using BlueDotBrigade.DatenLokator.TestTools.NamingConventions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
namespace BlueDotBrigade.DatenLokator.TestTools
{
using BlueDotBrigade.DatenLokator.TestsTools;

[TestClass]
public class DatenShould
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
namespace BlueDotBrigade.DatenLokator.TestTools.IO
{
using BlueDotBrigade.DatenLokator.TestsTools.IO;
using BlueDotBrigade.DatenLokator.TestsTools.NamingConventions;
using Microsoft.VisualStudio.TestPlatform.PlatformAbstractions;
using Moq;

[TestClass]
public class SubFolderThenGlobalShould
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace BlueDotBrigade.DatenLokator.TestTools
{
using System;
using BlueDotBrigade.DatenLokator.TestsTools.Configuration;
using BlueDotBrigade.DatenLokator.TestTools.Configuration;
using Microsoft.VisualStudio.TestTools.UnitTesting;

[TestClass]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
{
using System;
using System.IO;
using BlueDotBrigade.DatenLokator.TestsTools.IO;
using BlueDotBrigade.DatenLokator.TestsTools.NamingConventions;
using BlueDotBrigade.DatenLokator.TestsTools.Reflection;
using BlueDotBrigade.DatenLokator.TestTools.IO;
using BlueDotBrigade.DatenLokator.TestTools.NamingConventions;
using BlueDotBrigade.DatenLokator.TestTools.Reflection;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
namespace BlueDotBrigade.DatenLokator.TestTools.NamingConventions
{
using BlueDotBrigade.DatenLokator.TestsTools.NamingConventions;
using Microsoft.VisualStudio.TestTools.UnitTesting;

[TestClass]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
namespace BlueDotBrigade.DatenLokator.TestTools.NamingConventions
{
using BlueDotBrigade.DatenLokator.TestsTools.NamingConventions;
using Microsoft.VisualStudio.TestTools.UnitTesting;

[TestClass]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace BlueDotBrigade.DatenLokator.TestTools
{
using Microsoft.VisualStudio.TestTools.UnitTesting;
using BlueDotBrigade.DatenLokator.TestsTools;
using BlueDotBrigade.DatenLokator.TestTools;

[TestClass]
public class StringExtensionsTest
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace BlueDotBrigade.DatenLokator.TestTools
{
using System;
using BlueDotBrigade.DatenLokator.TestsTools.Configuration;
using BlueDotBrigade.DatenLokator.TestTools.Configuration;
using Microsoft.VisualStudio.TestTools.UnitTesting;

[TestClass]
Expand Down
2 changes: 1 addition & 1 deletion Tst/DemoTests/Serialization/XmlSerializerTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Demo.Serialization
{
using BlueDotBrigade.DatenLokator.TestsTools;
using BlueDotBrigade.DatenLokator.TestTools;
using Demo.Droids;
using Microsoft.VisualStudio.TestTools.UnitTesting;

Expand Down
2 changes: 1 addition & 1 deletion Tst/DemoTests/TestEnvironment.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace Demo
{
using System;
using BlueDotBrigade.DatenLokator.TestsTools.Configuration;
using BlueDotBrigade.DatenLokator.TestTools.Configuration;
using Microsoft.VisualStudio.TestTools.UnitTesting;

[TestClass]
Expand Down

0 comments on commit e1f050a

Please sign in to comment.