Created
November 19, 2018 18:56
-
-
Save WernerMairl/a40f6e9779a2068dcce9b3cb6aac18f7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
..... | |
[Fact] | |
public void CreationTimeUtc_Bug() | |
{ | |
string proposedFileName = Path.GetTempFileName(); | |
File.Delete(proposedFileName); | |
File.WriteAllText(proposedFileName, "dummy file content as text"); | |
FileInfo localFile = new System.IO.FileInfo(proposedFileName); | |
DateTime newCreationTimeUTC = System.DateTime.UtcNow.Subtract(TimeSpan.FromDays(365)); | |
localFile.CreationTimeUtc = newCreationTimeUTC; | |
Assert.True(localFile.CreationTimeUtc == newCreationTimeUTC, "thats a BUG!!"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment