Skip to content

Commit

Permalink
Add unit test for Status (#1896)
Browse files Browse the repository at this point in the history
  • Loading branch information
pellared authored Mar 10, 2021
1 parent 45a02a8 commit fb38dd8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion test/OpenTelemetry.Tests/Trace/StatusTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,21 @@ public void CheckingDefaultStatus()
}

[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()
{
Expand Down

0 comments on commit fb38dd8

Please sign in to comment.