protected void CheckErrorMessage(TestPriceItem priceItem, string etalonMessage) { var query = String.Format(@"select ShortErrorMessage from `logs`.downlogs where PriceItemId = {0}", priceItem.Id); var message = String.Empty; With.Connection(connection => { message = MySqlHelper.ExecuteScalar(connection, query).ToString(); }); Assert.That(message.Contains(etalonMessage), Is.True); }
protected void CheckDownloadedFile() { var querySelectDownlogId = String.Format(@"select count(RowId) from `logs`.downlogs where PriceItemId = {0}", priceItem.Id); var countDownlogId = 0; With.Connection(connection => { countDownlogId = Convert.ToInt32(MySqlHelper.ExecuteScalar(connection, querySelectDownlogId)); }); Assert.That(countDownlogId, Is.EqualTo(1)); }
public void FtpChangePassiveModeTest() { source.PricePath = "217.173.73.200"; source.PriceMask = "price.rar"; source.ExtrMask = "price*.dbf"; source.FtpLogin = "******"; source.FtpPassword = "******"; source.FtpDir = "price"; source.Save(); Process(); var sql = String.Format(@"select count(*) from `logs`.downlogs where PriceItemId = {0}", priceItem); var count = 0; With.Connection(connection => count = Convert.ToInt32(MySqlHelper.ExecuteScalar(connection, sql))); var files = Directory.GetFiles(Settings.Default.InboundPath); Assert.That(count, Is.EqualTo(1)); }