Пример #1
0
        public void BasicAuthLogin()
        {
            string content = DatabaseAutomation.DownloadPageAsAdmin("Missions");

            Console.WriteLine(content);
            Assert.IsFalse(Regex.IsMatch(content, "<input[^>]id=\\\"username\\\"", RegexOptions.IgnoreCase), "Shouldn't contain username login box");
        }
Пример #2
0
        public void ErrorSendsEmail()
        {
            string[] olderFiles = Directory.GetFiles(DatabaseAutomation.GetMailDrop());
            try
            {
                DatabaseAutomation.DownloadPageAsAdmin("Admin/TestExceptionHandling");
            }
            catch (WebException ex)
            {
                Assert.AreEqual(WebExceptionStatus.ProtocolError, ex.Status, "Should get error from downloading page");
            }
            string[] newFiles = Directory.GetFiles(DatabaseAutomation.GetMailDrop());

            foreach (string file in newFiles.Except(olderFiles))
            {
                File.Delete(file);
            }

            Assert.AreEqual(olderFiles.Length + 1, newFiles.Length, "Should have sent one email based on error");
        }