Esempio n. 1
0
 public void Can_Get_LastModificationTime()
 {
     _dependencyList
     .AddAssemblyOf <DependencyList>()
     .AddAssemblyOf <DependencyList_With_RealFileSystem_Tests>();
     _dependencyList.GetLastModificationTime().Should().NotBeNull();
 }
Esempio n. 2
0
        public void Can_Calculate_Maximum_ModificationDate()
        {
            const string fileName1 = "file1";
            const string fileName2 = "file2";

            _fileSystemMock.Setup(f => f.FileExists(It.IsAny <string>())).Returns(true);
            _fileSystemMock.Setup(f => f.GetLastWriteTimeUtc(BasePath + fileName1)).Returns(new DateTime(2018, 01, 01, 00, 00, 00, DateTimeKind.Utc));
            _fileSystemMock.Setup(f => f.GetLastWriteTimeUtc(BasePath + fileName2)).Returns(new DateTime(2019, 01, 01, 00, 00, 00, DateTimeKind.Utc));

            _dependencyList.AddFiles(new[] { fileName1, fileName2 });
            _dependencyList.GetLastModificationTime().Should().Be(new DateTime(2019, 01, 01, 00, 00, 00, DateTimeKind.Utc));
        }