Skip to content

Commit

Permalink
Refactor : Removed dead code related to AsBmp() #16
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueDotBrigadeFounder committed Nov 26, 2024
1 parent be1d5c0 commit e1f435f
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 104 deletions.
61 changes: 1 addition & 60 deletions Src/BlueDotBrigade.DatenLokator.TestTools/Daten.cs
Original file line number Diff line number Diff line change
Expand Up @@ -372,64 +372,5 @@ 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));
}
}
}
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

29 changes: 0 additions & 29 deletions Tst/BlueDotBrigade.DatenLokator.TestTools-UnitTests/DatenTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -216,34 +216,5 @@ public void AsStreamReader_FileByConvention_ReturnsCorrectContent()
Assert.AreEqual(expected, actual.ReadToEnd());
}
#endregion

#region AsStreamReader
[TestMethod]
public void AsBmp_FileByDefault_ReturnsCorrectContent()
{
var expected = "Default source file shared by multiple tests.";
StreamReader actual = new Daten(_coordinator).AsStreamReader(From.GlobalDefault);

Assert.AreEqual(expected, actual.ReadToEnd());
}

[TestMethod]
public void AsBmp_FileByName_ReturnsCorrectContent()
{
var expected = "Requested input using specfic file name.";
StreamReader actual = new Daten(_coordinator).AsStreamReader("ImageBmp.Bmp");

Assert.AreEqual(expected, actual.ReadToEnd());
}

[TestMethod]
public void AsBmp_FileByConvention_ReturnsCorrectContent()
{
var expected = "Unit test name was used to select a source file.";
StreamReader actual = new Daten(_coordinator).AsStreamReader();

Assert.AreEqual(expected, actual.ReadToEnd());
}
#endregion
}
}

0 comments on commit e1f435f

Please sign in to comment.