public virtual void ReportPerformance() { this.Receiver.SubscribeForChannels(MessageBusChannel.PerformanceReport); TaskProcessorPerformanceReport performance = new TaskProcessorPerformanceReport(Guid.NewGuid()) { CpuPercent = 23, RamPercent = 31 }; performance.TasksPerformance.Add(new TaskPerformanceReport(Guid.NewGuid()) { CpuPercent = 45, RamPercent = 46 }); performance.TasksPerformance.Add(new TaskPerformanceReport(Guid.NewGuid()) { CpuPercent = 76, RamPercent = 84 }); TaskProcessorPerformanceEventArgs args = Helpers.WaitForEvent <TaskProcessorPerformanceEventArgs>( this.Timeout, handler => this.Receiver.PerformanceReportReceived += handler, () => this.Sender.NotifyPerformanceReport(performance)); UnitTestHelpers.AssertEqualByPublicScalarProperties(performance, args.PerformanceInfo); Assert.IsTrue(performance.TasksPerformance.IsEquivalentTo( args.PerformanceInfo.TasksPerformance, (a, b) => UnitTestHelpers.AreEqualByPublicScalarProperties(a, b))); }
public bool Equals(ITaskRuntimeInfo other) { return(UnitTestHelpers.AreEqualByPublicScalarProperties(this, other)); }