public void SMSStorageTest() { // -- Arrange var smsStorage = new SMSStorage(); var meessage = "SimCorp"; var expected = 1; // -- Act smsStorage.ReceiveMessage(meessage); var actual = smsStorage.MessageList.Count; // -- Assert Assert.AreEqual(expected, actual); }
private void backgroundWorkerMessageReciecer_DoWork(object sender, DoWorkEventArgs e) { var rnd = new Random(); var message = providers[1]; var format = MessageFormat.None; var fomatedMessage = ""; smsStorage.SMSProviderService.SMSRecieved += (m) => ShowMessageInfo(m); do { message = providers[rnd.Next(providers.Count)]; format = CreateFormat(); fomatedMessage = SetMessageFormat($"{message} SMS recieved!", format); smsStorage.ReceiveMessage(fomatedMessage); Thread.Sleep(1000); }while (!backgroundWorkerMessageReciecer.CancellationPending == true); e.Cancel = true; var winformOutput = new WinFormOutput(richTextBoxMessageInfo); }