public void StartLogging_PaduakFace_LogFileIsCreated() { int major, minor, bugfix; Graphite2Api.EngineVersion(out major, out minor, out bugfix); if (major <= 1 && minor < 2) { using (var face = new Face(TestConstants.PaduakFontLocation, FaceOptions.face_default)) { Assert.Throws <NotSupportedException>(() => face.StartLogging(String.Empty)); Assert.Throws <NotSupportedException>(() => face.StopLogging()); } return; } using (var face = new Face(TestConstants.PaduakFontLocation, FaceOptions.face_default)) { string filename = Path.GetTempPath() + Guid.NewGuid().ToString(); Assert.IsTrue(face.StartLogging(filename)); Assert.IsTrue(File.Exists(filename)); face.StopLogging(); File.Delete(filename); } }
public void EngineVersion_ReturnsSensibleVersionValues() { int major, minor, bugfix; Graphite2Api.EngineVersion(out major, out minor, out bugfix); Assert.AreEqual(1, major, "Major"); if (major == 1) { Assert.GreaterOrEqual(minor, 0, "Minor"); } }
public void StartLogging_WithTestFaceAndValidLogFileLocation_FileShouldBeCreated() { int major, minor, bugfix; Graphite2Api.EngineVersion(out major, out minor, out bugfix); if (major <= 1 && minor < 2) { Assert.Ignore("Need newer engine to support logging"); } using (var face = new PaduakDisposableFace()) { string filename = Path.GetTempPath() + Guid.NewGuid().ToString(); Assert.IsTrue(Graphite2Api.StartLogging(face.Face, filename)); Assert.IsTrue(File.Exists(filename)); Graphite2Api.StopLogging(face.Face); File.Delete(filename); } }