public static WebEventData Parse(WebEventDescriptor eventDescriptor, string eventArgsJson) { return(new WebEventData( eventDescriptor.BrowserRendererId, eventDescriptor.EventHandlerId, InterpretEventFieldInfo(eventDescriptor.EventFieldInfo), ParseEventArgsJson(eventDescriptor.EventHandlerId, eventDescriptor.EventArgsType, eventArgsJson))); }
public static WebEventData Parse(Renderer renderer, WebEventDescriptor eventDescriptor, string eventArgsJson) { var parsedEventArgs = ParseEventArgsJson(renderer, eventDescriptor.EventHandlerId, eventDescriptor.EventName, eventArgsJson); return(new WebEventData( eventDescriptor.BrowserRendererId, eventDescriptor.EventHandlerId, InterpretEventFieldInfo(eventDescriptor.EventFieldInfo), parsedEventArgs)); }
public static WebEventData Parse( Renderer renderer, JsonSerializerOptions jsonSerializerOptions, WebEventDescriptor eventDescriptor, JsonElement eventArgsJson) { var parsedEventArgs = ParseEventArgsJson(renderer, jsonSerializerOptions, eventDescriptor.EventHandlerId, eventDescriptor.EventName, eventArgsJson); return new WebEventData( eventDescriptor.EventHandlerId, eventDescriptor.EventFieldInfo, parsedEventArgs); }
public void Read_WithBoolValue_Works(bool value) { // Arrange var args = new WebEventDescriptor { EventFieldInfo = new EventFieldInfo { ComponentId = 89, FieldValue = value, }, EventHandlerId = 897, EventName = "test1", }; var jsonElement = GetJsonElement(args); // Act var result = WebEventDescriptorReader.Read(jsonElement); // Assert Assert.Equal(args.EventHandlerId, result.EventHandlerId); Assert.Equal(args.EventName, result.EventName); Assert.Equal(args.EventFieldInfo.ComponentId, result.EventFieldInfo.ComponentId); Assert.Equal(args.EventFieldInfo.FieldValue, result.EventFieldInfo.FieldValue); }