示例#1
0
        public async Task Test104()
        {
            var identifier = "test";
            var handler    = new MockJsRuntimeInvokeHandler();
            await handler.ToJsRuntime().InvokeVoidAsync(identifier);

            var invocations = handler.VerifyInvoke(identifier, 1);

            invocations.ShouldBeSameAs(handler.Invocations[identifier]);

            var invocation = handler.VerifyInvoke(identifier);

            invocation.ShouldBe(handler.Invocations[identifier][0]);
        }
示例#2
0
        public async Task Test103()
        {
            var identifier = "test";
            var handler    = new MockJsRuntimeInvokeHandler();
            await handler.ToJsRuntime().InvokeVoidAsync(identifier);

            var actual = Should.Throw <JsInvokeCountExpectedException>(() => handler.VerifyInvoke(identifier, 2));

            actual.ExpectedInvocationCount.ShouldBe(2);
            actual.ActualInvocationCount.ShouldBe(1);
            actual.Identifier.ShouldBe(identifier);
        }
示例#3
0
        public void Test101()
        {
            var handler = new MockJsRuntimeInvokeHandler();

            Should.Throw <ArgumentException>(() => handler.VerifyInvoke("", 0));
        }