コード例 #1
0
        public void SendMessage(string SenderMailAdress, string RecipientMailAdress, string MessageSubject, string MessageBody)
        {
            using (var mess = new MailMessage(new MailAddress(SenderMailAdress), new MailAddress(RecipientMailAdress)))
            {
                mess.Subject = MessageSubject;
                mess.Body    = MessageBody;
                using (SmtpClient client = new SmtpClient(ServerAdress, ServerPort))
                {
                    client.EnableSsl = UseSSL;

                    client.Credentials = new NetworkCredential()
                    {
                        UserName = Login,
                        Password = TextEncoder.Decode(Password)
                    };
                    try
                    {
                        client.Send(mess);
                    }
                    catch (SmtpException e)
                    {
                        Trace.TraceError(e.ToString());
                        throw;
                    }
                }
            }
        }
コード例 #2
0
        public void Decode_BCD_to_ABC_with_key_1()
        {
            const string STR          = "BCD";
            const int    KEY          = 1;
            const string EXPECTED_STR = "ABC";

            var actual_str = TextEncoder.Decode(STR, KEY);

            Assert.AreEqual(EXPECTED_STR, actual_str);
        }
コード例 #3
0
        public void Decode_BCD_to_ABC_with_key_1()
        {
            const string str         = "BCD";
            const int    key         = 1;
            const string expectedStr = "ABC";

            var actualStr = TextEncoder.Decode(str, key);

            Assert.AreEqual(expectedStr, actualStr);
        }
コード例 #4
0
        public void Decode_BCD_to_ABC_with_key_1()
        {
            const string str          = "BCD";
            const int    key          = 1;
            const string expected_str = "ABC";
            TextEncoder  tenc         = new TextEncoder();
            var          actual_str   = tenc.Decode(str, key);

            Assert.AreEqual(expected_str, actual_str);
        }
コード例 #5
0
        public void Decode_BCD_to_ABC_with_key_1() //описание сценария тесты
        {
            //A-A-A = Arange -Act- Assert -3 этапа
            const string str          = "BCD"; //то, что есть
            const int    key          = 1;
            const string expected_str = "ABC"; //ожидаемое
            var          actual_str   = TextEncoder.Decode(str, key);

            Assert.AreEqual(expected_str, actual_str); //утверждаем, что значение 1 = значению 2
        }
コード例 #6
0
        public void Decode_BCD_to_ABC_with_key_1()
        {
            // A-A-A = Arrange - Act - Assert

            const string str          = "BCD";
            const int    key          = 1;
            const string expected_str = "ABC";

            var actual_str = TextEncoder.Decode(str, key);

            Assert.AreEqual(expected_str, actual_str);
        }
コード例 #7
0
        public void Decode_BCD_to_ABC_with_key_1()
        {
            // A-A-A = Arrange - Act - Assert

            const string str          = "BCD";
            const int    key          = 1;
            const string expected_str = "ABC";

            var actual_str = TextEncoder.Decode(str, key);

            Assert.AreEqual(expected_str, actual_str);

            //StringAssert.Matches();
            //CollectionAssert.AllItemsAreNotNull();
        }
コード例 #8
0
        public void Decode_BCD_to_ABC_with_key_1()
        {
            //A-A-A-Arrange-Act-Assert
            #region Arrange
            const string str = "BCD";
            const int    key = 1;

            const string expected_str = "ABC";
            #endregion
            #region Act

            var actual_str = TextEncoder.Decode(str, key);

            #endregion

            #region Assert

            Assert.AreEqual(expected_str, actual_str);
            #endregion
        }