示例#1
0
        public void RebuildExecutable_TouchLibraryDll()
        {
            RunTarget(MonoTouchProject, TargetName.Build);
            var timestamps = ExpectedExecutableFiles.ToDictionary(file => file, file => GetLastModified(file));

            Touch(Path.Combine(LibraryProjectBinPath, "MyLibrary.dll"));
            RunTarget(MonoTouchProject, TargetName.Build);
            var newTimestamps = ExpectedExecutableFiles.ToDictionary(file => file, file => GetLastModified(file));

            // At least some files should be modified now
            Assert.IsTrue(timestamps.Keys.Any(key => timestamps [key] != newTimestamps [key]), "#1");
        }
示例#2
0
        public void RebuildExecutable_NoModifications()
        {
            // Put a thread.sleep so that the initial build happens a noticable amount of time after we copy
            // all the input files into the temporary directory. This means that any timestamps modified as
            // part of the original build will definitely be newer than the timestamps written during the
            // execution of the test fixture 'setup' method.
            Thread.Sleep(1000);
            RunTarget(MonoTouchProject, TargetName.Build);
            var timestamps = ExpectedExecutableFiles.ToDictionary(file => file, file => GetLastModified(file));

            Thread.Sleep(1000);
            RunTarget(MonoTouchProject, TargetName.Build);
            var newTimestamps = ExpectedExecutableFiles.ToDictionary(file => file, file => GetLastModified(file));

            foreach (var file in timestamps.Keys)
            {
                Assert.AreEqual(timestamps [file], newTimestamps [file], "#1: " + file);
            }
        }