• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

AnderssonPeter / PowerType / 5536473282

pending completion
5536473282

push

github

AnderssonPeter
Update DynamicSourceCache when executing specific commands

317 of 492 branches covered (64.43%)

Branch coverage included in aggregate %.

58 of 58 new or added lines in 6 files covered. (100.0%)

676 of 948 relevant lines covered (71.31%)

177.78 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/PowerType/CurrentWorkingDirectoryProvider.cs
1
using System.Management.Automation;
2
using PowerType.BackgroundProcessing;
3

4
namespace PowerType;
5

6
internal class CurrentWorkingDirectoryProvider : ICurrentWorkingDirectoryProvider
7
{
8
    private bool disposed;
9
    private volatile string currentWorkingDirectory;
10
    private readonly SessionState sessionState;
11

12
    public CurrentWorkingDirectoryProvider(SessionState sessionState)
×
13
    {
14
        this.sessionState = sessionState;
×
15
        currentWorkingDirectory = sessionState.Path.CurrentFileSystemLocation.ProviderPath;
×
16
        sessionState.InvokeCommand.LocationChangedAction += LocationChanged;
×
17
        
18
    }
×
19

20
    private void LocationChanged(object? sender, LocationChangedEventArgs e)
21
    {
22
        currentWorkingDirectory = sessionState.Path.CurrentFileSystemLocation.ProviderPath;
×
23
    }
×
24

25
    public string CurrentWorkingDirectory => currentWorkingDirectory;
×
26

27
    public void Dispose()
28
    {
29
        // Dispose of unmanaged resources.
30
        Dispose(true);
×
31
        // Suppress finalization.
32
        GC.SuppressFinalize(this);
×
33
    }
×
34

35
    protected virtual void Dispose(bool disposing)
36
    {
37
        if (disposed)
×
38
        {
39
            return;
×
40
        }
41

42
        if (disposing)
×
43
        {
44
            sessionState.InvokeCommand.LocationChangedAction -= LocationChanged;
×
45
        }
46

47
        disposed = true;
×
48
    }
×
49
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc