Esempio n. 1
0
        public void CorrectStringTest(string path, string expected)
        {
            _stringFormatterMock.Setup(s => s.ShortFileString(path)).Returns(expected);

            var fileRepo = new TemporaryFileRepository(_stringFormatterMock.Object);

            fileRepo.Add(path);

            CollectionAssert.Contains(fileRepo.Paths, expected);
        }
Esempio n. 2
0
        public void NullStringTest()
        {
            string path = null;

            _stringFormatterMock.Setup(s => s.ShortFileString(path)).Throws <NullReferenceException>();

            var fileRepo = new TemporaryFileRepository(_stringFormatterMock.Object);

            Assert.Throws <NullReferenceException>(() => fileRepo.Add(path));
        }
Esempio n. 3
0
        public void CorrectStringTest(string path, string expected)
        {
            var stringFormatter = new CorrectStringFormatterMock(expected);

            var fileRepo = new TemporaryFileRepository(stringFormatter);

            fileRepo.Add(path);

            CollectionAssert.Contains(fileRepo.Paths, expected);
        }
Esempio n. 4
0
        public void NullStringTest()
        {
            string path = null;

            var stringFormatter = new NullStringFormatterMock();

            var fileRepo = new TemporaryFileRepository(stringFormatter);

            Assert.Throws <NullReferenceException>(() => fileRepo.Add(path));
        }
Esempio n. 5
0
        public void EmptyStringTest()
        {
            string path     = String.Empty;
            string expected = String.Empty;

            _stringFormatterMock.Setup(s => s.ShortFileString(path)).Returns(String.Empty);

            var fileRepo = new TemporaryFileRepository(_stringFormatterMock.Object);

            fileRepo.Add(path);

            CollectionAssert.Contains(fileRepo.Paths, expected);
        }
Esempio n. 6
0
        public void EmptyStringTest()
        {
            string path     = String.Empty;
            string expected = String.Empty;

            var stringFormatter = new EmptyStringFormatterMock();

            var fileRepo = new TemporaryFileRepository(stringFormatter);

            fileRepo.Add(path);

            CollectionAssert.Contains(fileRepo.Paths, expected);
        }