public void NamesConvertedFromInstalledToInstallingDoNotHaveInstalledPostfix() { var name = DependencySnapshotFolderNameTools.CreateUniqueName(); var convertedToInstalling = DependencySnapshotFolderNameTools.ConvertInstalledToInstalling(name); Assert.False(convertedToInstalling.EndsWith(DependencySnapshotFolderNameTools.InstalledPostfix)); }
public DependencySnapshotInstallerTests() { _targetPathInstalled = DependencySnapshotFolderNameTools.CreateUniqueName(); _targetPathInstalling = DependencySnapshotFolderNameTools.ConvertInstalledToInstalling(_targetPathInstalled); _mockStorage.Setup(_ => _.CreateInstallingSnapshot(_targetPathInstalled)).Returns(_targetPathInstalling); _mockStorage.Setup(_ => _.PromoteInstallingSnapshotToInstalledAtomically(_targetPathInstalled)); }
public void CreatesLastAccessMarkerFilePathBasedOnSnapshotPath() { const string SnapshotPath = "Installed"; var markerFilePath = DependencySnapshotFolderNameTools.CreateLastAccessMarkerFilePath(SnapshotPath); Assert.Contains(SnapshotPath, markerFilePath); Assert.NotEqual(SnapshotPath, markerFilePath); }
public void CreatesUniqueEnoughNames() { var name1 = DependencySnapshotFolderNameTools.CreateUniqueName(); Thread.Sleep(2); // A snapshot name created 2 milliseconds later must be different var name2 = DependencySnapshotFolderNameTools.CreateUniqueName(); Assert.NotEqual(name1, name2); }
public void UniqueNamesConvertedFromInstalledToInstallingAreStillUnique() { var name1 = DependencySnapshotFolderNameTools.CreateUniqueName(); Thread.Sleep(2); // A snapshot name created 2 milliseconds later must be different var name2 = DependencySnapshotFolderNameTools.CreateUniqueName(); var convertedToInstalling1 = DependencySnapshotFolderNameTools.ConvertInstalledToInstalling(name1); var convertedToInstalling2 = DependencySnapshotFolderNameTools.ConvertInstalledToInstalling(name2); Assert.NotEqual(convertedToInstalling1, convertedToInstalling2); }
public void CreatesUniqueEnoughNames() { // ticks = microseconds * (TimeSpan.TicksPerMillisecond / 1000) // A snapshot name created 1 microsecond (10 ticks) later must be different var waitTime = new TimeSpan(10); var name1 = DependencySnapshotFolderNameTools.CreateUniqueName(); Thread.Sleep(waitTime); var name2 = DependencySnapshotFolderNameTools.CreateUniqueName(); Assert.NotEqual(name1, name2); }
public void UniqueNamesConvertedFromInstalledToInstallingAreStillUnique() { // A snapshot name created 1 microsecond (10 ticks) later must be different var waitTime = new TimeSpan(10); var name1 = DependencySnapshotFolderNameTools.CreateUniqueName(); Thread.Sleep(waitTime); var name2 = DependencySnapshotFolderNameTools.CreateUniqueName(); var convertedToInstalling1 = DependencySnapshotFolderNameTools.ConvertInstalledToInstalling(name1); var convertedToInstalling2 = DependencySnapshotFolderNameTools.ConvertInstalledToInstalling(name2); Assert.NotEqual(convertedToInstalling1, convertedToInstalling2); }
public void CreatedNamesHaveInstalledPostfix() { var name = DependencySnapshotFolderNameTools.CreateUniqueName(); Assert.EndsWith(DependencySnapshotFolderNameTools.InstalledPostfix, name); }