public void It_creates_the_sentinel_in_the_nuget_cache_path_if_it_does_not_exist_already() { var fileSystemMock = _fileSystemMockBuilder.Build(); var nugetCacheSentinel = new NuGetCacheSentinel(NUGET_CACHE_PATH, fileSystemMock.File); nugetCacheSentinel.Exists().Should().BeFalse(); nugetCacheSentinel.CreateIfNotExists(); nugetCacheSentinel.Exists().Should().BeTrue(); }
public void It_does_not_create_the_sentinel_again_if_it_already_exists_in_the_nuget_cache_path() { const string contentToValidateSentinalWasNotReplaced = "some string"; var sentinel = Path.Combine(NUGET_CACHE_PATH, NuGetCacheSentinel.SENTINEL); _fileSystemMockBuilder.AddFile(sentinel, contentToValidateSentinalWasNotReplaced); var fileSystemMock = _fileSystemMockBuilder.Build(); var nugetCacheSentinel = new NuGetCacheSentinel(NUGET_CACHE_PATH, fileSystemMock.File); nugetCacheSentinel.Exists().Should().BeTrue(); nugetCacheSentinel.CreateIfNotExists(); fileSystemMock.File.ReadAllText(sentinel).Should().Be(contentToValidateSentinalWasNotReplaced); }