Dreamine.FullKit.Tests 1.0.0.0
Dreamine.FullKit.Tests 기능을 검증하는 자동화 테스트 프로젝트입니다.
로딩중...
검색중...
일치하는것 없음
DreamineTextLogFormatterTests.cs
이 파일의 문서화 페이지로 가기
1using Dreamine.Logging.Formatters;
2using Dreamine.Logging.Models;
3
5
15{
24 [Fact]
26 {
27 var entry = new DreamineLogEntry(
28 new DateTimeOffset(2026, 6, 7, 12, 34, 56, 789, TimeSpan.Zero),
29 DreamineLogLevel.Warning,
30 "Machine",
31 "Pressure changed",
32 exception: null,
33 threadId: 42);
34
35 var text = new DreamineTextLogFormatter().Format(entry);
36
37 Assert.Equal("[2026-06-07 12:34:56.789] [Warning] [Machine] [T42] Pressure changed", text);
38 }
39
48 [Fact]
50 {
51 var entry = new DreamineLogEntry(
52 DateTimeOffset.UnixEpoch,
53 DreamineLogLevel.Error,
54 "Machine",
55 "Failed",
56 new InvalidOperationException("bad state"),
57 threadId: 1);
58
59 var text = new DreamineTextLogFormatter().Format(entry);
60
61 Assert.Contains("[Error] [Machine] [T1] Failed", text);
62 Assert.Contains(nameof(InvalidOperationException), text);
63 Assert.Contains("bad state", text);
64 }
65}