From 880b4eeb86d819d9b40f5348e2234cc5ed6ae9ad Mon Sep 17 00:00:00 2001 From: BlueDotBrigadeFounder Date: Fri, 22 Nov 2024 18:27:01 -0500 Subject: [PATCH] New : Added more `Daten` unit tests. #14 --- .../.Daten/DatenTests/BmpImage.bmp | 3 ++ .../.Daten/DatenTests/GifImage.gif | 3 ++ .../.Daten/DatenTests/Jpg_x100.jpg | 3 ++ .../.Daten/DatenTests/PngImage.png | 3 ++ .../.Daten/DatenTests/TiffImage.tif | 3 ++ .../DatenTests.cs | 37 ++++++++++++++++--- 6 files changed, 46 insertions(+), 6 deletions(-) create mode 100644 Tst/BlueDotBrigade.DatenLokator.TestTools-UnitTests/.Daten/DatenTests/BmpImage.bmp create mode 100644 Tst/BlueDotBrigade.DatenLokator.TestTools-UnitTests/.Daten/DatenTests/GifImage.gif create mode 100644 Tst/BlueDotBrigade.DatenLokator.TestTools-UnitTests/.Daten/DatenTests/Jpg_x100.jpg create mode 100644 Tst/BlueDotBrigade.DatenLokator.TestTools-UnitTests/.Daten/DatenTests/PngImage.png create mode 100644 Tst/BlueDotBrigade.DatenLokator.TestTools-UnitTests/.Daten/DatenTests/TiffImage.tif diff --git a/Tst/BlueDotBrigade.DatenLokator.TestTools-UnitTests/.Daten/DatenTests/BmpImage.bmp b/Tst/BlueDotBrigade.DatenLokator.TestTools-UnitTests/.Daten/DatenTests/BmpImage.bmp new file mode 100644 index 0000000..324ceee --- /dev/null +++ b/Tst/BlueDotBrigade.DatenLokator.TestTools-UnitTests/.Daten/DatenTests/BmpImage.bmp @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e84e03c878716460ae453ee4d4a2223e4ae948f9005e563f9b26e705d35f82d9 +size 30054 diff --git a/Tst/BlueDotBrigade.DatenLokator.TestTools-UnitTests/.Daten/DatenTests/GifImage.gif b/Tst/BlueDotBrigade.DatenLokator.TestTools-UnitTests/.Daten/DatenTests/GifImage.gif new file mode 100644 index 0000000..5e789d1 --- /dev/null +++ b/Tst/BlueDotBrigade.DatenLokator.TestTools-UnitTests/.Daten/DatenTests/GifImage.gif @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8982288dfc9d4638a055d94084338de7883e58f3a504970c1e83d08bd2bf4a62 +size 1249 diff --git a/Tst/BlueDotBrigade.DatenLokator.TestTools-UnitTests/.Daten/DatenTests/Jpg_x100.jpg b/Tst/BlueDotBrigade.DatenLokator.TestTools-UnitTests/.Daten/DatenTests/Jpg_x100.jpg new file mode 100644 index 0000000..0aa41cc --- /dev/null +++ b/Tst/BlueDotBrigade.DatenLokator.TestTools-UnitTests/.Daten/DatenTests/Jpg_x100.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9ccb85486bf79d43257aae523ca20b360cf0ba7c8cbe0415ddd1d250bd247139 +size 1792 diff --git a/Tst/BlueDotBrigade.DatenLokator.TestTools-UnitTests/.Daten/DatenTests/PngImage.png b/Tst/BlueDotBrigade.DatenLokator.TestTools-UnitTests/.Daten/DatenTests/PngImage.png new file mode 100644 index 0000000..4c6fdf1 --- /dev/null +++ b/Tst/BlueDotBrigade.DatenLokator.TestTools-UnitTests/.Daten/DatenTests/PngImage.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3b3dd73c3eb25e8af6db4bed7cfd3a5027c7d5f79ff2de4775cdfc4e601035e9 +size 1813 diff --git a/Tst/BlueDotBrigade.DatenLokator.TestTools-UnitTests/.Daten/DatenTests/TiffImage.tif b/Tst/BlueDotBrigade.DatenLokator.TestTools-UnitTests/.Daten/DatenTests/TiffImage.tif new file mode 100644 index 0000000..b4c7e55 --- /dev/null +++ b/Tst/BlueDotBrigade.DatenLokator.TestTools-UnitTests/.Daten/DatenTests/TiffImage.tif @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4aa5fabd45ff9d777056ff91ff72394310dda9df24c7edfe960323d1124dde97 +size 2114 diff --git a/Tst/BlueDotBrigade.DatenLokator.TestTools-UnitTests/DatenTests.cs b/Tst/BlueDotBrigade.DatenLokator.TestTools-UnitTests/DatenTests.cs index 3c385ab..5622763 100644 --- a/Tst/BlueDotBrigade.DatenLokator.TestTools-UnitTests/DatenTests.cs +++ b/Tst/BlueDotBrigade.DatenLokator.TestTools-UnitTests/DatenTests.cs @@ -3,12 +3,8 @@ using System; using System.Collections.Generic; using System.IO; - using System.Xml.Linq; - using BlueDotBrigade.DatenLokator.TestsTools; - using BlueDotBrigade.DatenLokator.TestsTools.IO; - using BlueDotBrigade.DatenLokator.TestsTools.NamingConventions; - using BlueDotBrigade.DatenLokator.TestsTools.Reflection; - using Microsoft.VisualStudio.TestPlatform.ObjectModel.DataCollection; + using BlueDotBrigade.DatenLokator.TestTools.IO; + using BlueDotBrigade.DatenLokator.TestTools.NamingConventions; using Microsoft.VisualStudio.TestTools.UnitTesting; [TestClass] @@ -220,5 +216,34 @@ 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 } } \ No newline at end of file