Ejemplo n.º 1
0
        public void GetFileInfoTest()
        {
            // Arrange
            Pathes.Clear();
            Pathes.Enqueue(_path1);
            Pathes.Enqueue(_path2);

            _ = Mock.Get(_readInfo)
                .Setup(x => x.GetFileInfo(It.IsAny <Queue <string> >(), It.IsAny <Queue <InfoFile> >()))
                .Callback(() =>
            {
                Pathes.Dequeue();
                InfoFiles.Enqueue(_infoFile1);
                InfoFiles.Enqueue(_infoFile2);
            });

            // Act
            _readInfo.GetFileInfo(Pathes, InfoFiles);

            // Assert
            Assert.IsTrue(Pathes.Count == 1);
            Assert.IsTrue(Pathes.Contains(_path2));
            Assert.IsTrue(InfoFiles.Count() == 2);
            Assert.IsTrue(InfoFiles.Contains(_infoFile2));
        }
Ejemplo n.º 2
0
        public void GetPathesTest()
        {
            // Arrange
            Pathes.Clear();
            _ = Mock.Get(_readInfo)
                .Setup(x => x.GetPathes(It.IsAny <string>(), It.IsAny <Queue <string> >()))
                .Callback(() =>
            {
                Pathes.Enqueue(_path1);
                Pathes.Enqueue(_path2);
            });

            // Act
            _readInfo.GetPathes(_path, Pathes);

            // Assert
            Assert.IsTrue(Pathes.Count == 2);
            Assert.IsTrue(Pathes.Contains(_path1));
            Assert.IsTrue(Pathes.ElementAt(1).Equals(_path2));
        }