Ejemplo n.º 1
0
 public void LanguageJsonFromMissing()
 {
     ExceptionAssert.Propagates <Exception>(() => EMAIL.LANGS.JSON_CLASSES.JSON_FILE_MISSING.RunTest(), exc => {
         Assert.IsTrue(exc.Message.Contains("JSON_FILE_MISSING"));
         Assert.AreEqual(typeof(System.IO.FileNotFoundException), exc.InnerException.GetType());
         Console.WriteLine(exc.ToMessages());
     });
 }
Ejemplo n.º 2
0
 public void LanguageJsonError()
 {
     ExceptionAssert.Propagates <Exception>(() => EMAIL.LANGS.JSON_CLASSES.JSON_ERROR.RunTest(), exc => {
         Assert.IsTrue(exc.Message.Contains("JSON_ERROR"));
         Assert.AreEqual(typeof(JsonSerializationException), exc.InnerException.GetType());
         Console.WriteLine(exc + "");
     });
 }
Ejemplo n.º 3
0
 public void Language()
 {
     Assert.AreEqual("English", EMAIL.LANGS.CLICK.Get("en"));
     Assert.AreEqual("Spanish", EMAIL.LANGS.CLICK.Get(EMAIL.LANGS.CLICK.Language.es));
     Assert.AreEqual("Brazillian", EMAIL.LANGS.CLICK.Get("português"));
     ExceptionAssert.Propagates <Exception>(() => EMAIL.LANGS.CLICK.Get("Bla"), exc => {
         Assert.IsTrue(exc.Message.Contains("Is not mapped"));
         Assert.IsTrue(exc.Message.Contains("Bla"));
     });
 }
Ejemplo n.º 4
0
        public void LanguageRunTest()
        {
            AggregateException errors = new AggregateException();
            var testResults           = EMAIL.RunTests(exc => errors = exc);

            testResults.ForEach(tr => Console.WriteLine(tr.ToJson()));
            errors.InnerExceptions.ForEach(error => Console.WriteLine(error.ToMessages() + "\n\n"));
            Assert.AreEqual(4, errors.InnerExceptions.Count);
            ExceptionAssert.Propagates <AggregateException>(() => EMAIL.RunTests(), exc => {
                Assert.AreEqual(4, exc.InnerExceptions.Count);
            });
        }
Ejemplo n.º 5
0
 public void LanguageFromPathEmpty()
 {
     ExceptionAssert.Propagates <Exception>(() => EMAIL.LANGS.JSON_CLASSES.JSON_PATH_EMPTY.RunTest(), exc => {
         Assert.IsTrue(exc.InnerException.Message.Contains("pt.txt"), "en.txt not found in exception message");
     });
 }