Exemple #1
0
        private async Task WriteToLog <T>() where T : ILogLevel, new()
        {
            string typeName = typeof(T).Name;

            try
            {
                await Logger <T> .Write("Writting a single line");

                List <string> msgs = new List <string>()
                {
                    "This", "is", "a", "list", "of", "strings"
                };

                await Logger <T> .Write(msgs);

                if (!File.Exists(Logger <T> .getLogLocation()))
                {
                    Assert.Fail($"{typeName} file does not exist.");
                }
            }
            catch (Exception e)
            {
                Assert.Fail($"An error occured writting to the {typeName}: {e.Message}.");
            }
            Assert.Pass($"{typeName} has passed WriteToLog test.");
        }