public void CreateLoggerFile() { LoggerTools.CreateFile(); string path = LoggerTools.GetFilePath(); Assert.True(File.Exists(path)); }
public void GetLoggerFilePath() { string path = LoggerTools.GetFilePath(); string relativePath = Path.Combine(App.AppDir, @"../data.log"); string expectedPath = Path.GetFullPath(relativePath); Assert.AreEqual(expectedPath, path); }
public void ClearLoggerFile() { LoggerTools.ClearFile(); string path = LoggerTools.GetFilePath(); string result = File.ReadAllText(path); Assert.IsEmpty(result); }
public void LogException() { Exception e = new Exception("Uh-Oh, something broke!"); JetLogger.LogException(e); string path = LoggerTools.GetFilePath(); string result = File.ReadAllText(path); Assert.That(result.Contains(e.Message)); }
public void LogText() { string text = "JetWallet is a Bitcoin Wallet for Windows Desktop."; JetLogger.Log(text); string path = LoggerTools.GetFilePath(); string result = File.ReadAllText(path); Assert.That(result.Contains(text)); }
public void Clear() { string path = LoggerTools.GetFilePath(); File.Delete(path); }