public void Given1(string guidName) { using (var context = GetVouchersInformationBus.CreateContext()) { context.Database.ExecuteSqlCommand("DELETE FROM [response_data] WHERE [guid_name] = @p0", guidName); context.Database.ExecuteSqlCommand("DELETE FROM [response_done] WHERE [guid_name] = @p0", guidName); } }
public void When1(Table table) { var publishInfo = table.CreateInstance <PublishInformation>(); // synchronous Publish will wait until confirmed publish or timeout exception thrown GetVouchersInformationBus.Publish(message, publishInfo.CorrelationId, publishInfo.RoutingKey); Thread.Sleep(publishInfo.PublishTimeOutSeconds * 1000); }
public void Then1(string jobIdentifier, Table table) { if (request == null) { var task = GetVouchersInformationBus.GetRequestAsync(5); task.Wait(); request = task.Result; Assert.IsNotNull(request, "No response received"); } table.CompareToSet(request.Single(_ => _.jobIdentifier == jobIdentifier).searchCriteria); }
public void Then2(Table table) { var expected = table.CreateInstance <DipsResponseDone>(); DipsResponseDone actual; using (var context = GetVouchersInformationBus.CreateContext()) { actual = context.DipsResponseDone.SingleOrDefault(d => d.guid_name == expected.guid_name); } Assert.IsNotNull(actual, "Could not find row with guid name {0} in the response_done queue", expected.guid_name); TrimAllProperties(actual); table.CompareToInstance(actual); }
public void Given1(Table table) { using (var context = GetVouchersInformationBus.CreateContext()) { //Clear table context.Database.ExecuteSqlCommand("TRUNCATE TABLE request"); var dbRows = table.CreateSet <DipsRequest>(); foreach (var dbRow in dbRows) { context.DipsRequest.Add(dbRow); } context.SaveChanges(); } }