-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Version 2.0.4 - 23.09.2018 - `BacktraceClient` allows developer to unpack `AggregateException` and send only exceptions available in `InnerExceptions` property. - `BacktraceReport` accepts two new properties: `Factor` and `Fingerprint`. These properties allows you to change server side algorithms. - `BacktraceData` now include informations about `Exception` properties. You can check detailed `Exception` properties in Annotations. - `BacktraceDatabase` doesn't throw exception when developer can't add new record. This situation exists when database was full or database hasn't enough disk space for exceptions. - `BacktraceResult` can use new `Status`. In case when developer want to unpack `AggregateException` and `InnerExceptions` property is empty, `BacktraceClient` return `BacktraceResult` with status `Empty`,
- Loading branch information
1 parent
a5f98ba
commit 0d32fac
Showing
31 changed files
with
485 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
using Backtrace.Interfaces; | ||
using Backtrace.Model; | ||
using Backtrace.Types; | ||
using Moq; | ||
using NUnit.Framework; | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace Backtrace.Tests.ClientTests | ||
{ | ||
[TestFixture( | ||
Author = "Konrad Dysput", | ||
Category = "Client.AggreagateException", | ||
Description = "Test client bahaviour for handling aggreagate exceptions")] | ||
public class AggregateExceptionTests | ||
{ | ||
protected BacktraceClient _backtraceClient; | ||
|
||
[SetUp] | ||
public virtual void Setup() | ||
{ | ||
var api = new Mock<IBacktraceApi>(); | ||
api.Setup(n => n.Send(It.IsAny<BacktraceData>())) | ||
.Returns(new BacktraceResult() { Status = BacktraceResultStatus.Ok }); | ||
|
||
api.Setup(n => n.SendAsync(It.IsAny<BacktraceData>())) | ||
.ReturnsAsync(() => new BacktraceResult() { Status = BacktraceResultStatus.Ok }); | ||
|
||
var credentials = new BacktraceCredentials(@"https://validurl.com/", "validToken"); | ||
_backtraceClient = new BacktraceClient(credentials) | ||
{ | ||
BacktraceApi = api.Object, | ||
UnpackAggregateExcetpion = true | ||
}; | ||
} | ||
|
||
[Test(Description = "Test empty aggregate exception")] | ||
public void TestEmptyAggreagateException() | ||
{ | ||
var aggregateException = new AggregateException("test exception"); | ||
var result = _backtraceClient.Send(aggregateException); | ||
Assert.IsNotNull(result); | ||
Assert.AreEqual(result.Status, BacktraceResultStatus.Empty); | ||
} | ||
|
||
[Test(Description = "Test default scenario for aggregate exception")] | ||
public void TestAggreagateException() | ||
{ | ||
var aggregateException = new AggregateException("test exception", | ||
new List<Exception>() { | ||
new ArgumentException("argument exception"), | ||
new InvalidOperationException("invalid operation exception"), | ||
new FormatException("format exception"), | ||
}); | ||
var result = _backtraceClient.Send(aggregateException); | ||
|
||
Assert.IsNotNull(result); | ||
Assert.AreEqual(result.Status, BacktraceResultStatus.Ok); | ||
|
||
int totalReports = 0; | ||
while (result != null) | ||
{ | ||
totalReports++; | ||
result = result.InnerExceptionResult; | ||
} | ||
Assert.AreEqual(3, totalReports); | ||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.