Пример #1
0
        public void GetContentSensitiveProjectDependentFileTimes_WhenProjectAssetsFileDoesNotExist_ReturnsNullForLastWriteTime()
        {
            string projectXml =
                @"<Project>
  <PropertyGroup>
     <ProjectAssetsFile>C:\Project\project.assets.json</ProjectAssetsFile>
  </PropertyGroup>
</Project>";

            var lastWriteTime = DateTime.UtcNow;

            var projectInstance = ProjectInstanceFactory.Create(projectXml);

            var fileSystem = IFileSystemFactory.ImplementTryGetLastFileWriteTimeUtc((string path, out DateTime? result) => { result = null; return(false); });

            var provider = CreateInstance();

            var result = provider.GetContentSensitiveProjectDependentFileTimes(projectInstance).First();

            Assert.Equal(@"C:\Project\project.assets.json", result.Key);
            Assert.Null(result.Value);
        }