예제 #1
0
        public void ValidFilenameAttributeTest()
        {
            ValidFilenameAttribute attribute           = new ValidFilenameAttribute(16);
            const string           validFileName       = "c:\\test\\test.txt";
            const string           invalidFileName     = "c:\\te%@$#s><t**est.>txt";
            const string           longinvalidFileName = "c:\\te%@$#gfdsgfdhytueytjuegrhrthjetrgshstest.>txt";

            Assert.IsTrue(attribute.IsValid(validFileName));
            Assert.IsFalse(attribute.IsValid(invalidFileName));
            Assert.IsFalse(attribute.IsValid(longinvalidFileName));
        }
예제 #2
0
        public void VetaExportRequest_FilenameUnSuccessful(
            Guid projectUid, FilterResult filter, string fileName,
            CoordType coordType, OutputTypes outputType, string[] machineNames)
        {
            var userPreferences = new UserPreferences();
            var request         = new  CompactionVetaExportRequest(
                projectUid, filter, fileName,
                coordType, outputType, userPreferences, machineNames, null, null);

            var validate = new ValidFilenameAttribute(256);
            var result   = validate.IsValid(request.FileName);

            Assert.False(result);
        }