using e_suite.Modules.ExceptionLogManager.UnitTests.Helpers; using e_suite.Utilities.Pagination; using NUnit.Framework; namespace e_suite.Modules.ExceptionLogManager.UnitTests { public class LogExceptionUnitTests: ExceptionLogManagerTestBase { [SetUp] public override async Task Setup() { await base.Setup(); } [Test] public async Task LogException_WhenCalled_UsingRespository_ReturnsExpectedResult() { //Act await ExceptionLogManager.LogException(new DivideByZeroException(), "Unit Test", string.Empty, CancellationToken.None); var result = ExceptionLogManagerRepository.GetExceptionLogs(); //Assert Assert.That(result, Is.Not.Null); Assert.That(result.Count, Is.EqualTo(1)); Assert.Pass(); } [Test] public async Task LogException_WhenCalled_UsingLogger_ReturnsExpectedResult() { //Act await ExceptionLogManager.LogException(new DivideByZeroException(), "Unit Test", string.Empty, CancellationToken.None); var result = await ExceptionLogManager.GetExceptionLogs(new Paging(), CancellationToken.None); //Assert Assert.That(result, Is.Not.Null); Assert.That(result, Has.Count.EqualTo(1)); Assert.Pass(); } } }