Hopefully this is helpful.
The following should be testable in a unit test method. Note I have all code in one file where each class should be broken out into their own files. Note how the delegate/event are done using a class (WhatEver) as a argument to the delegate.
namespace ConsoleApp1.Classes
{
class Class1
{
public delegate void OnProcessingCompleted(WhatEver sender);
public static event OnProcessingCompleted OnProcessingCompletedEvent;
public static void DoWork()
{
OnProcessingCompletedEvent?.Invoke(new WhatEver()
{
StartLockDownCount = 1,
EndLockDownCount = 10
});
}
}
public class WhatEver
{
public int StartLockDownCount { get; set; }
public int EndLockDownCount { get; set; }
}
public class Caller
{
public Caller()
{
Class1.OnProcessingCompletedEvent += Class1OnOnProcessingCompletedEvent;
}
private void Class1OnOnProcessingCompletedEvent(WhatEver sender)
{
var startCount = sender.StartLockDownCount;
}
}
}
And for completeness here is how I write unit test