Ejemplo n.º 1
0
        public void TestConfigSetters()
        {
            var config = new nk.logger.csv.LoggerConfig();

            Assert.Throws <ArgumentNullException>(() => config.SetDateTimeFormat(null));
            Assert.Throws <ArgumentNullException>(() => config.SetDateTimeFormat(" "));

            Assert.Throws <ArgumentNullException>(() => config.SetFileName(null));
            Assert.Throws <ArgumentNullException>(() => config.SetFileName(" "));

            Assert.Throws <ArgumentNullException>(() => config.SetRelativePath(null));

            Assert.Throws <ArgumentNullException>(() => config.SetReplacementValue(' '));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Initiate an instance of Logger class.
        /// </summary>
        public CsvLogger()
        {
            var config = new nk.logger.csv.LoggerConfig();

            config.SetDateTimeFormat(Config.Logger.DateFormat)
            .SetFileName(Config.Logger.FileName)
            .SetRelativePath(Config.Logger.RelativePath)
            .SetReplacementValue(Config.Logger.ReplacementValue);

            csvLogger = new nk.logger.csv.Logger(config);
        }