public void TryParse_singleDigit()
    {
        var parse = LinuxOsxProcess.TryParse("309 System/Library/coreauthd -foo", out var command);

        Assert.True(parse);
        var processCommand = command !.Value;

        Assert.Equal(309, processCommand.Process);
        Assert.Equal("System/Library/coreauthd -foo", processCommand.Command);
    }
    public void TryParseWithZshInstalled()
    {
        var parse = LinuxOsxProcess.TryParse("20872 -zsh", out var command);

        Assert.True(parse);
        var processCommand = command !.Value;

        Assert.Equal(20872, processCommand.Process);
        Assert.Equal("-zsh", processCommand.Command);
    }
示例#3
0
    public void TryParse()
    {
        var parse = LinuxOsxProcess.TryParse("309 Wed Aug 26 02:17:40 2020     /System/Library/coreauthd -foo", out var command);

        Assert.True(parse);
        var processCommand = command !.Value;

        Assert.Equal(309, processCommand.Process);
        Assert.Equal(new DateTime(2020, 8, 26, 2, 17, 40), processCommand.StartTime);
        Assert.Equal("/System/Library/coreauthd -foo", processCommand.Command);
    }