private void SendBtn_Click(object sender, EventArgs e)
 {
     try
     {
         reader.SetPath(NumbersFilePath);
         var bulkMessage = new BulkMessage(this.ResultPath, reader.Read(), MessageTxt.Text);
         HandleInvalidNumbers(bulkMessage);
         bulkMessageSender.Send(bulkMessage);
     }
     catch (Exception ex)
     {
         MessageBox.Show(this, ex.Message, "Exception",
                         MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
     }
 }
Example #2
0
        public void SendList_Of_BulkMessageSender_Should_Send_When_EveryThingIsOk()
        {
            //Arrange
            List <string> phoneNumbers = new List <string>();

            phoneNumbers.Add("09132204079");
            BulkMessage bulkMessage = new BulkMessage("Salam", phoneNumbers, "سلام");
            //Act
            var result = bulkMessageSender.Send(bulkMessage);

            //Assert
            result.Should().NotBeNull();
            result[0].Status.Should().Be(ResultStatus.Successful);
            OneStepTriggered.Should().BeTrue();
        }