Add unit test for Status (#1896)
This commit is contained in:
parent
45a02a8f08
commit
fb38dd8c00
|
|
@ -34,13 +34,21 @@ namespace OpenTelemetry.Trace.Tests
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void CreateStatus_WithDescription()
|
||||
public void CreateStatus_Error_WithDescription()
|
||||
{
|
||||
var status = Status.Error.WithDescription("This is an error.");
|
||||
Assert.Equal(StatusCode.Error, status.StatusCode);
|
||||
Assert.Equal("This is an error.", status.Description);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CreateStatus_Ok_WithDescription()
|
||||
{
|
||||
var status = Status.Ok.WithDescription("This is will not be set.");
|
||||
Assert.Equal(StatusCode.Ok, status.StatusCode);
|
||||
Assert.Null(status.Description);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Equality()
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue