Skip to content
This repository was archived by the owner on Nov 6, 2018. It is now read-only.
This repository was archived by the owner on Nov 6, 2018. It is now read-only.

IFileProvider Deleting file does not fire Watch IChangeToken #192

Closed
@HaoK

Description

@HaoK

Expectation is that delete will fire the IChangeToken returned from Watch

        [Fact]
        public void DeletingFileWillFire()
        {
            var fileProvider = new PhysicalFileProvider(_basePath);

            var token = fileProvider.Watch("test.txt");
            Assert.False(token.HasChanged);
            File.WriteAllText(Path.Combine(_basePath, "test.txt"), @"{""JsonKey1"": ""JsonValue1""}");
            Assert.True(token.HasChanged);

            var token2 = fileProvider.Watch("test.txt");
            Assert.False(token2.HasChanged);
            File.Delete(Path.Combine(_basePath, "test.txt"));
            Thread.Sleep(1000);
            Assert.True(token2.HasChanged, "Deleted");
        }

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions