public void Check_client_region() { var supplier = new Supplier { RegionMask = 2 }; var address = new Address { Client = new Client { MaskRegion = 1 } }; var log = new DocumentReceiveLog(supplier, address); Assert.Catch <EMailSourceHandlerException>(() => log.Check(session)); }
public void Check_user_update_time() { var client = TestClient.CreateNaked(); var supplier = TestSupplier.Create(); session.CreateSQLQuery( "update Logs.AuthorizationDates set AFTime = '2012-05-06' where UserId = :userId") .SetParameter("userId", client.Users[0].Id) .ExecuteUpdate(); var log = new DocumentReceiveLog( session.Load <Supplier>(supplier.Id), session.Load <Address>(client.Addresses[0].Id)); var e = Assert.Catch <EMailSourceHandlerException>(() => log.Check(session)); Assert.That(e.Message, Is.StringContaining("ни один пользователь этого адреса не обновляется более месяца")); }