Example #1
0
        public void TestFileHelperVerifyFileCreateMapping()
        {
            var path = Path.Combine("FileHelper", "file");

            CreateMappings.FileHelper.verifyFileExists(path);
            Assert.AreEqual("", logger.GetAndClearValue(), "file should have been found");
            path = Path.Combine("FileHelper", "notAFile");
            CreateMappings.FileHelper.verifyFileExists(path);
            Assert.AreEqual("this file doesn't exist   " + path + Environment.NewLine, logger.GetAndClearValue(), "file should not have been found");
            path = Path.Combine("FileHelper", "folder");
            CreateMappings.FileHelper.verifyFileExists(path);
            Assert.AreEqual("this file doesn't exist   " + path + Environment.NewLine, logger.GetAndClearValue(), "folders aren't files");
            CreateMappings.FileHelper.verifyFileExists(null);
            Assert.AreEqual("this file doesn't exist   " + Environment.NewLine, logger.GetAndClearValue(), "a null path shouldn't be accepted");
        }