예제 #1
0
    public void SetPreventDefault_Success_on_BlazorWebAssembly()
    {
        var args = new HotKeyDownEventArgs(ModKeys.None, Keys.A, "INPUT", "text", isWasm: true, nativeKey: "a", nativeCode: "KeyA");

        args.PreventDefault.IsFalse();
        args.PreventDefault = true;
        args.PreventDefault.IsTrue();
    }
예제 #2
0
    public void SetPreventDefault_to_False_on_BlazorServer()
    {
        var args = new HotKeyDownEventArgs(ModKeys.None, Keys.A, "INPUT", "text", isWasm: false, nativeKey: "a", nativeCode: "KeyA");

        args.PreventDefault.IsFalse();
        args.PreventDefault = false;
        args.PreventDefault.IsFalse();
    }
예제 #3
0
    public void SetPreventDefault_to_True_Throws_Exception_on_BlazorServer()
    {
        var args = new HotKeyDownEventArgs(ModKeys.None, Keys.A, "INPUT", "text", isWasm: false, nativeKey: "a", nativeCode: "KeyA");

        Assert.Throws <InvalidOperationException>(() =>
        {
            args.PreventDefault = true;
        });
    }