Exemple #1
0
        public void CanRetrieveAPackagedBundleFileNameWithMatchingNameWhenOneExistsThatIncludesAWildCardForTheHash()
        {
            PackagerTests.delete_all_the_test_files();

            var testFile        = @"/myfilename_combined_1234448i484884844848848484484844848.css";
            var packageFileName = @"/myfilename_combined_#.css";

            PackagerTests.write_a_test_file_to_the_file_system(testFile);

            Assert.AreEqual(testFile.Replace("/", @"\"), factory.PackagedFileName(packageFileName));
        }
Exemple #2
0
        public void ExpectAFileNotFoundExceptionIfNoMatchingPackagedFileNameExists()
        {
            PackagerTests.delete_all_the_test_files();

            var testFile = @"/myfilename_combined_3_234448i484884844848848484484844848.css";

            var packageFileName = @"/myfilename2_combined_#.css";

            PackagerTests.write_a_test_file_to_the_file_system(testFile);

            var shouldntExist = factory.PackagedFileName(packageFileName);
        }
Exemple #3
0
        public void CanRetrieveAPackagedBundleFileNameWithMatchingNameWhenMoreThanOneExistsThatIncludesAWildCardForTheHash()
        {
            PackagerTests.delete_all_the_test_files();

            var testFile1       = @"/myfilename_combined_1234448i484884844848848484484844848.css";
            var testFile2       = @"/myfilename_combined_1234448i484884844848848484334334444.css";
            var packageFileName = @"/myfilename_combined_#.css";

            PackagerTests.write_a_test_file_to_the_file_system(testFile1);
            PackagerTests.write_a_test_file_to_the_file_system(testFile2);
            var found = factory.PackagedFileName(packageFileName);

            testFile1 = testFile1.Replace("/", @"\");
            testFile2 = testFile2.Replace("/", @"\");
            Assert.That(found == testFile1 || found == testFile2);
        }
Exemple #4
0
        public void WillSelectTheFileWithTheMostRecentTimeStampWhenRetrievingAPackagedBundleFileNameWithMatchingNameWhenMoreThanOneExistsThatIncludesAWildCardForTheHash()
        {
            PackagerTests.delete_all_the_test_files();

            var testFile1 = @"/myfilename_combined_3_234448i484884844848848484484844848.css";
            var testFile2 = @"/myfilename_combined_2_234448i484884844848848484334334444.css";
            var testFile3 = @"/myfilename_combined_1_234448i4848848yyyyyyyyyy4334334444.css"; //notice that if for some reason these were returned in alphanumeric search order, then 3 would be first...just to avoid a "coincidental" test pass.

            var packageFileName = @"/myfilename_combined_#.css";

            PackagerTests.write_a_test_file_to_the_file_system(testFile1);
            Thread.Sleep(1001);
            PackagerTests.write_a_test_file_to_the_file_system(testFile2);
            Thread.Sleep(1001);
            PackagerTests.write_a_test_file_to_the_file_system(testFile3);

            Assert.AreEqual(testFile1.Replace("/", @"\"), factory.PackagedFileName(packageFileName));
        }
Exemple #5
0
 public void TestFixtureTearDown()
 {
     PackagerTests.delete_all_the_test_files();
 }