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

luttje / Key2Joy / 6557152774

18 Oct 2023 06:36AM UTC coverage: 52.519% (+39.8%) from 12.718%
6557152774

push

github

web-flow
Adding more tests, fixing bugs in the process (#48)

* Add config manager tests

* legacy config and mapping profile tests (should fix #42)

* remove comment, problem was caused by transfer across appdomain (or to/fro scripting environment)

* Test core functionality #48 + includes minor refactoring to be able to test + added docs

* Add interop tests + implement and test async test utility (refactors away from singletons)

* fix not all tests running in workflow

* config and interop tests

* Refactor and allow mocking global input hook class

* add capture action test

* Make Execute override optional for script only methods

* add dependency injection + refactor and try test gamepad service

* Refactor config singleton to using dependency injection

* add tests for scripting

* add tests for plugin set + fix plugin showing as loaded even if checksum match failed

* fix tests failing because it relied on config exist (I guess the test order was accidentally correct earlier, this means we should really fix cleanup so we catch this sooner)

* refactor docs code + fix wrong enum summary

* refactor docs builder and start testing it a bit

* fix cmd project structure

* ignore designer files in tests

* cleanup and refactor UI code + show latest version in help

* truncate listview action column

* allow user config to minimize app when pressing X (defaults to shut down app) resolves #45

696 of 1757 branches covered (0.0%)

Branch coverage included in aggregate %.

4597 of 4597 new or added lines in 138 files covered. (100.0%)

3619 of 6459 relevant lines covered (56.03%)

17089.01 hits per line

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

25.0
/Core/Key2Joy.Core/LowLevelInput/GamePad/SimulatedGamePad.cs
1
using SimWinInput;
2

3
namespace Key2Joy.LowLevelInput.GamePad;
4

5
/// <summary>
6
/// Implementation based on https://github.com/DavidRieman/SimWinInput
7
/// </summary>
8
public class SimulatedGamePad : IGamePad
9
{
10
    public int Index { get; private set; }
36✔
11
    private bool isPluggedIn = false;
12

13
    public SimulatedGamePad(int index)
36✔
14
        => this.Index = index;
36✔
15

16
    public void PlugIn()
17
    {
18
        this.isPluggedIn = true;
×
19
        SimGamePad.Instance.PlugIn(this.Index);
×
20
    }
×
21

22
    public bool GetIsPluggedIn()
23
        => this.isPluggedIn;
8✔
24

25
    public void Unplug()
26
    {
27
        SimGamePad.Instance.Unplug(this.Index);
×
28
        this.isPluggedIn = false;
×
29
    }
×
30

31
    public void Use(GamePadControl control, int holdTimeMS = 50)
32
        => SimGamePad.Instance.Use(control, this.Index, holdTimeMS);
×
33

34
    public void SetControl(GamePadControl control)
35
        => SimGamePad.Instance.SetControl(control, this.Index);
×
36

37
    public void ReleaseControl(GamePadControl control)
38
        => SimGamePad.Instance.ReleaseControl(control, this.Index);
×
39

40
    public SimulatedGamePadState GetState()
41
        => SimGamePad.Instance.State[this.Index];
×
42

43
    public void ResetState()
44
        => SimGamePad.Instance.State[this.Index].Reset();
×
45

46
    public void Update()
47
        => SimGamePad.Instance.Update(this.Index);
×
48
}
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