Dreamine.FullKit.Tests
1.0.0.0
Dreamine.FullKit.Tests 기능을 검증하는 자동화 테스트 프로젝트입니다.
Toggle main menu visibility
로딩중...
검색중...
일치하는것 없음
DreamineTextLogFormatterTests.cs
이 파일의 문서화 페이지로 가기
1
using
Dreamine.Logging.Formatters;
2
using
Dreamine.Logging.Models;
3
4
namespace
Dreamine.FullKit.Tests.Logging
;
5
14
public
sealed
class
DreamineTextLogFormatterTests
15
{
24
[Fact]
25
public
void
Format_WritesStableSingleLineLogText
()
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]
49
public
void
Format_AppendsExceptionDetailsWhenPresent
()
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
}
Dreamine.FullKit.Tests.Logging
Definition
DreamineTextLogFormatterTests.cs:4
Dreamine.FullKit.Tests.Logging.DreamineTextLogFormatterTests
Definition
DreamineTextLogFormatterTests.cs:15
Dreamine.FullKit.Tests.Logging.DreamineTextLogFormatterTests.Format_WritesStableSingleLineLogText
void Format_WritesStableSingleLineLogText()
Definition
DreamineTextLogFormatterTests.cs:25
Dreamine.FullKit.Tests.Logging.DreamineTextLogFormatterTests.Format_AppendsExceptionDetailsWhenPresent
void Format_AppendsExceptionDetailsWhenPresent()
Definition
DreamineTextLogFormatterTests.cs:49
Logging
DreamineTextLogFormatterTests.cs
다음에 의해 생성됨 :
1.17.0