Example #1
0
        public void ParsingFile_ReturnsValidDirectoryBinder()
        {
            var physicalFilesParser = new FileImportTestData().CreateTestPhysicalFilesParser();

            var ab = physicalFilesParser.ParsePhysicalFiles(CreateThreadInfo()).First().AttributedBinders.First();

            Assert.That(ab.Attribute, Does.Contain("Chopok0335"));
        }
Example #2
0
        public void GetCurrentRackInfo_ReturnsRackInfo()
        {
            var application = new FileImportTestData().CreateTestRackInfoBuilder();

            var rackInfo = application.GetCurrentRackInfo();

            Assert.That(rackInfo, Is.Not.Null);
        }
Example #3
0
        public void JpgElement_IsImageType()
        {
            var physicalFilesParser = new FileImportTestData().CreateTestPhysicalFilesParser();

            var content = physicalFilesParser.ParsePhysicalFiles(CreateThreadInfo()).First();

            Assert.That(content.Type, Is.EqualTo(ContentTypeEnum.Image.ToString()));
        }
Example #4
0
        public void ParsePhysicalFiles_ValidPath_FirstElementHasCorrectHash()
        {
            var physicalFilesParser = new FileImportTestData().CreateTestPhysicalFilesParser();

            var content = physicalFilesParser.ParsePhysicalFiles(CreateThreadInfo()).First();

            Assert.That(content.Hash, Contains.Substring("2018-01-24-Chopok0335.JPGHash"));
        }
Example #5
0
        public void ParsePhysicalFiles_ValidPath_ReturnsCorrectNumberOfPictures()
        {
            var physicalFilesParser = new FileImportTestData().CreateTestPhysicalFilesParser();

            var files = physicalFilesParser.ParsePhysicalFiles(CreateThreadInfo());

            Assert.That(files.Count(), Is.EqualTo(5));
        }
Example #6
0
        public void GetSubDirectoryInfo_TestSubDir_ReturnsAlsoParentDir()
        {
            var application = new FileImportTestData().CreateTestRackInfoBuilder();

            var dirInfo = application.GetSubDirectoryInfo("TestSubDir");

            Assert.That(dirInfo.SubDirectories, Is.Not.Empty);
            Assert.That(dirInfo.SubDirectories.First(), Does.EndWith(".."));
            Assert.That(dirInfo.SubDirectories.Last(), Does.StartWith("TestSubDir"));
        }
Example #7
0
        public void GetCurrentRackInfo_DirectoryInfo_ReturnsInfo()
        {
            var application = new FileImportTestData().CreateTestRackInfoBuilder();

            var rackInfo = application.GetCurrentRackInfo();

            Assert.That(rackInfo.DirectoryInfo, Is.Not.Null);
            Assert.That(rackInfo.DirectoryInfo.SubDirectories, Is.Not.Empty);
            Assert.That(rackInfo.DirectoryInfo.SubDirectories.First(), Contains.Substring("TestSubDir"));
        }
Example #8
0
        public void ParsingFile_NewFile_ReturnsValidContentEntity()
        {
            var physicalFilesParser = new FileImportTestData().CreateTestPhysicalFilesParser();

            var it = physicalFilesParser.ParsePhysicalFiles(CreateThreadInfo()).First();

            Assert.That(it, Is.Not.Null);
            Assert.That(it.Hash, Does.StartWith("Hash").And.EndsWith("Hash"));
            Assert.That(it.Label, Is.EqualTo("2018-01-24-Chopok0335.JPG"));
            Assert.That(it.Type, Is.EqualTo("Image"));

            Assert.That(it.AttributedBinders, Is.Not.Null, "Attributed Binders is null");
            Assert.That(it.AttributedBinders.Count(), Is.EqualTo(1));
        }
Example #9
0
        public void ParsingFiles_ChangesFilesAndFilesDoneCounts()
        {
            var physicalFilesParser = new FileImportTestData().CreateTestPhysicalFilesParser();

            var info = CreateThreadInfo();

            physicalFilesParser.ParsePhysicalFiles(info).First();

            Assert.That(info.Files, Is.EqualTo(5));
            Assert.That(info.FilesDone, Is.EqualTo(1));

            physicalFilesParser.ParsePhysicalFiles(info).Last();
            Assert.That(info.Files, Is.EqualTo(5));
            Assert.That(info.FilesDone, Is.EqualTo(5));
        }