Exemplo n.º 1
0
        public void ThrowIfCannotFindProcessKey()
        {
            var orchestratorClient = new Mock <IOrchestratorClient>();

            var client = new MyRpaClient(orchestratorClient.Object, _invalidSetting);

            Assert.Throws <InvalidOperationException>(() => client.CreatePurchaseOrderAsync(new CreatePurchaseOrderInput()).GetAwaiter().GetResult());
        }
Exemplo n.º 2
0
        public void CreatePurchaseOrderThrowIfNoOutput()
        {
            CreatePurchaseOrderOutput mockOutput = null;
            var mockResponse = CreateJobResponse(mockOutput);

            var client = new MyRpaClient(GetMockOrchestratorClient(mockResponse), _validSetting);

            Assert.Throws <ArgumentNullException>(() => client.CreatePurchaseOrderAsync(new CreatePurchaseOrderInput()).GetAwaiter().GetResult());
        }
Exemplo n.º 3
0
        public void CreatePurchaseOrderSuccess()
        {
            var mockOutput = new CreatePurchaseOrderOutput()
            {
                PurchaseOrderId = "123456",
            };

            var mockResponse = CreateJobResponse(mockOutput);

            var client = new MyRpaClient(GetMockOrchestratorClient(mockResponse), _validSetting);
            var output = client.CreatePurchaseOrderAsync(new CreatePurchaseOrderInput()).GetAwaiter().GetResult();

            Assert.Equal(mockOutput.PurchaseOrderId, output.PurchaseOrderId);
        }