< Summary - ReFlex - Library

Information
Class: ReFlex.Core.Interactivity.Util.MockRemoteInteractionProcessorService
Assembly: ReFlex.Core.Interactivity
File(s): D:\a\reflex\reflex\library\src\Core\Interactivity\Util\MockRemoteInteractionProcessorService.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 29
Coverable lines: 29
Total lines: 49
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_IsConnected()100%210%
get_IsBusy()100%210%
get_SendCompleteDataset()100%210%
Connect()100%210%
Disconnect()100%210%
Update()100%210%

File(s)

D:\a\reflex\reflex\library\src\Core\Interactivity\Util\MockRemoteInteractionProcessorService.cs

#LineLine coverage
 1using System;
 2using System.Collections.Generic;
 3using System.Threading.Tasks;
 4using ReFlex.Core.Common.Components;
 5using ReFlex.Core.Common.Util;
 6using ReFlex.Core.Interactivity.Interfaces;
 7
 8namespace ReFlex.Core.Interactivity.Util;
 9
 10public class MockRemoteInteractionProcessorService : IRemoteInteractionProcessorService
 11{
 012    public bool IsConnected { get; private set; }
 013    public bool IsBusy { get; }
 14
 015    public bool SendCompleteDataset { get; set; }
 16    public async Task<bool> Connect()
 017    {
 018        await Task.Run(() => IsConnected = true);
 019        return IsConnected;
 020    }
 21
 22    public async Task<bool> Disconnect()
 023    {
 024        await Task.Run(() => IsConnected = false);
 025        return IsConnected;
 026    }
 27
 28    public async Task<Tuple<IList<Interaction>, ProcessPerformance>> Update(PointCloud3 pointCloud, ProcessPerformance m
 029    {
 030      var result = new List<Interaction>();
 31
 032      await Task.Run(() =>
 033      {
 034        var rX = new Random().Next(pointCloud.SizeX) / pointCloud.SizeX;
 035        var rY = new Random().Next(pointCloud.SizeY) / pointCloud.SizeY;
 036
 037        measurement.Smoothing = TimeSpan.Zero;
 038        measurement.Preparation = TimeSpan.Zero;
 039        measurement.Update = TimeSpan.Zero;
 040        measurement.ComputeExtremumType = TimeSpan.Zero;
 041        measurement.ConvertDepthValue = TimeSpan.Zero;
 042
 043        var interaction = new Interaction(new Point3(rX, rY, 0.1f), InteractionType.Push, 20);
 044        result.Add(interaction);
 045      });
 46
 047      return new Tuple<IList<Interaction>, ProcessPerformance>(result, measurement);
 048    }
 49}