public void ResultSerializationTests() { CalculationResult res1 = new CalculationResult(ar1, row, time1, id1); CalculationResult res2 = CalculationResult.GetFromBytes(CalculationResult.ToBytes(res1)); Assert.AreEqual(res1, res2); }
public void Run() { consumer.Received += (model, ea) => { var body = ea.Body; CalculationResult result = worker.Calculate(UnitOfWork.GetFromBytes(ea.Body)); var props = ea.BasicProperties; var id = props.CorrelationId; channel.BasicAck(deliveryTag: ea.DeliveryTag, multiple: false); var b = CalculationResult.ToBytes(result); channel.BasicPublish(exchange: "", routingKey: Queues.ReponseQueue, basicProperties: props, body: CalculationResult.ToBytes(result)); }; Console.ReadLine(); }