diff --git a/src/PepperDash.Essentials.MobileControl.Messengers/Tests/MockCallStatusDevice.cs b/src/PepperDash.Essentials.MobileControl.Messengers/Tests/MockCallStatusDevice.cs deleted file mode 100644 index a510e5bd..00000000 --- a/src/PepperDash.Essentials.MobileControl.Messengers/Tests/MockCallStatusDevice.cs +++ /dev/null @@ -1,123 +0,0 @@ -using System; -using System.Collections.Generic; -using PepperDash.Core; -using PepperDash.Essentials.Core; -using PepperDash.Essentials.Devices.Common.Codec; - -namespace PepperDash.Essentials.AppServer.Messengers.Tests -{ - /// - /// Mock device for testing CallStatusMessenger that implements IHasDialer without VideoCodecBase - /// - public class MockCallStatusDevice : EssentialsDevice, IHasDialer, IHasContentSharing - { - public event EventHandler CallStatusChange; - - private List _activeCalls = new List(); - private bool _isInCall; - private bool _sharingContentIsOn; - private string _sharingSource = ""; - - public MockCallStatusDevice(string key, string name) : base(key, name) - { - SharingContentIsOnFeedback = new BoolFeedback(key + "-SharingContentIsOnFeedback", () => _sharingContentIsOn); - SharingSourceFeedback = new StringFeedback(key + "-SharingSourceFeedback", () => _sharingSource); - AutoShareContentWhileInCall = false; - } - - public bool IsInCall - { - get => _isInCall; - private set - { - if (_isInCall != value) - { - _isInCall = value; - OnCallStatusChange(); - } - } - } - - public List ActiveCalls => _activeCalls; - - public BoolFeedback SharingContentIsOnFeedback { get; private set; } - public StringFeedback SharingSourceFeedback { get; private set; } - public bool AutoShareContentWhileInCall { get; private set; } - - public void Dial(string number) - { - // Mock implementation - var call = new CodecActiveCallItem - { - Id = Guid.NewGuid().ToString(), - Name = $"Call to {number}", - Number = number, - Status = eCodecCallStatus.Dialing, - Direction = eCodecCallDirection.Outgoing - }; - - _activeCalls.Add(call); - IsInCall = true; - } - - public void EndCall(CodecActiveCallItem activeCall) - { - if (activeCall != null && _activeCalls.Contains(activeCall)) - { - _activeCalls.Remove(activeCall); - IsInCall = _activeCalls.Count > 0; - } - } - - public void EndAllCalls() - { - _activeCalls.Clear(); - IsInCall = false; - } - - public void AcceptCall(CodecActiveCallItem item) - { - if (item != null) - { - item.Status = eCodecCallStatus.Connected; - IsInCall = true; - } - } - - public void RejectCall(CodecActiveCallItem item) - { - if (item != null && _activeCalls.Contains(item)) - { - _activeCalls.Remove(item); - IsInCall = _activeCalls.Count > 0; - } - } - - public void SendDtmf(string digit) - { - // Mock implementation - nothing to do - } - - public void StartSharing() - { - _sharingContentIsOn = true; - _sharingSource = "Local"; - SharingContentIsOnFeedback.FireUpdate(); - SharingSourceFeedback.FireUpdate(); - } - - public void StopSharing() - { - _sharingContentIsOn = false; - _sharingSource = ""; - SharingContentIsOnFeedback.FireUpdate(); - SharingSourceFeedback.FireUpdate(); - } - - private void OnCallStatusChange() - { - CallStatusChange?.Invoke(this, new CodecCallStatusItemChangeEventArgs( - _activeCalls.Count > 0 ? _activeCalls[0] : null)); - } - } -} \ No newline at end of file diff --git a/src/PepperDash.Essentials.MobileControl.Messengers/Tests/Program.cs b/src/PepperDash.Essentials.MobileControl.Messengers/Tests/Program.cs deleted file mode 100644 index 6f61cd23..00000000 --- a/src/PepperDash.Essentials.MobileControl.Messengers/Tests/Program.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System; -using System.Collections.Generic; -using PepperDash.Core; -using PepperDash.Essentials.Core; -using PepperDash.Essentials.Devices.Common.Codec; -using PepperDash.Essentials.AppServer.Messengers; -using PepperDash.Essentials.AppServer.Messengers.Tests; - -namespace PepperDash.Essentials.MobileControl.Tests -{ - /// - /// Simple test program to verify CallStatusMessenger functionality - /// - class Program - { - static void Main(string[] args) - { - Console.WriteLine("Testing CallStatusMessenger with IHasDialer device..."); - - try - { - // Create a mock device that implements IHasDialer but not VideoCodecBase - var mockDevice = new MockCallStatusDevice("mock-codec-1", "Mock Call Device"); - - // Create the new CallStatusMessenger - var messenger = new CallStatusMessenger( - "test-messenger-1", - mockDevice, - "/device/mock-codec-1" - ); - - Console.WriteLine("āœ“ Successfully created CallStatusMessenger with IHasDialer device"); - - // Test basic call functionality - Console.WriteLine("\nTesting call functionality:"); - - Console.WriteLine("- Initial call status: " + (mockDevice.IsInCall ? "In Call" : "Not In Call")); - - // Test dialing a number - mockDevice.Dial("1234567890"); - Console.WriteLine("- After dialing: " + (mockDevice.IsInCall ? "In Call" : "Not In Call")); - - // Test ending all calls - mockDevice.EndAllCalls(); - Console.WriteLine("- After ending all calls: " + (mockDevice.IsInCall ? "In Call" : "Not In Call")); - - // Test content sharing if supported - if (mockDevice is IHasContentSharing sharingDevice) - { - Console.WriteLine("\nTesting content sharing:"); - Console.WriteLine("- Initial sharing status: " + sharingDevice.SharingContentIsOnFeedback.BoolValue); - - sharingDevice.StartSharing(); - Console.WriteLine("- After start sharing: " + sharingDevice.SharingContentIsOnFeedback.BoolValue); - - sharingDevice.StopSharing(); - Console.WriteLine("- After stop sharing: " + sharingDevice.SharingContentIsOnFeedback.BoolValue); - } - - Console.WriteLine("\nāœ“ All tests passed! CallStatusMessenger works with interface-based devices."); - - } - catch (Exception ex) - { - Console.WriteLine("āœ— Test failed: " + ex.Message); - Console.WriteLine("Stack trace: " + ex.StackTrace); - } - - Console.WriteLine("\nPress any key to exit..."); - Console.ReadKey(); - } - } -} \ No newline at end of file