public async void Should_SetOptionsAsync() { var id = "id"; var animation = new MorphAnimation(id, _jsRuntime.Object); var options = new MorphAnimationOptions(); await animation.SetOptionsAsync(options); _jsRuntime.Verify(runtime => runtime.InvokeVoidAsync(Constants.JsConstants.Methods.Animation.SetOptions.ToAnimationNamespace(), id, options), Times.Once); _jsRuntime.VerifyNoOtherCalls(); }
public async ValueTask <IMorphAnimation> MorphAsync <T>(Geometry geometry, DataSource source, T newGeometry, MorphAnimationOptions options = default) where T : Geometry { _logger?.LogAzureMapsControlInfo(AzureMapLogEvent.AnimationService_Morph, "Calling MorphAsync"); Require.NotNull(geometry, nameof(geometry)); Require.NotNull(source, nameof(source)); Require.NotNull(newGeometry, nameof(newGeometry)); _logger?.LogAzureMapsControlDebug(AzureMapLogEvent.AnimationService_Morph, "Geometry", geometry); _logger?.LogAzureMapsControlDebug(AzureMapLogEvent.AnimationService_Morph, "Source", source); _logger?.LogAzureMapsControlDebug(AzureMapLogEvent.AnimationService_Morph, "New Geometry", newGeometry); _logger?.LogAzureMapsControlDebug(AzureMapLogEvent.AnimationService_SetCoordinates, "Options", options); var animation = new MorphAnimation(Guid.NewGuid().ToString(), _jsRuntime); await _jsRuntime.InvokeVoidAsync(Constants.JsConstants.Methods.Animation.Morph.ToAnimationNamespace(), animation.Id, geometry.Id, source.Id, newGeometry, options); animation.Disposed = options.DisposeOnComplete.GetValueOrDefault(); return(animation); }