public void ProjectFactoryCanCompareContentsOfReadOnlyFile() { var us = Assembly.GetExecutingAssembly(); var sourcePath = us.Location; var fullPath = sourcePath + "readOnly"; File.Copy(sourcePath, fullPath); File.SetAttributes(fullPath, FileAttributes.ReadOnly); try { var actual = ProjectFactory.ContentEquals(sourcePath, fullPath); Assert.Equal(true, actual); } finally { File.SetAttributes(fullPath, FileAttributes.Normal); File.Delete(fullPath); } }