Ejemplo n.º 1
0
        public void WriteLogOutputsFile()
        {
            DirectoryInfo thisDirectory = new DirectoryInfo("./");
            string        operationName = $"mytestjob-{DateTime.Now.Ticks}";

            ISolrLog log = new SolrLog(thisDirectory);

            log.WriteLog(operationName, "test");

            Assert.IsTrue(File.Exists(thisDirectory.FullName + log.GetFileName(operationName)));
            File.Delete(thisDirectory.FullName + log.GetFileName(operationName));
        }
Ejemplo n.º 2
0
        public void GetFileNameReturnsCorrectString()
        {
            const string DATE_FORMATTING   = "yyy-MM-dd";
            const string OPERATION_NAME    = "mytestjob";
            string       EXPECTED_FILENAME = $"{OPERATION_NAME}-{DateTime.Now.ToString(DATE_FORMATTING)}.txt";

            ISolrLog log = new SolrLog(new DirectoryInfo("/"));

            Assert.AreEqual(EXPECTED_FILENAME, log.GetFileName(OPERATION_NAME));
        }