public void Db_ErrorsReportingService_CreateApplicationAsync_AlreadyExists() { using (ThreadScopedLifestyle.BeginScope(container)) { ErrorsReportingService service = container.GetInstance <ErrorsReportingService>(); DalException ex = Assert.ThrowsAsync <DalException>(async() => { await service.CreateApplicationAsync("TestApplicationAlreadyExisting", "a.a.a.a"); }); Assert.That(ex.errorType, Is.EqualTo(DalErrorType.SqlUniqueConstraintViolation)); } }
public async Task Db_ErrorsReportingService_CreateApplicationAsync() { using (ThreadScopedLifestyle.BeginScope(container)) { ErrorsReportingService service = container.GetInstance <ErrorsReportingService>(); ErrorReportApplication result = await service.CreateApplicationAsync("TestApplicationAsync", "a.a.a.a"); Assert.IsNotNull(result); Assert.Greater(result.Id, 0); this.dataSet.ApplicationsIds.Add(result.Id); } }