Exemple #1
0
        public async void Should_SetOptions_Async()
        {
            var options       = new IndoorManagerOptions();
            var indoorManager = new IndoorManager(_jsRuntime.Object, _logger.Object);

            await indoorManager.SetOptionsAsync(options);

            _jsRuntime.Verify(runtime => runtime.InvokeVoidAsync(Constants.JsConstants.Methods.Indoor.SetOptions.ToIndoorNamespace(), indoorManager.Id, options), Times.Once);
            _jsRuntime.VerifyNoOtherCalls();
        }
Exemple #2
0
        public async void Should_NotSetOptions_DisposedCase_Async()
        {
            var options       = new IndoorManagerOptions();
            var indoorManager = new IndoorManager(_jsRuntime.Object, _logger.Object);
            await indoorManager.DisposeAsync();

            await Assert.ThrowsAnyAsync <ComponentDisposedException>(async() => await indoorManager.SetOptionsAsync(options));

            _jsRuntime.Verify(runtime => runtime.InvokeVoidAsync(Constants.JsConstants.Methods.Indoor.Dispose.ToIndoorNamespace(), indoorManager.Id), Times.Once);
            _jsRuntime.VerifyNoOtherCalls();
        }