Ejemplo n.º 1
0
        /// <summary>
        /// Creates tasks that polls the DidReceiveAllMessages property in MessageCaptureContext
        /// </summary>
        /// <param name="messageCaptureContext">
        /// </param>
        /// <param name="cancellationToken">
        /// </param>
        private static async Task DidReceiveAllMessages(MessageCaptureContext messageCaptureContext, CancellationToken cancellationToken)
        {
            if (cancellationToken.IsCancellationRequested)
            {
                return;
            }

            while (!messageCaptureContext.DidReceiveAllMessages)
            {
                await Task.Delay(250, cancellationToken);
            }
        }
        /// <summary>
        /// Create TestCase of given test case type
        /// </summary>
        /// <param name="testCaseType">
        /// </param>
        /// <param name="messageCaptureContext">
        /// </param>
        /// <returns>
        /// </returns>
        public static TestCase Create(TestCaseType testCaseType, MessageCaptureContext messageCaptureContext)
        {
            switch (testCaseType)
            {
            case TestCaseType.RequestResponse:
                return(new RequestResponseTestCase(messageCaptureContext));

            case TestCaseType.ConsumeConsumer:
                return(new ConsumeConsumerTestCase(messageCaptureContext));

            case TestCaseType.WebShop:
                return(new WebshopTestCase(messageCaptureContext));

            default:
                throw new ArgumentOutOfRangeException(nameof(testCaseType), testCaseType, null);
            }
        }
 public PublishObserver(MessageCaptureContext messageCaptureContext)
 {
     _messageCaptureContext = messageCaptureContext;
 }
 public ReceiveObserver(MessageCaptureContext messageCaptureContext)
 {
     _messageCaptureContext = messageCaptureContext;
 }
 /// <summary>
 /// Constructor that passes the TestCaseConfiguration to the AbstractTestCase
 /// </summary>
 /// <param name="telemetryClient">
 /// </param>
 public WebshopTestCase(MessageCaptureContext telemetryClient) : base(telemetryClient)
 {
 }
 /// <summary>
 /// Constructor that passes the TestCaseConfiguration to the AbstractTestCase
 /// </summary>
 /// <param name="messageCaptureContext">
 /// </param>
 public RequestResponseTestCase(MessageCaptureContext messageCaptureContext) : base(messageCaptureContext)
 {
 }
 public SendObserver(MessageCaptureContext messageCaptureContext)
 {
     _messageCaptureContext = messageCaptureContext;
 }
 /// <summary>
 /// Abstract class with a Benchmark method that is used to call a callback on given test parameters
 /// </summary>
 /// <param name="messageCaptureContext">
 /// </param>
 protected TestCase(MessageCaptureContext messageCaptureContext)
 {
     _messageCaptureContext = messageCaptureContext;
 }
Ejemplo n.º 9
0
 protected ConcreteTestCase(MessageCaptureContext messageCaptureContext) : base(messageCaptureContext)
 {
 }
Ejemplo n.º 10
0
 public ConsumeObserver(MessageCaptureContext messageCaptureContext)
 {
     _messageCaptureContext = messageCaptureContext;
 }
 /// <summary>
 /// Constructor that passes the TestCaseConfiguration through to the AbstractTestCase
 /// </summary>
 /// <param name="telemetryClient">
 /// </param>
 public ConsumeConsumerTestCase(MessageCaptureContext telemetryClient) : base(telemetryClient)
 {
 }