public void GetMessageReceivedVideoShouldPass() { MultimediaMessage message = Multimedia.GetMessage("*7*0*4001*##"); Assert.AreEqual <WHAT>(WHAT.MultimediaCameraON, message.What); Assert.AreEqual <int>(4001, message.Where.PL); }
public void GetMessageDisplayDialXYShouldPass() { MultimediaMessage message = Multimedia.GetMessage("*7*311##"); Assert.AreEqual <WHAT>(WHAT.MultimediaDisplayDialXY, message.What); Assert.AreEqual <int>(message.DisplayDialX, 1); Assert.AreEqual <int>(message.DisplayDialY, 1); }
public static MultimediaMessage GetMessage(string data) { if (string.IsNullOrEmpty(data)) { return(null); } string[] content; MultimediaMessage message = null; try { content = data.Remove(data.Length - 2, 2).Split(new char[] { '*' }, StringSplitOptions.RemoveEmptyEntries); message = new MultimediaMessage(); message.What = GetWhat(content[1]); if (content.Length == 3) { message.Where = Where.GetWhere(content[2]); } if (content[1].StartsWith("3")) { // It's a Display Dial X-Y message message.DisplayDialX = int.Parse(content[1][1].ToString()); message.DisplayDialY = int.Parse(content[1][2].ToString()); message.What = WHAT.MultimediaDisplayDialXY; } } catch (Exception) { return(null); } return(message); }
public void GetMessageIncreaseXShouldPass() { MultimediaMessage message = Multimedia.GetMessage("*7*130##"); Assert.AreEqual <WHAT>(WHAT.MultimediaIncreaseX, message.What); }
public void GetMessageFreeAudioAndVideoResourceShouldPass() { MultimediaMessage message = Multimedia.GetMessage("*7*9**##"); Assert.AreEqual <WHAT>(WHAT.MultimediaAudioVideoOFF, message.What); }
public void GetMessageVideoOFFShouldPass() { MultimediaMessage message = Multimedia.GetMessage("*7*8**##"); Assert.AreEqual <WHAT>(WHAT.MultimediaCameraOFF, message.What); }