コード例 #1
0
        public async void Should_SetFacilityAsync()
        {
            var indoorManager = new IndoorManager(_jsRuntime.Object, _logger.Object);
            await indoorManager.SetFacilityAsync("facilityId", 1);

            _jsRuntime.Verify(runtime => runtime.InvokeVoidAsync(Constants.JsConstants.Methods.Indoor.SetFacility.ToIndoorNamespace(), indoorManager.Id, "facilityId", 1), Times.Once);
            _jsRuntime.VerifyNoOtherCalls();
        }
コード例 #2
0
        public async void Should_SetDynamicStylingAsync()
        {
            var indoorManager = new IndoorManager(_jsRuntime.Object, _logger.Object);
            await indoorManager.SetDynamicStylingAsync(true);

            _jsRuntime.Verify(runtime => runtime.InvokeVoidAsync(Constants.JsConstants.Methods.Indoor.SetDynamicStyling.ToIndoorNamespace(), indoorManager.Id, true), Times.Once);
            _jsRuntime.VerifyNoOtherCalls();
        }
コード例 #3
0
        public async void Should_InitializeAsync()
        {
            var indoorManager = new IndoorManager(_jsRuntime.Object, _logger.Object);

            await indoorManager.InitializeAsync();

            _jsRuntime.Verify(runtime => runtime.InvokeVoidAsync(Constants.JsConstants.Methods.Indoor.Initialize.ToIndoorNamespace(), indoorManager.Id), Times.Once);
            _jsRuntime.VerifyNoOtherCalls();
        }
コード例 #4
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();
        }
コード例 #5
0
        public async void Should_NotSetFacility_DisposedCase_Async()
        {
            var indoorManager = new IndoorManager(_jsRuntime.Object, _logger.Object);
            await indoorManager.DisposeAsync();

            await Assert.ThrowsAnyAsync <ComponentDisposedException>(async() => await indoorManager.SetFacilityAsync("facilityId", 1));

            _jsRuntime.Verify(runtime => runtime.InvokeVoidAsync(Constants.JsConstants.Methods.Indoor.Dispose.ToIndoorNamespace(), indoorManager.Id), Times.Once);
            _jsRuntime.VerifyNoOtherCalls();
        }
コード例 #6
0
        public async void Should_GetStyleDefinition_Async()
        {
            var styleDefinition = new StyleDefinition();

            _jsRuntime.Setup(runtime => runtime.InvokeAsync <StyleDefinition>(It.IsAny <string>(), It.IsAny <object[]>())).ReturnsAsync(styleDefinition);

            var indoorManager = new IndoorManager(_jsRuntime.Object, _logger.Object);
            var result        = await indoorManager.GetStyleDefinitionAsync();

            Assert.Equal(styleDefinition, result);

            _jsRuntime.Verify(runtime => runtime.InvokeAsync <StyleDefinition>(Constants.JsConstants.Methods.Indoor.GetStyleDefinition.ToIndoorNamespace(), indoorManager.Id), Times.Once);
            _jsRuntime.VerifyNoOtherCalls();
        }
コード例 #7
0
        public async void Should_GetOptionsAsync()
        {
            var options = new IndoorManagerOptions();

            _jsRuntime.Setup(runtime => runtime.InvokeAsync <IndoorManagerOptions>(It.IsAny <string>(), It.IsAny <object[]>())).ReturnsAsync(options);

            var indoorManager = new IndoorManager(_jsRuntime.Object, _logger.Object);
            var result        = await indoorManager.GetOptionsAsync();

            Assert.Equal(options, result);

            _jsRuntime.Verify(runtime => runtime.InvokeAsync <IndoorManagerOptions>(Constants.JsConstants.Methods.Indoor.GetOptions.ToIndoorNamespace(), indoorManager.Id), Times.Once);
            _jsRuntime.VerifyNoOtherCalls();
        }
コード例 #8
0
        public async void Should_GetCurrentFacilityAsync()
        {
            var currentFacility = new IndoorFacility {
                FacilityId   = "facilityId",
                LevelOrdinal = 1
            };

            _jsRuntime.Setup(runtime => runtime.InvokeAsync <IndoorFacility>(It.IsAny <string>(), It.IsAny <object[]>())).ReturnsAsync(currentFacility);

            var indoorManager = new IndoorManager(_jsRuntime.Object, _logger.Object);
            var result        = await indoorManager.GetCurrentFacilityAsync();

            Assert.Equal(currentFacility.FacilityId, result.FacilityId);
            Assert.Equal(currentFacility.LevelOrdinal, result.LevelOrdinal);

            _jsRuntime.Verify(runtime => runtime.InvokeAsync <IndoorFacility>(Constants.JsConstants.Methods.Indoor.GetCurrentFacility.ToIndoorNamespace(), indoorManager.Id), Times.Once);
            _jsRuntime.VerifyNoOtherCalls();
        }
コード例 #9
0
 void Start()
 {
     instance = this;
     //indoorManager.Start ("<APP ID>", "<APP TOKEN>", "<LOCATION IDENTIFIER>");
     indoorManager.Start("unity-estimote-integration-g47", "22c52e95562a9bfbe6ad2ecd2f72d266", "3rd-floor-stairs");
 }