public void Persists() { TestPersistentId(FileSystem, idFilePath => { var id = PersistentId.Load(FileSystem, idFilePath); PersistentId.Load(FileSystem, idFilePath).Should().Be(id); }); }
public void CreatesDirectoryIfMissing() { using (var testDirectory = new DisposableDirectory(FileSystem)) { var missingDirectory = testDirectory.Path / "MissingDirectory"; var id = PersistentId.Load(FileSystem, missingDirectory / "Cache.id"); id.Should().NotBe(Guid.Empty); FileSystem.DirectoryExists(missingDirectory).Should().BeTrue(); } }
public void CreatesNonSpecialValue() { TestPersistentId(FileSystem, idFilePath => { var id = PersistentId.Load(FileSystem, idFilePath); id.Should().NotBe(CacheDeterminism.None.EffectiveGuid); id.Should().NotBe(CacheDeterminism.Tool.EffectiveGuid); id.Should().NotBe(CacheDeterminism.SinglePhaseNonDeterministic.EffectiveGuid); }); }
public void CreatesNewOnCorrupted() { TestPersistentId(FileSystem, idFilePath => { var id = PersistentId.Load(FileSystem, idFilePath); FileSystem.WriteAllBytes(idFilePath, new byte[] {}); var newId = PersistentId.Load(FileSystem, idFilePath); newId.Should().NotBe(id); }); }
public void CreatesNewOnNonexistent() { TestPersistentId(FileSystem, idFilePath => { var id = PersistentId.Load(FileSystem, idFilePath); id.Should().NotBe(Guid.Empty); FileSystem.DeleteFile(idFilePath); var newId = PersistentId.Load(FileSystem, idFilePath); newId.Should().NotBe(Guid.Empty); newId.Should().NotBe(id); }); }