Пример #1
0
        public async Task Db_ErrorsReportingService_GetApplicationAsync()
        {
            using (ThreadScopedLifestyle.BeginScope(container))
            {
                ErrorsReportingService service = container.GetInstance <ErrorsReportingService>();

                ErrorReportApplication application = await service.GetApplicationAsync("TestApplicationAlreadyExisting", "a.a.a.a");

                Assert.IsNotNull(application);
                Assert.Greater(application.Id, 0);
                Assert.AreEqual(new DateTime(2000, 1, 1), application.FirstRunDate);
            }
        }
Пример #2
0
        public void Db_ErrorsReportingService_GetApplicationAsync_NotExisting()
        {
            using (ThreadScopedLifestyle.BeginScope(container))
            {
                ErrorsReportingService service = container.GetInstance <ErrorsReportingService>();

                ErrorReportApplication application = null;
                Assert.That(async() =>
                {
                    application = await service.GetApplicationAsync("TestApplicationAlreadyExisting", "z.z.z.z");
                }, Throws.Nothing);

                Assert.IsNull(application);
            }
        }